mtd/fs/jffs2 scan.c,1.76,1.77

David Woodhouse dwmw2 at infradead.org
Tue Jul 2 09:59:29 EDT 2002


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

Modified Files:
	scan.c 
Log Message:
Don't rescan tmpnode list from the start when calling jffs2_add_tn_to_list()
in jffs2_scan_inode_node() -- we can pick up from where we left off scanning
the list ourselves. Thanks to Jockim Tjernlund for noticing.


Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- scan.c	20 May 2002 14:56:38 -0000	1.76
+++ scan.c	2 Jul 2002 13:59:27 -0000	1.77
@@ -628,7 +628,7 @@
 		if (!jeb->used_size) {
 			D1(printk(KERN_DEBUG "No valid nodes yet found in this eraseblock 0x%08x, so obsoleting the new instance at 0x%08x\n", 
 				  jeb->offset, raw->flash_offset & ~3));
-			ri.nodetype &= ~JFFS2_NODE_ACCURATE;
+ 			ri.nodetype &= ~JFFS2_NODE_ACCURATE;
 			/* Perhaps we could also mark it as such on the medium. Maybe later */
 		}
 		break;
@@ -654,7 +654,11 @@
 		tn->version = ri.version;
 
 		USED_SPACE(PAD(ri.totlen));
-		jffs2_add_tn_to_list(tn, &ic->scan->tmpnodes);
+
+		/* No need to scan from the beginning of the list again. 
+		   We can start from tn_list instead (Thanks Jocke) */
+		jffs2_add_tn_to_list(tn, tn_list);
+
 		/* Make sure the one we just added is the _last_ in the list
 		   with this version number, so the older ones get obsoleted */
 		while (tn->next && tn->next->version == tn->version) {





More information about the linux-mtd-cvs mailing list