patch-1.3.53 linux/kernel/sys.c

Next file: linux/mm/filemap.c
Previous file: linux/kernel/resource.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.52/linux/kernel/sys.c linux/kernel/sys.c
@@ -17,6 +17,7 @@
 #include <linux/stat.h>
 #include <linux/mman.h>
 #include <linux/mm.h>
+#include <linux/pagemap.h>
 
 #include <asm/segment.h>
 #include <asm/io.h>
@@ -452,6 +453,8 @@
 	 * fool it, but this should catch most mistakes.
 	 */
 	freepages = buffermem >> PAGE_SHIFT;
+	freepages += page_cache_size;
+	freepages >>= 1;
 	freepages += nr_free_pages;
 	freepages += nr_swap_pages;
 	freepages -= MAP_NR(high_memory) >> 4;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this