Skip to content

Commit

Permalink
UBIFS: remove unnecessary code in ubifs_garbage_collect
Browse files Browse the repository at this point in the history
In ubifs_garbage_collect,local variable "space_before" calculate twice. In
fact, at the beginning of the loop, there is no need to calculate this
variable. Calculate it before call "ubifs_garbage_collect_leb" is enough. This
patch just remove the unnecessary calculate code.

Signed-off-by: wang bo <wang.bo116@zte.com.cn>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
wang.bo116@zte.com.cn authored and Artem Bityutskiy committed Oct 22, 2013
1 parent c23e9b7 commit e71d1a5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/ubifs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,7 @@ int ubifs_garbage_collect(struct ubifs_info *c, int anyway)
ubifs_assert(!wbuf->used);

for (i = 0; ; i++) {
int space_before = c->leb_size - wbuf->offs - wbuf->used;
int space_after;
int space_before, space_after;

cond_resched();

Expand Down

0 comments on commit e71d1a5

Please sign in to comment.