diff options
author | Ira Weiny <ira.weiny@intel.com> | 2020-05-28 17:00:00 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-05-29 04:09:47 +0200 |
commit | 9cb20f94afcd2964944f9468e38da736ee855b19 (patch) | |
tree | f87b49bb0d91b290cc39011d4afb23a03c138430 /fs/ext4/inode.c | |
parent | fs/ext4: Only change S_DAX on inode load (diff) | |
download | linux-9cb20f94afcd2964944f9468e38da736ee855b19.tar.xz linux-9cb20f94afcd2964944f9468e38da736ee855b19.zip |
fs/ext4: Make DAX mount option a tri-state
We add 'always', 'never', and 'inode' (default). '-o dax' continues to
operate the same which is equivalent to 'always'. This new
functionality is limited to ext4 only.
Specifically we introduce a 2nd DAX mount flag EXT4_MOUNT2_DAX_NEVER and set
it and EXT4_MOUNT_DAX_ALWAYS appropriately for the mode.
We also force EXT4_MOUNT2_DAX_NEVER if !CONFIG_FS_DAX.
Finally, EXT4_MOUNT2_DAX_INODE is used solely to detect if the user
specified that option for printing.
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20200528150003.828793-7-ira.weiny@intel.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 01636cf5f322..68fac9289109 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4402,6 +4402,8 @@ static bool ext4_should_enable_dax(struct inode *inode) { struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); + if (test_opt2(inode->i_sb, DAX_NEVER)) + return false; if (!S_ISREG(inode->i_mode)) return false; if (ext4_should_journal_data(inode)) |