patch-2.4.20 linux-2.4.20/fs/file_table.c

Next file: linux-2.4.20/fs/inflate_fs/Makefile
Previous file: linux-2.4.20/fs/fcntl.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/fs/file_table.c linux-2.4.20/fs/file_table.c
@@ -186,3 +186,17 @@
 	file_list_unlock();
 	return 0;
 }
+
+void __init files_init(unsigned long mempages)
+{ 
+	int n; 
+	/* One file with associated inode and dcache is very roughly 1K. 
+	 * Per default don't use more than 10% of our memory for files. 
+	 */ 
+
+	n = (mempages * (PAGE_SIZE / 1024)) / 10;
+	files_stat.max_files = n; 
+	if (files_stat.max_files < NR_FILE)
+		files_stat.max_files = NR_FILE;
+} 
+

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