mtd/fs/jffs2 erase.c,1.44,1.45

David Woodhouse dwmw2 at infradead.org
Wed Oct 9 04:27:11 EDT 2002


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv11426

Modified Files:
	erase.c 
Log Message:
Clean up code after erase failure, add comment about it being almost identical
to the jffs2_erase_failed() code. Remove s_dirt setting in callback.


Index: erase.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/erase.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- erase.c	8 Oct 2002 17:02:17 -0000	1.44
+++ erase.c	9 Oct 2002 08:27:08 -0000	1.45
@@ -82,12 +82,18 @@
 	else
 		printk(KERN_WARNING "Erase at 0x%08x failed immediately: errno %d\n", jeb->offset, ret);
 
+	/* Note: This is almost identical to jffs2_erase_failed() except
+	   for the fact that we used spin_lock_bh() not spin_lock(). If
+	   we could use spin_lock_bh() from a BH, we could merge them.
+	   Or if we abandon the idea that MTD drivers may call the erase
+	   callback from a BH, I suppose :)
+	*/
 	spin_lock_bh(&c->erase_completion_lock);
+	c->erasing_size -= c->sector_size;
+	c->bad_size += c->sector_size;
 	list_del(&jeb->list);
 	list_add(&jeb->list, &c->bad_list);
 	c->nr_erasing_blocks--;
-	c->bad_size += c->sector_size;
-	c->erasing_size -= c->sector_size;
 	spin_unlock_bh(&c->erase_completion_lock);
 	wake_up(&c->erase_wait);
 }
@@ -173,8 +179,6 @@
 	} else {
 		jffs2_erase_succeeded(priv->c, priv->jeb);
 	}	
-	/* Make sure someone picks up the block off the erase_complete list */
-	OFNI_BS_2SFFJ(priv->c)->s_dirt = 1;
 	kfree(instr);
 }
 





More information about the linux-mtd-cvs mailing list