-this patch implements feature which allows ext4 fs users (e.g. Lustre)
-to store data in ext4 dirent.
-data is stored in ext4 dirent after file-name, this space is accounted
-in de->rec_len. flag EXT4_DIRENT_LUFID added to d_type if extra data
-is present.
+commit 2db3b2b33ee796f4ea61316773452d936303ad27
+Author: Pravin Shelar <Pravin.Shelar@sun.com>
+AuthorDate: Sun Oct 4 18:13:14 2009 +0000
+Subject: ext4: add ext4-data-in-dirent patch
-make use of dentry->d_fsdata to pass fid to ext4. so no
-changes in ext4_add_entry() interface required.
+Allows ext4 to store extra data records inside the ext4_dirent
+along with the regular directory entry (type, length, filename).
+Data is stored in ext4 dirent after filename, with a bit flag in
+de->file_type to indicate if any record after de->name is used.
+Each in-use record is variable length and must store a 1-byte
+length (including the length byte itself) at the start so that it
+can be skipped if the record type is unknown/uneeded. The record
+starts after a NUL byte terminator for the filename. This extra
+space is accounted in de->rec_len but not de->name_len.
+Flag EXT4_DIRENT_LUFID is used for a 128-bit file identifier.
+Make use of dentry->d_fsdata to pass LUFID to ext4, so no changes
+in ext4_add_entry() interface are required.
+
+Bugzilla-ID: b=17670
+Signed-off-by: Pravin Shelar <Pravin.Shelar@sun.com>
+Reviewed-by: Huang Hua <h.huang@sun.com>
+Signed-off-by: Andreas Dilger <andreas.dilger@sun.com>
---
fs/ext4/dir.c | 13 ++-
fs/ext4/ext4.h | 97 +++++++++++++++++++++++++-
};
/*
-@@ -1161,6 +1162,7 @@ struct ext4_inode_info {
- #define EXT4_MOUNT_POSIX_ACL 0x08000 /* POSIX Access Control Lists */
- #define EXT4_MOUNT_NO_AUTO_DA_ALLOC 0x10000 /* No auto delalloc mapping */
- #define EXT4_MOUNT_BARRIER 0x20000 /* Use block barriers */
-+#define EXT4_MOUNT_DIRDATA 0x60000 /* Data in directory entries*/
- #define EXT4_MOUNT_QUOTA 0x40000 /* Some quota option set */
- #define EXT4_MOUNT_USRQUOTA 0x80000 /* "old" user quota,
- * enable enforcement for hidden
-@@ -1955,6 +1957,7 @@ EXT4_FEATURE_INCOMPAT_FUNCS(casefold, C
+@@ -1139,6 +1140,7 @@
+ * Mount flags set via mount options or defaults
+ */
+ #define EXT4_MOUNT_NO_MBCACHE 0x00001 /* Do not use mbcache */
++#define EXT4_MOUNT_DIRDATA 0x00002 /* Data in directory entries */
+ #define EXT4_MOUNT_GRPID 0x00004 /* Create files with directory's group */
+ #define EXT4_MOUNT_DEBUG 0x00008 /* Some debugging messages */
+ #define EXT4_MOUNT_ERRORS_CONT 0x00010 /* Continue on errors */
+@@ -1961,6 +1963,7 @@
EXT4_FEATURE_INCOMPAT_FLEX_BG| \
EXT4_FEATURE_INCOMPAT_EA_INODE| \
EXT4_FEATURE_INCOMPAT_MMP | \