diff options
-rw-r--r-- | fs/jffs2/erase.c | 6 | ||||
-rw-r--r-- | fs/jffs2/gc.c | 2 | ||||
-rw-r--r-- | fs/jffs2/nodemgmt.c | 4 | ||||
-rw-r--r-- | fs/jffs2/scan.c | 4 | ||||
-rw-r--r-- | fs/jffs2/wbuf.c | 6 |
5 files changed, 12 insertions, 10 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index 563c857ca544..6286ad9b00f7 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c | |||
@@ -168,10 +168,10 @@ static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblo | |||
168 | mutex_lock(&c->erase_free_sem); | 168 | mutex_lock(&c->erase_free_sem); |
169 | spin_lock(&c->erase_completion_lock); | 169 | spin_lock(&c->erase_completion_lock); |
170 | list_move_tail(&jeb->list, &c->erase_complete_list); | 170 | list_move_tail(&jeb->list, &c->erase_complete_list); |
171 | /* Wake the GC thread to mark them clean */ | ||
172 | jffs2_garbage_collect_trigger(c); | ||
171 | spin_unlock(&c->erase_completion_lock); | 173 | spin_unlock(&c->erase_completion_lock); |
172 | mutex_unlock(&c->erase_free_sem); | 174 | mutex_unlock(&c->erase_free_sem); |
173 | /* Ensure that kupdated calls us again to mark them clean */ | ||
174 | jffs2_erase_pending_trigger(c); | ||
175 | wake_up(&c->erase_wait); | 175 | wake_up(&c->erase_wait); |
176 | } | 176 | } |
177 | 177 | ||
@@ -491,9 +491,9 @@ filebad: | |||
491 | 491 | ||
492 | refile: | 492 | refile: |
493 | /* Stick it back on the list from whence it came and come back later */ | 493 | /* Stick it back on the list from whence it came and come back later */ |
494 | jffs2_erase_pending_trigger(c); | ||
495 | mutex_lock(&c->erase_free_sem); | 494 | mutex_lock(&c->erase_free_sem); |
496 | spin_lock(&c->erase_completion_lock); | 495 | spin_lock(&c->erase_completion_lock); |
496 | jffs2_garbage_collect_trigger(c); | ||
497 | list_move(&jeb->list, &c->erase_complete_list); | 497 | list_move(&jeb->list, &c->erase_complete_list); |
498 | spin_unlock(&c->erase_completion_lock); | 498 | spin_unlock(&c->erase_completion_lock); |
499 | mutex_unlock(&c->erase_free_sem); | 499 | mutex_unlock(&c->erase_free_sem); |
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index 1ea4a843a430..f5e96bd656e8 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c | |||
@@ -448,7 +448,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) | |||
448 | list_add_tail(&c->gcblock->list, &c->erase_pending_list); | 448 | list_add_tail(&c->gcblock->list, &c->erase_pending_list); |
449 | c->gcblock = NULL; | 449 | c->gcblock = NULL; |
450 | c->nr_erasing_blocks++; | 450 | c->nr_erasing_blocks++; |
451 | jffs2_erase_pending_trigger(c); | 451 | jffs2_garbage_collect_trigger(c); |
452 | } | 452 | } |
453 | spin_unlock(&c->erase_completion_lock); | 453 | spin_unlock(&c->erase_completion_lock); |
454 | 454 | ||
diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c index dd2d920d3325..694aa5b03505 100644 --- a/fs/jffs2/nodemgmt.c +++ b/fs/jffs2/nodemgmt.c | |||
@@ -229,7 +229,7 @@ static int jffs2_find_nextblock(struct jffs2_sb_info *c) | |||
229 | ejeb = list_entry(c->erasable_list.next, struct jffs2_eraseblock, list); | 229 | ejeb = list_entry(c->erasable_list.next, struct jffs2_eraseblock, list); |
230 | list_move_tail(&ejeb->list, &c->erase_pending_list); | 230 | list_move_tail(&ejeb->list, &c->erase_pending_list); |
231 | c->nr_erasing_blocks++; | 231 | c->nr_erasing_blocks++; |
232 | jffs2_erase_pending_trigger(c); | 232 | jffs2_garbage_collect_trigger(c); |
233 | D1(printk(KERN_DEBUG "jffs2_find_nextblock: Triggering erase of erasable block at 0x%08x\n", | 233 | D1(printk(KERN_DEBUG "jffs2_find_nextblock: Triggering erase of erasable block at 0x%08x\n", |
234 | ejeb->offset)); | 234 | ejeb->offset)); |
235 | } | 235 | } |
@@ -625,7 +625,7 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref | |||
625 | D1(printk(KERN_DEBUG "...and adding to erase_pending_list\n")); | 625 | D1(printk(KERN_DEBUG "...and adding to erase_pending_list\n")); |
626 | list_add_tail(&jeb->list, &c->erase_pending_list); | 626 | list_add_tail(&jeb->list, &c->erase_pending_list); |
627 | c->nr_erasing_blocks++; | 627 | c->nr_erasing_blocks++; |
628 | jffs2_erase_pending_trigger(c); | 628 | jffs2_garbage_collect_trigger(c); |
629 | } else { | 629 | } else { |
630 | /* Sometimes, however, we leave it elsewhere so it doesn't get | 630 | /* Sometimes, however, we leave it elsewhere so it doesn't get |
631 | immediately reused, and we spread the load a bit. */ | 631 | immediately reused, and we spread the load a bit. */ |
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 696686cc206e..46f870d1cc36 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c | |||
@@ -260,7 +260,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) | |||
260 | ret = -EIO; | 260 | ret = -EIO; |
261 | goto out; | 261 | goto out; |
262 | } | 262 | } |
263 | jffs2_erase_pending_trigger(c); | 263 | spin_lock(&c->erase_completion_lock); |
264 | jffs2_garbage_collect_trigger(c); | ||
265 | spin_unlock(&c->erase_completion_lock); | ||
264 | } | 266 | } |
265 | ret = 0; | 267 | ret = 0; |
266 | out: | 268 | out: |
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index 5ef7bac265e5..be114beca13e 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c | |||
@@ -121,7 +121,7 @@ static inline void jffs2_refile_wbuf_blocks(struct jffs2_sb_info *c) | |||
121 | D1(printk(KERN_DEBUG "...and adding to erase_pending_list\n")); | 121 | D1(printk(KERN_DEBUG "...and adding to erase_pending_list\n")); |
122 | list_add_tail(&jeb->list, &c->erase_pending_list); | 122 | list_add_tail(&jeb->list, &c->erase_pending_list); |
123 | c->nr_erasing_blocks++; | 123 | c->nr_erasing_blocks++; |
124 | jffs2_erase_pending_trigger(c); | 124 | jffs2_garbage_collect_trigger(c); |
125 | } else { | 125 | } else { |
126 | /* Sometimes, however, we leave it elsewhere so it doesn't get | 126 | /* Sometimes, however, we leave it elsewhere so it doesn't get |
127 | immediately reused, and we spread the load a bit. */ | 127 | immediately reused, and we spread the load a bit. */ |
@@ -152,7 +152,7 @@ static void jffs2_block_refile(struct jffs2_sb_info *c, struct jffs2_eraseblock | |||
152 | D1(printk("Refiling block at %08x to erase_pending_list\n", jeb->offset)); | 152 | D1(printk("Refiling block at %08x to erase_pending_list\n", jeb->offset)); |
153 | list_add(&jeb->list, &c->erase_pending_list); | 153 | list_add(&jeb->list, &c->erase_pending_list); |
154 | c->nr_erasing_blocks++; | 154 | c->nr_erasing_blocks++; |
155 | jffs2_erase_pending_trigger(c); | 155 | jffs2_garbage_collect_trigger(c); |
156 | } | 156 | } |
157 | 157 | ||
158 | if (!jffs2_prealloc_raw_node_refs(c, jeb, 1)) { | 158 | if (!jffs2_prealloc_raw_node_refs(c, jeb, 1)) { |
@@ -543,7 +543,7 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c) | |||
543 | D1(printk(KERN_DEBUG "Failing block at %08x is now empty. Moving to erase_pending_list\n", jeb->offset)); | 543 | D1(printk(KERN_DEBUG "Failing block at %08x is now empty. Moving to erase_pending_list\n", jeb->offset)); |
544 | list_move(&jeb->list, &c->erase_pending_list); | 544 | list_move(&jeb->list, &c->erase_pending_list); |
545 | c->nr_erasing_blocks++; | 545 | c->nr_erasing_blocks++; |
546 | jffs2_erase_pending_trigger(c); | 546 | jffs2_garbage_collect_trigger(c); |
547 | } | 547 | } |
548 | 548 | ||
549 | jffs2_dbg_acct_sanity_check_nolock(c, jeb); | 549 | jffs2_dbg_acct_sanity_check_nolock(c, jeb); |