From: Theodore Ts'o Date: Thu, 11 Jun 2020 14:51:44 +0000 (-0400) Subject: Enable ext4 support for per-file/directory dax operations X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=68cd44920d2ccf32dea1502e71dc0175c9663af1;p=linux.git Enable ext4 support for per-file/directory dax operations This adds the same per-file/per-directory DAX support for ext4 as was done for xfs, now that we finally have consensus over what the interface should be. --- 68cd44920d2ccf32dea1502e71dc0175c9663af1 diff --cc fs/ext4/ext4.h index 9e5c332a2b94b,598e00a9453fc..5148cbb0b4b34 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@@ -426,13 -415,16 +426,16 @@@ struct flex_groups #define EXT4_VERITY_FL 0x00100000 /* Verity protected inode */ #define EXT4_EA_INODE_FL 0x00200000 /* Inode used for large EA */ /* 0x00400000 was formerly EXT4_EOFBLOCKS_FL */ + + #define EXT4_DAX_FL 0x02000000 /* Inode is DAX */ + #define EXT4_INLINE_DATA_FL 0x10000000 /* Inode has inline data. */ #define EXT4_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ -#define EXT4_CASEFOLD_FL 0x40000000 /* Casefolded file */ +#define EXT4_CASEFOLD_FL 0x40000000 /* Casefolded directory */ #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */ - #define EXT4_FL_USER_VISIBLE 0x705BDFFF /* User visible flags */ - #define EXT4_FL_USER_MODIFIABLE 0x604BC0FF /* User modifiable flags */ + #define EXT4_FL_USER_VISIBLE 0x725BDFFF /* User visible flags */ + #define EXT4_FL_USER_MODIFIABLE 0x624BC0FF /* User modifiable flags */ /* Flags we can manipulate with through EXT4_IOC_FSSETXATTR */ #define EXT4_FL_XFLAG_VISIBLE (EXT4_SYNC_FL | \ @@@ -499,9 -497,9 +508,10 @@@ enum EXT4_INODE_VERITY = 20, /* Verity protected inode */ EXT4_INODE_EA_INODE = 21, /* Inode used for large EA */ /* 22 was formerly EXT4_INODE_EOFBLOCKS */ + EXT4_INODE_DAX = 25, /* Inode is DAX */ EXT4_INODE_INLINE_DATA = 28, /* Data in inode. */ EXT4_INODE_PROJINHERIT = 29, /* Create with parents projid */ + EXT4_INODE_CASEFOLD = 30, /* Casefolded directory */ EXT4_INODE_RESERVED = 31, /* reserved for ext4 lib */ }; diff --cc fs/ext4/super.c index c3983f87587d4,3658e30169999..a22d67c5bc00b --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@@ -3978,7 -4021,12 +4022,7 @@@ static int ext4_fill_super(struct super "both data=journal and delalloc"); goto failed_mount; } - if (test_opt(sb, DAX)) { - if (test_opt(sb, DIOREAD_NOLOCK)) { - ext4_msg(sb, KERN_ERR, "can't mount with " - "both data=journal and dioread_nolock"); - goto failed_mount; - } + if (test_opt(sb, DAX_ALWAYS)) { ext4_msg(sb, KERN_ERR, "can't mount with " "both data=journal and dax"); goto failed_mount;