f2fs: change victim segmap test condition in get_victim_by_default
Subsystems (2)
PATCH 1/5 f2fs: change victim segmap test condition in get_victim_by_default
From: Namjae Jeon <[email protected]>
Instead of checking for victim_segmap(FG_GC) OR
(gc_type == BG_GC) && victim_segmap(BG_GC);
to continue for the victim selection. The 2 conditions
can simply be merged and decision can directly be made using 'gc_type'.
--- fs/f2fs/gc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
fs/f2fs/gc.c +1 -4
@@ -266,10 +266,7 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi, } p.offset = ((segno / p.ofs_unit) * p.ofs_unit) + p.ofs_unit; -if (test_bit (segno, dirty_i->victim_segmap[FG_GC ])) -continue ; -if (gc_type ==BG_GC && -test_bit (segno, dirty_i->victim_segmap[BG_GC ])) +if (test_bit (segno, dirty_i->victim_segmap[gc_type]))continue ;if (IS_CURSEC (sbi,GET_SECNO (sbi, segno)))continue ;
Signature · 1 line
1.7.9.5
2013-03-02 (토), 12:40 +0900, Namjae Jeon:
Quoted 18 lines
From: Namjae Jeon <[email protected]>
Instead of checking for
victim_segmap(FG_GC)OR
(gc_type==BG_GC) &&victim_segmap(BG_GC);
to continue for the victim selection. The 2 conditions
can simply be merged and decision can directly be made using 'gc_type'.Signed-off-by Namjae Jeon <[email protected]>Signed-off-by Amit Sahrawat <[email protected]>--- fs/f2fs/gc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)fs/f2fs/gc.c +0
-0
fs/f2fs/gc.c static int get_victim_by_default(struct f2fs_sb_info *sbi, · line 269
Quoted 8 lines
fs/f2fs/gc.c +1
-4@@ -266,10 +266,7 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi, } p.offset = ((segno / p.ofs_unit) * p.ofs_unit) + p.ofs_unit; -if (test_bit (segno, dirty_i->victim_segmap[FG_GC ])) -continue ; -if (gc_type ==BG_GC && -test_bit (segno, dirty_i->victim_segmap[BG_GC ])) +if (test_bit (segno, dirty_i->victim_segmap[gc_type]))
Negative.
We should check FG_GC all the time.
Thanks,
Quoted 3 lines
fs/f2fs/gc.c +0
-0continue ;if (IS_CURSEC (sbi,GET_SECNO (sbi, segno)))continue ;
Signature · 2 lines
Jaegeuk Kim Samsung