patch-2.3.7 linux/mm/mmap.c

Next file: linux/mm/page_alloc.c
Previous file: linux/mm/memory.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.6/linux/mm/mmap.c linux/mm/mmap.c
@@ -63,7 +63,7 @@
 	    return 1;
 
 	free = buffermem >> PAGE_SHIFT;
-	free += page_cache_size;
+	free += atomic_read(&page_cache_size);
 	free += nr_free_pages;
 	free += nr_swap_pages;
 	free -= (page_cache.min_percent + buffer_mem.min_percent + 2)*num_physpages/100; 
@@ -727,6 +727,10 @@
 	struct mm_struct * mm = current->mm;
 	struct vm_area_struct * vma;
 	unsigned long flags, retval;
+
+	len = PAGE_ALIGN(len);
+	if (!len)
+		return addr;
 
 	/*
 	 * mlock MCL_FUTURE?

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