summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-10-24 18:37:26 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-11-26 15:53:55 -0800
commit2c70c5e3874e8cf2f39f4ce4e2b832f4380a0c1b (patch)
treeedc61ac95eca64a9903e8926f790954e147902b4 /fs/f2fs/gc.c
parent7beb01f74415c56f5992922b5b902b45d365e694 (diff)
downloadlinux-2c70c5e3874e8cf2f39f4ce4e2b832f4380a0c1b.tar.gz
linux-2c70c5e3874e8cf2f39f4ce4e2b832f4380a0c1b.tar.bz2
linux-2c70c5e3874e8cf2f39f4ce4e2b832f4380a0c1b.zip
f2fs: introduce __is_large_section() for cleanup
Introduce a wrapper __is_large_section() to clean up codes. Signed-off-by: Chao Yu <yuchao0@huawei.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 9707773fdaac..84f49cb3147c 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1109,7 +1109,7 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
int submitted = 0;
/* readahead multi ssa blocks those have contiguous address */
- if (sbi->segs_per_sec > 1)
+ if (__is_large_section(sbi))
f2fs_ra_meta_pages(sbi, GET_SUM_BLOCK(sbi, segno),
sbi->segs_per_sec, META_SSA, true);
@@ -1318,7 +1318,7 @@ void f2fs_build_gc_manager(struct f2fs_sb_info *sbi)
sbi->gc_pin_file_threshold = DEF_GC_FAILED_PINNED_FILES;
/* give warm/cold data area from slower device */
- if (sbi->s_ndevs && sbi->segs_per_sec == 1)
+ if (sbi->s_ndevs && !__is_large_section(sbi))
SIT_I(sbi)->last_victim[ALLOC_NEXT] =
GET_SEGNO(sbi, FDEV(0).end_blk) + 1;
}