From: Jaegeuk Kim Date: Tue, 7 Jun 2016 01:49:54 +0000 (-0700) Subject: f2fs: skip clean segment for gc X-Git-Tag: v4.8-rc1~145^2~38 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=aa987273290d206b298e9d09db83e32ead661098;p=karo-tx-linux.git f2fs: skip clean segment for gc If a segment in a section is clean or prefreed, we don't need to get its summary and do gc. Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 67fd2855ccc9..e1d274cdecb8 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -795,6 +795,10 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, } for (segno = start_segno; segno < end_segno; segno++) { + + if (get_valid_blocks(sbi, segno, 1) == 0) + continue; + /* find segment summary of victim */ sum_page = find_get_page(META_MAPPING(sbi), GET_SUM_BLOCK(sbi, segno));