aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/erase.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/erase.c')
-rw-r--r--fs/jffs2/erase.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index 96d9ad56e573..bdc6a7bec802 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -419,9 +419,6 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
419 if (jffs2_write_nand_cleanmarker(c, jeb)) 419 if (jffs2_write_nand_cleanmarker(c, jeb))
420 goto filebad; 420 goto filebad;
421 } 421 }
422
423 /* Everything else got zeroed before the erase */
424 jeb->free_size = c->sector_size;
425 } else { 422 } else {
426 423
427 struct kvec vecs[1]; 424 struct kvec vecs[1];
@@ -449,18 +446,19 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
449 446
450 goto filebad; 447 goto filebad;
451 } 448 }
452
453 /* Everything else got zeroed before the erase */
454 jeb->free_size = c->sector_size;
455 /* FIXME Special case for cleanmarker in empty block */
456 jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL);
457 } 449 }
450 /* Everything else got zeroed before the erase */
451 jeb->free_size = c->sector_size;
458 452
459 mutex_lock(&c->erase_free_sem); 453 mutex_lock(&c->erase_free_sem);
460 spin_lock(&c->erase_completion_lock); 454 spin_lock(&c->erase_completion_lock);
455
461 c->erasing_size -= c->sector_size; 456 c->erasing_size -= c->sector_size;
462 c->free_size += jeb->free_size; 457 c->free_size += c->sector_size;
463 c->used_size += jeb->used_size; 458
459 /* Account for cleanmarker now, if it's in-band */
460 if (c->cleanmarker_size && !jffs2_cleanmarker_oob(c))
461 jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL);
464 462
465 jffs2_dbg_acct_sanity_check_nolock(c,jeb); 463 jffs2_dbg_acct_sanity_check_nolock(c,jeb);
466 jffs2_dbg_acct_paranoia_check_nolock(c, jeb); 464 jffs2_dbg_acct_paranoia_check_nolock(c, jeb);