Index: linux-2.4.20/mm/filemap.c =================================================================== --- linux-2.4.20.orig/mm/filemap.c 2004-12-17 17:51:44.000000000 -0500 +++ linux-2.4.20/mm/filemap.c 2004-12-17 17:56:54.000000000 -0500 @@ -1153,6 +1153,14 @@ */ struct page *grab_cache_page_nowait(struct address_space *mapping, unsigned long index) { + return grab_cache_page_nowait_gfp(mapping, index, mapping->gfp_mask); +} + + +struct page *grab_cache_page_nowait_gfp(struct address_space *mapping, + unsigned long index, + unsigned int gfp_mask) +{ struct page *page, **hash; hash = page_hash(mapping, index); @@ -1177,7 +1185,7 @@ } } - page = page_cache_alloc(mapping); + page = alloc_pages(gfp_mask, 0); if ( unlikely(!page) ) return NULL; /* Failed to allocate a page */ Index: linux-2.4.20/mm/page_alloc.c =================================================================== --- linux-2.4.20.orig/mm/page_alloc.c 2004-12-17 17:51:30.000000000 -0500 +++ linux-2.4.20/mm/page_alloc.c 2004-12-17 18:26:45.000000000 -0500 @@ -547,6 +547,8 @@ */ return NULL; } + } else if (!(gfp_mask & __GFP_HIGH)) { + return NULL; } } Index: linux-2.4.20/kernel/ksyms.c =================================================================== --- linux-2.4.20.orig/kernel/ksyms.c 2004-12-17 17:51:46.000000000 -0500 +++ linux-2.4.20/kernel/ksyms.c 2004-12-17 17:52:59.000000000 -0500 @@ -300,6 +300,7 @@ EXPORT_SYMBOL(__find_lock_page); EXPORT_SYMBOL(find_or_create_page); EXPORT_SYMBOL(grab_cache_page_nowait); +EXPORT_SYMBOL(grab_cache_page_nowait_gfp); EXPORT_SYMBOL(read_cache_page); EXPORT_SYMBOL(set_page_dirty); EXPORT_SYMBOL(vfs_readlink); Index: linux-2.4.20/include/linux/pagemap.h =================================================================== --- linux-2.4.20.orig/include/linux/pagemap.h 2004-05-27 14:25:05.000000000 -0400 +++ linux-2.4.20/include/linux/pagemap.h 2004-12-17 18:11:09.000000000 -0500 @@ -110,6 +110,7 @@ extern struct page * grab_cache_page_nowait (struct address_space *, unsigned long); +extern struct page * grab_cache_page_nowait_gfp (struct address_space *, unsigned long, unsigned int); typedef int filler_t(void *, struct page*);