[PATCH] UBIFS: remove unnecessary code in ubifs_garbage_collect
wang.bo116 at zte.com.cn
wang.bo116 at zte.com.cn
Fri Aug 16 03:43:36 EDT 2013
Hi,
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 at zte.com.cn>
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index 76ca53c..38dc67d 100755
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -668,7 +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_before;
int space_after;
cond_resched();
More information about the linux-mtd
mailing list