Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377690
b: refs/heads/master
c: b2b3460
h: refs/heads/master
v: v3
  • Loading branch information
Namjae Jeon authored and Jaegeuk Kim committed Jun 6, 2013
1 parent b3f0f15 commit 16d736c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e03e38b35b8e72d65fd5d931627bd6ff02926c1
refs/heads/master: b2b3460a9404136e0a99b9f7cb56e08ec41ea933
8 changes: 4 additions & 4 deletions trunk/fs/f2fs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,14 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi,
{
struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
struct victim_sel_policy p;
unsigned int secno;
unsigned int secno, max_cost;
int nsearched = 0;

p.alloc_mode = alloc_mode;
select_policy(sbi, gc_type, type, &p);

p.min_segno = NULL_SEGNO;
p.min_cost = get_max_cost(sbi, &p);
p.min_cost = max_cost = get_max_cost(sbi, &p);

mutex_lock(&dirty_i->seglist_lock);

Expand Down Expand Up @@ -287,16 +287,16 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi,
p.min_cost = cost;
}

if (cost == get_max_cost(sbi, &p))
if (cost == max_cost)
continue;

if (nsearched++ >= MAX_VICTIM_SEARCH) {
sbi->last_victim[p.gc_mode] = segno;
break;
}
}
got_it:
if (p.min_segno != NULL_SEGNO) {
got_it:
if (p.alloc_mode == LFS) {
secno = GET_SECNO(sbi, p.min_segno);
if (gc_type == FG_GC)
Expand Down

0 comments on commit 16d736c

Please sign in to comment.