From: Andreas Dilger Date: Wed, 2 Jun 2010 02:21:42 +0000 (-0400) Subject: Reserve the EXT4_FEATURE_INCOMPAT_DIRDATA feature flag X-Git-Tag: debian-1.41.12-2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30a7610edfc0c22cb6b5ad9f76f65700fb6ffe98;p=thirdparty%2Fe2fsprogs.git Reserve the EXT4_FEATURE_INCOMPAT_DIRDATA feature flag Reserve the EXT4_FEATURE_INCOMPAT_DIRDATA feature flag for adding extra file data in ext2_dir_entry_2 entries. This changes the on-disk layout in the following way. Firstly, the ext2_dir_entry_2 file_type field now has a mask: that limits the "filetype" information to the low 4 bits of this field. Since these values are sequentially assigned, this allows for up to 7 more filetypes to be assigned. When reading the "filetype" field, the high 4 bits should be masked off when converting to DT_* filetypes for userspace. The high 4 bits of "filetype" are used as a bitmask to register up to 4 different "extended" directory entry fields. Extended data fields are packed without alignment into the directory entry after the "name" field in order of increasing bitmask value, for each field where bit is set. In order to avoid the need to "understand" each of the extended fields, the first byte of each extended data field holds the size of that data field (including the size itself), so they can be skipped if not understood. For fields that change the semantics of the filesystem it is expected that a separate ROCOMPAT or INCOMPAT field is registered. There is a single dirent data type defined currently, for Lustre: which holds a 128-bit file identifier. It is expected that if there are 64-bit inode values that this will be assigned the 0x20 value. Should a need ever arise to use all 4 of the extended dirent data fields, it would be possible to keep the last bit (0x80) for use as a multiplexor that stores a 1-byte aggregate data size, then a series of "" records in the last extended data record. It is not expected that this will actually be needed in the lifetime of ext4. Signed-off-by: Andreas Dilger Signed-off-by: "Theodore Ts'o" --- diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index 12d8ead15..cb2131800 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -647,6 +647,7 @@ struct ext2_super_block { #define EXT4_FEATURE_INCOMPAT_MMP 0x0100 #define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 #define EXT4_FEATURE_INCOMPAT_EA_INODE 0x0400 +#define EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000 #define EXT2_FEATURE_COMPAT_SUPP 0