patch-2.2.7 linux/fs/dcache.c

Next file: linux/fs/devpts/root.c
Previous file: linux/fs/coda/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.6/linux/fs/dcache.c linux/fs/dcache.c
@@ -471,8 +471,12 @@
  */
 void shrink_dcache_memory(int priority, unsigned int gfp_mask)
 {
-	if (gfp_mask & __GFP_IO)
-		prune_dcache(0);
+	if (gfp_mask & __GFP_IO) {
+		int count = 0;
+		if (priority)
+			count = dentry_stat.nr_unused / priority;
+		prune_dcache(count);
+	}
 }
 
 #define NAME_ALLOC_LEN(len)	((len+16) & ~15)

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