summaryrefslogtreecommitdiff
path: root/fs/jffs2/erase.c
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2010-05-19 19:32:52 +0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-05-19 19:32:52 +0400
commit9957abea31aed5783d6ca7175cce553045c0eb19 (patch)
tree7497a0b8c69426a5344cc2ddd6f211213886bf09 /fs/jffs2/erase.c
parentcd874237d97f24f601f16a140d20803b6a79202e (diff)
downloadlinux-9957abea31aed5783d6ca7175cce553045c0eb19.tar.xz
jffs2: Add 'work_done' return value from jffs2_erase_pending_blocks()
We're about to start calling this from the jffs2_garbage_collect_pass(), and we'll want to know whether it actually did anything or not. Signed-off-by: Joakim Tjernlund <joakim.tjernlund@transmode.se> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2/erase.c')
-rw-r--r--fs/jffs2/erase.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index b47679be118a..b2d2b6a6e03e 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -103,9 +103,10 @@ static void jffs2_erase_block(struct jffs2_sb_info *c,
jffs2_erase_failed(c, jeb, bad_offset);
}
-void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
+int jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
{
struct jffs2_eraseblock *jeb;
+ int work_done = 0;
mutex_lock(&c->erase_free_sem);
@@ -121,6 +122,7 @@ void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
mutex_unlock(&c->erase_free_sem);
jffs2_mark_erased_block(c, jeb);
+ work_done++;
if (!--count) {
D1(printk(KERN_DEBUG "Count reached. jffs2_erase_pending_blocks leaving\n"));
goto done;
@@ -157,6 +159,7 @@ void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
mutex_unlock(&c->erase_free_sem);
done:
D1(printk(KERN_DEBUG "jffs2_erase_pending_blocks completed\n"));
+ return work_done;
}
static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)