Commit aa987273 authored by Jaegeuk Kim's avatar Jaegeuk Kim

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: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 19a5f5e2
...@@ -795,6 +795,10 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, ...@@ -795,6 +795,10 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
} }
for (segno = start_segno; segno < end_segno; segno++) { for (segno = start_segno; segno < end_segno; segno++) {
if (get_valid_blocks(sbi, segno, 1) == 0)
continue;
/* find segment summary of victim */ /* find segment summary of victim */
sum_page = find_get_page(META_MAPPING(sbi), sum_page = find_get_page(META_MAPPING(sbi),
GET_SUM_BLOCK(sbi, segno)); GET_SUM_BLOCK(sbi, segno));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment