mtd/fs/jffs2 nodelist.c,1.45,1.46

David Woodhouse dwmw2 at infradead.org
Tue Jun 25 21:23:12 EDT 2002


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

Modified Files:
	nodelist.c 
Log Message:
Remove the inocache_last optimisation. With a decent-sized inocache hash 
table in the first place, it's not giving us any real improvements.


Index: nodelist.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- nodelist.c	10 Jun 2002 12:48:44 -0000	1.45
+++ nodelist.c	26 Jun 2002 01:23:09 -0000	1.46
@@ -287,19 +287,16 @@
 	D2(printk(KERN_DEBUG "jffs2_get_ino_cache(): ino %u\n", ino));
 	spin_lock (&c->inocache_lock);
 
-	if (c->inocache_last && c->inocache_last->ino == ino) {
-		ret = c->inocache_last;
-	} else {
-		ret = c->inocache_list[ino % INOCACHE_HASHSIZE];
-		while (ret && ret->ino < ino) {
-			ret = ret->next;
-		}
-
-		if (ret && ret->ino != ino)
-			ret = NULL;
-		if (ret)
-			c->inocache_last = ret;
+	ret = c->inocache_list[ino % INOCACHE_HASHSIZE];
+	while (ret && ret->ino < ino) {
+		ret = ret->next;
 	}
+	
+	if (ret && ret->ino != ino)
+		ret = NULL;
+	if (ret)
+		c->inocache_last = ret;
+
 	spin_unlock(&c->inocache_lock);
 
 	D2(printk(KERN_DEBUG "jffs2_get_ino_cache found %p for ino %u\n", ret, ino));
@@ -320,8 +317,6 @@
 	new->next = *prev;
 	*prev = new;
 
-	c->inocache_last = new;
-
 	spin_unlock(&c->inocache_lock);
 }
 
@@ -339,8 +334,6 @@
 	if ((*prev) == old) {
 		*prev = old->next;
 	}
-	if (c->inocache_last == old)
-		c->inocache_last = NULL;
 
 	spin_unlock(&c->inocache_lock);
 }
@@ -360,7 +353,6 @@
 		}
 		c->inocache_list[i] = NULL;
 	}
-	c->inocache_last = NULL;
 }
 
 void jffs2_free_raw_node_refs(struct jffs2_sb_info *c)





More information about the linux-mtd-cvs mailing list