summaryrefslogtreecommitdiff
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-04-13 19:59:51 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2023-04-18 19:05:54 +0300
commitc1660d88a064409879f6d467754bbe27259c71bb (patch)
tree4102a23672a3266aeaa28f47ee31b737dece2ef7 /fs/f2fs/gc.c
parentbd90c5cd339a9d7cdc609d2d6310b80dc697070d (diff)
downloadlinux-c1660d88a064409879f6d467754bbe27259c71bb.tar.xz
f2fs: add has_enough_free_secs()
Replace !has_not_enough_free_secs w/ has_enough_free_secs. BTW avoid nested 'if' statements in f2fs_balance_fs(). Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index ba5775dcade6..a6a0dc471b74 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1872,7 +1872,7 @@ retry:
if (gc_type == FG_GC) {
sbi->cur_victim_sec = NULL_SEGNO;
- if (!has_not_enough_free_secs(sbi, sec_freed, 0)) {
+ if (has_enough_free_secs(sbi, sec_freed, 0)) {
if (!gc_control->no_bg_gc &&
sec_freed < gc_control->nr_free_secs)
goto go_gc_more;
@@ -1886,7 +1886,7 @@ retry:
ret = f2fs_write_checkpoint(sbi, &cpc);
goto stop;
}
- } else if (!has_not_enough_free_secs(sbi, 0, 0)) {
+ } else if (has_enough_free_secs(sbi, 0, 0)) {
goto stop;
}