[SSI] openssi/kernel/fs inode.c,1.12,1.13

Roger Tsang <[email protected]> Tue, 25 Jan 2011 05:54:39 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/fs
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv23179/fs

Modified Files:
      Tag: OPENSSI-FC
	inode.c 
Log Message:
process_cnodes: traverse s_inodes list in super_block structure. avoid traversing other lists that contain inodes from other super blocks. reduce work. (#ifdef CONFIG_CFS)
shrink_icache_sb: remove function. not needed since during invalidate_inodes() if i_count is zero the inode cannot be LOCKed. (#ifdef SHRINK_ICACHE_SB)


Index: inode.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/fs/inode.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- inode.c	27 Oct 2009 03:18:30 -0000	1.12
+++ inode.c	25 Jan 2011 05:54:37 -0000	1.13
@@ -306,12 +306,7 @@
 /*
  * Invalidate all inodes for a device.
  */
-#ifdef SHRINK_ICACHE_SB
-static int
-invalidate_list(struct list_head *head, struct list_head *dispose, int cfs_sb_down)
-#else
 static int invalidate_list(struct list_head *head, struct list_head *dispose)
-#endif
 {
 	struct list_head *next;
 	int busy = 0, count = 0;
@@ -333,10 +328,6 @@
 		if (tmp == head)
 			break;
 		inode = list_entry(tmp, struct inode, i_sb_list);
-#ifdef SHRINK_ICACHE_SB
-		if (cfs_sb_down && (inode->i_state & I_LOCK))
-			continue;
-#endif
 		invalidate_inode_buffers(inode);
 		if (!atomic_read(&inode->i_count)) {
 			hlist_del_init(&inode->i_hash);
@@ -376,11 +367,7 @@
 
 	down(&iprune_sem);
 	spin_lock(&inode_lock);
-#ifdef SHRINK_ICACHE_SB
-	busy = invalidate_list(&sb->s_inodes, &throw_away, FALSE);
-#else
 	busy = invalidate_list(&sb->s_inodes, &throw_away);
-#endif
 	spin_unlock(&inode_lock);
 
 	dispose_list(&throw_away);
@@ -418,48 +405,6 @@
 
 EXPORT_SYMBOL(__invalidate_device);
 
-#ifdef SHRINK_ICACHE_SB
-/**
- * shrink_icache_sb - toss unused inodes for a superblock
- * @sb: superblock
- *
- * Discard unused inodes for a given superblock being sure to bypass
- * inodes which are LOCKed.
- *
- * Variation of invalidate_inodes() for CFS. 
- */
-int shrink_icache_sb(struct super_block * sb)
-{
-	int busy;
-	LIST_HEAD(throw_away);
-
-	down(&iprune_sem);
-	spin_lock(&inode_lock);
-	busy = invalidate_list(&sb->s_inodes, &throw_away, TRUE);
-	spin_unlock(&inode_lock);
-
-#ifdef SSI_SKIP
-        {       
-                struct inode *inode;
-                struct list_head *tmp;
-
-                for (tmp = dispose.next; tmp != &dispose; tmp = tmp->next) {
-                        inode = list_entry(tmp, struct inode, i_list);
-
-			(void)filemap_write_and_wait(inode->i_mapping);
-                }
-        }
-#endif
-
-	dispose_list(&throw_away);
-	up(&iprune_sem);
-
-	return busy;
-}
-
-EXPORT_SYMBOL(shrink_icache_sb);
-#endif /* SHRINK_ICACHE_SB */
-
 static int can_unuse(struct inode *inode)
 {
 	if (inode->i_state)
@@ -1291,7 +1236,6 @@
 	void *arg)
 {
 	struct inode *inode;
-	struct list_head *act_head;
 	LIST_HEAD(tofree_head);
 	int idx;
 #ifdef CFS_CLIST_LLIST
@@ -1308,31 +1252,8 @@
 #ifndef CFS_CLIST_LLIST
 	lock_kernel();		/* This lock is for cfs code */
 #endif
-	spin_lock(&inode_lock);	/* This lock is for inodes code */
-
-	list_for_each(act_head, &inode_in_use) {
-		inode = list_entry(act_head, struct inode, i_list);
-		if (inode->i_sb == sb) {
-			cnode_list_add(inode, &tofree_head, idx);
-			__iget(inode);
-		}
-	}
-restart:
-	list_for_each(act_head, &inode_unused) {
-		inode = list_entry(act_head, struct inode, i_list);
-		if (inode->i_sb == sb) {
-			cnode_list_add(inode, &tofree_head, idx);
-			__iget(inode);
-			goto restart; /* __iget() moved it to inode_in_use */
-		}
-	}
-	list_for_each(act_head, &sb->s_dirty) {
-		inode = list_entry(act_head, struct inode, i_list);
-		cnode_list_add(inode, &tofree_head, idx);
-		__iget(inode);
-	}
-	list_for_each(act_head, &sb->s_io) {
-		inode = list_entry(act_head, struct inode, i_list);
+	spin_lock(&inode_lock);
+	list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
 		cnode_list_add(inode, &tofree_head, idx);
 		__iget(inode);
 	}


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d