Commit 8c7b9ac1 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

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: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent bbbc34fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;