summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2022-12-17 06:24:48 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2023-01-11 20:15:19 +0100
commitf08142bc3a60f5af632ba48dc2fef8797043086d (patch)
tree2c1dda556386922bced78c3bf6dddc8d5720d673
parentf2fs: merge f2fs_show_injection_info() into time_to_inject() (diff)
downloadlinux-f08142bc3a60f5af632ba48dc2fef8797043086d.tar.xz
linux-f08142bc3a60f5af632ba48dc2fef8797043086d.zip
f2fs: convert to use MIN_DISCARD_GRANULARITY macro
Commit 1cd2e6d54435 ("f2fs: define MIN_DISCARD_GRANULARITY macro") introduce it, let's convert to use MIN_DISCARD_GRANULARITY macro. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/segment.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index ba8331434703..f8e0ccfa0f52 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1604,9 +1604,9 @@ static unsigned int __wait_all_discard_cmd(struct f2fs_sb_info *sbi,
return __wait_discard_cmd_range(sbi, dpolicy, 0, UINT_MAX);
/* wait all */
- __init_discard_policy(sbi, &dp, DPOLICY_FSTRIM, 1);
+ __init_discard_policy(sbi, &dp, DPOLICY_FSTRIM, MIN_DISCARD_GRANULARITY);
discard_blks = __wait_discard_cmd_range(sbi, &dp, 0, UINT_MAX);
- __init_discard_policy(sbi, &dp, DPOLICY_UMOUNT, 1);
+ __init_discard_policy(sbi, &dp, DPOLICY_UMOUNT, MIN_DISCARD_GRANULARITY);
discard_blks += __wait_discard_cmd_range(sbi, &dp, 0, UINT_MAX);
return discard_blks;
@@ -1689,7 +1689,8 @@ static int issue_discard_thread(void *data)
if (sbi->gc_mode == GC_URGENT_HIGH ||
!f2fs_available_free_memory(sbi, DISCARD_CACHE))
- __init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, 1);
+ __init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE,
+ MIN_DISCARD_GRANULARITY);
else
__init_discard_policy(sbi, &dpolicy, DPOLICY_BG,
dcc->discard_granularity);