From: Li Xi Date: Tue, 1 Mar 2016 04:18:05 +0000 (-0500) Subject: Add inherit flags for project quota X-Git-Tag: android-x86-8.1-r1~49^2^2^2^2~201 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e1cec4464bdaf93ea609de43c5cdeb6a1f553483;p=android-x86%2Fexternal-e2fsprogs.git Add inherit flags for project quota This patch add EXT4_PROJINHERIT_FL to enable inherit feature for project ID. If an directory has its inherit flag set, all its newly created children will inherit its project ID. Conversely, new inodes will get a default project ID (i.e. zero). Also, no hard link or rename is permitted if the directory and child has different project ID. Signed-off-by: Li Xi Signed-off-by: Wang Shilong Signed-off-by: Theodore Ts'o --- diff --git a/lib/e2p/pf.c b/lib/e2p/pf.c index 89617272..27421a6e 100644 --- a/lib/e2p/pf.c +++ b/lib/e2p/pf.c @@ -46,6 +46,7 @@ static struct flags_name flags_array[] = { { EXT4_HUGE_FILE_FL, "h", "Huge_file" }, { FS_NOCOW_FL, "C", "No_COW" }, { EXT4_INLINE_DATA_FL, "N", "Inline_Data" }, + { EXT4_PROJINHERIT_FL, "P", "Project_Iherit" }, { 0, NULL, NULL } }; diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index fa3b3096..d16dd802 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -326,10 +326,11 @@ struct ext2_dx_tail { #define EXT4_SNAPFILE_DELETED_FL 0x04000000 /* Snapshot is being deleted */ #define EXT4_SNAPFILE_SHRUNK_FL 0x08000000 /* Snapshot shrink has completed */ #define EXT4_INLINE_DATA_FL 0x10000000 /* Inode has inline data */ +#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 e55d6937..40069c90 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' },