From 68c2da290cb52a05a54a52f73ef87afc00a8c934 Mon Sep 17 00:00:00 2001 From: Li Xi Date: Mon, 27 Jun 2016 11:16:17 +0800 Subject: [PATCH] LU-4017 e2fsprogs: add inherit flags for project quota This patch add EXT4_PROJINHERIT_FL to enable inherit feature for project quota. Signed-off-by: Li Xi Signed-off-by: Wang Shilong Change-Id: If7c7ee34f48beea32b208528148d42167ca0f2fd Reviewed-on: http://review.whamcloud.com/15764 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Andreas Dilger --- lib/e2p/pf.c | 1 + lib/ext2fs/ext2_fs.h | 5 +++-- misc/chattr.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/e2p/pf.c b/lib/e2p/pf.c index e2f8ce5..22d0c25 100644 --- a/lib/e2p/pf.c +++ b/lib/e2p/pf.c @@ -50,6 +50,7 @@ static struct flags_name flags_array[] = { { EXT4_EXTENTS_FL, "e", "Extents" }, { EXT4_HUGE_FILE_FL, "h", "Huge_file" }, { FS_NOCOW_FL, "C", "No_COW" }, + { EXT4_PROJINHERIT_FL, "P", "Project_Iherit" }, { 0, NULL, NULL } }; diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index 0438720..d70821d 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -310,10 +310,11 @@ struct ext2_dx_countlimit { #define EXT4_SNAPFILE_FL 0x01000000 /* Inode is a snapshot */ #define EXT4_SNAPFILE_DELETED_FL 0x04000000 /* Snapshot is being deleted */ #define EXT4_SNAPFILE_SHRUNK_FL 0x08000000 /* Snapshot shrink has completed */ +#define EXT4_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ #define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ -#define EXT2_FL_USER_VISIBLE 0x004BDFFF /* User visible flags */ -#define EXT2_FL_USER_MODIFIABLE 0x004B80FF /* User modifiable flags */ +#define EXT2_FL_USER_VISIBLE 0x204BDFFF /* User visible flags */ +#define EXT2_FL_USER_MODIFIABLE 0x204B80FF /* User modifiable flags */ /* * ioctl commands diff --git a/misc/chattr.c b/misc/chattr.c index f130108..f5fa397 100644 --- a/misc/chattr.c +++ b/misc/chattr.c @@ -83,7 +83,7 @@ static unsigned long sf; static void usage(void) { fprintf(stderr, - _("Usage: %s [-RVf] [-+=aAcCdDeijsStTu] [-v version] files...\n"), + _("Usage: %s [-RVf] [-+=aAcCdDeijPsStTu] [-v version] files...\n"), program_name); exit(1); } @@ -103,6 +103,7 @@ static const struct flags_char flags_array[] = { { EXT4_EXTENTS_FL, 'e'}, { EXT2_IMMUTABLE_FL, 'i' }, { EXT3_JOURNAL_DATA_FL, 'j' }, + { EXT4_PROJINHERIT_FL, 'P' }, { EXT2_SECRM_FL, 's' }, { EXT2_UNRM_FL, 'u' }, { EXT2_NOTAIL_FL, 't' }, -- 1.8.3.1