aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorYangtao Li2023-03-31 00:56:48 +0800
committerJaegeuk Kim2023-04-10 10:58:45 -0700
commitc2c14ca5b1f3591ebf7f75e374ddd65c574c9d42 (patch)
treeecfd456c5540fa6f64290c4ab2c498381710ead4 /fs/f2fs
parentd11cef14f8146f3babd286c2cc8ca09c166295e2 (diff)
f2fs: set default compress option only when sb_has_compression
If the compress feature is not enabled, there is no need to set compress-related parameters. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/super.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 7d0202f7b317..cc41c315446c 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2072,10 +2072,12 @@ static void default_options(struct f2fs_sb_info *sbi)
F2FS_OPTION(sbi).fsync_mode = FSYNC_MODE_POSIX;
F2FS_OPTION(sbi).s_resuid = make_kuid(&init_user_ns, F2FS_DEF_RESUID);
F2FS_OPTION(sbi).s_resgid = make_kgid(&init_user_ns, F2FS_DEF_RESGID);
- F2FS_OPTION(sbi).compress_algorithm = COMPRESS_LZ4;
- F2FS_OPTION(sbi).compress_log_size = MIN_COMPRESS_LOG_SIZE;
- F2FS_OPTION(sbi).compress_ext_cnt = 0;
- F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
+ if (f2fs_sb_has_compression(sbi)) {
+ F2FS_OPTION(sbi).compress_algorithm = COMPRESS_LZ4;
+ F2FS_OPTION(sbi).compress_log_size = MIN_COMPRESS_LOG_SIZE;
+ F2FS_OPTION(sbi).compress_ext_cnt = 0;
+ F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
+ }
F2FS_OPTION(sbi).bggc_mode = BGGC_MODE_ON;
F2FS_OPTION(sbi).memory_mode = MEMORY_MODE_NORMAL;