aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Yan2022-09-16 22:15:27 +0800
committerTheodore Ts'o2022-09-30 23:46:54 -0400
commit3df11e27f02c3dea5a3a0e45628d67f0d82c3c5e (patch)
tree7e46d01a08d79b870363f5face19fd8b43ac74b3
parentc8267c51425abd4f75d0ad07c4d3ee748908e2f8 (diff)
ext4: move DIOREAD_NOLOCK setting to ext4_set_def_opts()
Now since all preparations is done, we can move the DIOREAD_NOLOCK setting to ext4_set_def_opts(). Suggested-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Jason Yan <yanaijie@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20220916141527.1012715-17-yanaijie@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--fs/ext4/super.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 9db5be55de40..d733db8a0b02 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4335,6 +4335,9 @@ static void ext4_set_def_opts(struct super_block *sb,
if (!IS_EXT3_SB(sb) && !IS_EXT2_SB(sb) &&
((def_mount_opts & EXT4_DEFM_NODELALLOC) == 0))
set_opt(sb, DELALLOC);
+
+ if (sb->s_blocksize == PAGE_SIZE)
+ set_opt(sb, DIOREAD_NOLOCK);
}
static int ext4_handle_clustersize(struct super_block *sb)
@@ -5080,9 +5083,6 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
*/
sbi->s_li_wait_mult = EXT4_DEF_LI_WAIT_MULT;
- if (sb->s_blocksize == PAGE_SIZE)
- set_opt(sb, DIOREAD_NOLOCK);
-
if (ext4_inode_info_init(sb, es))
goto failed_mount;