patch-2.1.100 linux/fs/dcache.c

Next file: linux/fs/dquot.c
Previous file: linux/fs/coda/upcall.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/fs/dcache.c linux/fs/dcache.c
@@ -430,12 +430,17 @@
  * more memory, but aren't really sure how much. So we
  * carefully try to free a _bit_ of our dcache, but not
  * too much.
+ *
+ * Priority:
+ *   0 - very urgent: schrink everything
+ *  ...
+ *   6 - base-level: try to shrink a bit.
  */
-void shrink_dcache_memory(void)
+void shrink_dcache_memory(int priority, unsigned int gfp_mask)
 {
 	int count = select_dcache(32, 8);
 	if (count)
-		prune_dcache(count);
+		prune_dcache((count << 6) >> priority);
 }
 
 #define NAME_ALLOC_LEN(len)	((len+16) & ~15)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov