Skip to content

Commit

Permalink
UBIFS: remove dead GC LEB recovery piece of code
Browse files Browse the repository at this point in the history
This patch removes a piece of code in 'ubifs_rcvry_gc_commit()' which is never
executed. We call 'ubifs_find_dirty_leb()' function with min_space =
wbuf->offs, so if it returns us an LEB, it is guaranteed to have at lease
'wbuf->offs' bytes of free+dirty space. So we can remove the subsequent code
which deals with "returned LEB has less than 'wbuf->offs' bytes of free+dirty
space". This simplifies 'ubifs_rcvry_gc_commit()' a little.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed May 13, 2011
1 parent 2405f59 commit bcdca3e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions fs/ubifs/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,20 +1127,9 @@ int ubifs_rcvry_gc_commit(struct ubifs_info *c)
}

ubifs_assert(!(lp.flags & LPROPS_INDEX));
ubifs_assert(lp.free + lp.dirty >= wbuf->offs);
lnum = lp.lnum;

/*
* There was no empty LEB so the used space in the dirtiest LEB must fit
* in the GC head LEB.
*/
if (lp.free + lp.dirty < wbuf->offs) {
dbg_rcvry("LEB %d doesn't fit in GC head LEB %d:%d",
lnum, wbuf->lnum, wbuf->offs);
err = ubifs_return_leb(c, lnum);
if (err)
return err;
goto find_free;
}
/*
* We run the commit before garbage collection otherwise subsequent
* mounts will see the GC and orphan deletion in a different order.
Expand Down

0 comments on commit bcdca3e

Please sign in to comment.