aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaegeuk Kim <[email protected]>2020-02-09 13:27:09 -0800
committerJaegeuk Kim <[email protected]>2020-03-19 11:41:26 -0700
commit8c7b9ac129d0962faa6f8b092424eab3427cc364 (patch)
tree1cfdc32622d7fb4e4eec1e0b9c6beec08072e84b
parentbbbc34fd66625473d20f89def2703f4f140d2ce8 (diff)
f2fs: add migration count iff migration happens
If first segment is empty and migration_granularity is 1, we can't move this at all. Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
-rw-r--r--fs/f2fs/gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index a19966b0e018..bb0b6435dcf7 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1240,12 +1240,12 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
segno, gc_type);
stat_inc_seg_count(sbi, type, gc_type);
+ migrated++;
freed:
if (gc_type == FG_GC &&
get_valid_blocks(sbi, segno, false) == 0)
seg_freed++;
- migrated++;
if (__is_large_section(sbi) && segno + 1 < end_segno)
sbi->next_victim_seg[gc_type] = segno + 1;