|
@@ -268,6 +268,9 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi,
|
|
p.min_segno = NULL_SEGNO;
|
|
p.min_segno = NULL_SEGNO;
|
|
p.min_cost = max_cost = get_max_cost(sbi, &p);
|
|
p.min_cost = max_cost = get_max_cost(sbi, &p);
|
|
|
|
|
|
|
|
+ if (p.max_search == 0)
|
|
|
|
+ goto out;
|
|
|
|
+
|
|
if (p.alloc_mode == LFS && gc_type == FG_GC) {
|
|
if (p.alloc_mode == LFS && gc_type == FG_GC) {
|
|
p.min_segno = check_bg_victims(sbi);
|
|
p.min_segno = check_bg_victims(sbi);
|
|
if (p.min_segno != NULL_SEGNO)
|
|
if (p.min_segno != NULL_SEGNO)
|
|
@@ -329,6 +332,7 @@ got_it:
|
|
sbi->cur_victim_sec,
|
|
sbi->cur_victim_sec,
|
|
prefree_segments(sbi), free_segments(sbi));
|
|
prefree_segments(sbi), free_segments(sbi));
|
|
}
|
|
}
|
|
|
|
+out:
|
|
mutex_unlock(&dirty_i->seglist_lock);
|
|
mutex_unlock(&dirty_i->seglist_lock);
|
|
|
|
|
|
return (p.min_segno == NULL_SEGNO) ? 0 : 1;
|
|
return (p.min_segno == NULL_SEGNO) ? 0 : 1;
|