]> git.baikalelectronics.ru Git - kernel.git/commit
fs/ext4: Introduce DAX inode flag
authorIra Weiny <ira.weiny@intel.com>
Thu, 28 May 2020 15:00:02 +0000 (08:00 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 29 May 2020 02:09:47 +0000 (22:09 -0400)
commit7e0beea3fb94bac017fac4fd88b11ca92d6f1038
tree1631eb8ee0a22c9116196cf92d679e6e40b3f674
parentc029f328a5d945d2c8b8bf994112bdf85d56fc5e
fs/ext4: Introduce DAX inode flag

Add a flag ([EXT4|FS]_DAX_FL) to preserve FS_XFLAG_DAX in the ext4
inode.

Set the flag to be user visible and changeable.  Set the flag to be
inherited.  Allow applications to change the flag at any time except if
it conflicts with the set of mutually exclusive flags (Currently VERITY,
ENCRYPT, JOURNAL_DATA).

Furthermore, restrict setting any of the exclusive flags if DAX is set.

While conceptually possible, we do not allow setting EXT4_DAX_FL while
at the same time clearing exclusion flags (or vice versa) for 2 reasons:

1) The DAX flag does not take effect immediately which
   introduces quite a bit of complexity
2) There is no clear use case for being this flexible

Finally, on regular files, flag the inode to not be cached to facilitate
changing S_DAX on the next creation of the inode.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20200528150003.828793-9-ira.weiny@intel.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/inode.c
fs/ext4/ioctl.c
fs/ext4/super.c
fs/ext4/verity.c
include/uapi/linux/fs.h