mtd/fs/jffs2 scan.c,1.83,1.84

gleixner at infradead.org gleixner at infradead.org
Tue Sep 3 09:46:53 EDT 2002


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

Modified Files:
	scan.c 
Log Message:
take wasted space from mark_node_obsolete into account

Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- scan.c	26 Aug 2002 14:49:32 -0000	1.83
+++ scan.c	3 Sep 2002 13:46:50 -0000	1.84
@@ -446,6 +446,14 @@
 	D1(printk(KERN_DEBUG "Block at 0x%08x: free 0x%08x, dirty 0x%08x, used 0x%08x\n", jeb->offset, 
 		  jeb->free_size, jeb->dirty_size, jeb->used_size));
 
+	/* mark_node_obsolete can add to wasted !! */
+	if (jeb->wasted_size) {
+		jeb->dirty_size += jeb->wasted_size;
+		c->dirty_size += jeb->wasted_size;
+		c->wasted_size -= jeb->wasted_size;
+		jeb->wasted_size = 0;
+	}
+
 	if (jeb->used_size == PAD(sizeof(struct jffs2_unknown_node)) && 
 	    !jeb->first_node->next_in_ino && !jeb->dirty_size)
 		return BLK_STATE_CLEANMARKER;
@@ -453,7 +461,7 @@
 	else if (!ISDIRTY(c->sector_size - jeb->used_size)) {
 		c->dirty_size -= jeb->dirty_size;
 		c->wasted_size += jeb->dirty_size; 
-		jeb->wasted_size = jeb->dirty_size;
+		jeb->wasted_size += jeb->dirty_size;
 		jeb->dirty_size = 0;
 		return BLK_STATE_CLEAN;
 	} else if (jeb->used_size)





More information about the linux-mtd-cvs mailing list