patch-2.4.0-test9 linux/fs/inode.c

Next file: linux/fs/lockd/clntlock.c
Previous file: linux/fs/filesystems.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test8/linux/fs/inode.c linux/fs/inode.c
@@ -71,7 +71,7 @@
 	int nr_inodes;
 	int nr_unused;
 	int dummy[5];
-} inodes_stat = {0, 0,};
+} inodes_stat;
 
 static kmem_cache_t * inode_cachep;
 
@@ -454,21 +454,25 @@
 	dispose_list(freeable);
 }
 
-int shrink_icache_memory(int priority, int gfp_mask)
+void shrink_icache_memory(int priority, int gfp_mask)
 {
 	int count = 0;
-		
+
+	/*
+	 * Nasty deadlock avoidance..
+	 *
+	 * We may hold various FS locks, and we don't
+	 * want to recurse into the FS that called us
+	 * in clear_inode() and friends..
+	 */
+	if (!(gfp_mask & __GFP_IO))
+		return;
+
 	if (priority)
 		count = inodes_stat.nr_unused / priority;
+
 	prune_icache(count);
-	/* FIXME: kmem_cache_shrink here should tell us
-	   the number of pages freed, and it should
-	   work in a __GFP_DMA/__GFP_HIGHMEM behaviour
-	   to free only the interesting pages in
-	   function of the needs of the current allocation. */
 	kmem_cache_shrink(inode_cachep);
-
-	return 0;
 }
 
 /*
@@ -509,9 +513,9 @@
  */
 static void clean_inode(struct inode *inode)
 {
-	static struct address_space_operations empty_aops = {};
-	static struct inode_operations empty_iops = {};
-	static struct file_operations empty_fops = {};
+	static struct address_space_operations empty_aops;
+	static struct inode_operations empty_iops;
+	static struct file_operations empty_fops;
 	memset(&inode->u, 0, sizeof(inode->u));
 	inode->i_sock = 0;
 	inode->i_op = &empty_iops;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)