UBIFS: remove unnecessary code in ubifs_garbage_collect
authorwang.bo116@zte.com.cn <wang.bo116@zte.com.cn>
Fri, 16 Aug 2013 07:43:36 +0000 (15:43 +0800)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 22 Oct 2013 12:34:27 +0000 (13:34 +0100)
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>
fs/ubifs/gc.c

index 76ca53cd3eeec52c53ab064221a6519d8c70c80c..9718da86ad01a804db1e3c7e2a2ca6923f6299a3 100644 (file)
@@ -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();
 
This page took 0.025156 seconds and 5 git commands to generate.