Index: linux-2.6.16-rc2/mm/filemap.c =================================================================== --- linux-2.6.16-rc2.orig/mm/filemap.c 2006-02-02 22:03:08.000000000 -0800 +++ linux-2.6.16-rc2/mm/filemap.c 2006-02-11 22:50:44.000000000 -0800 @@ -1169,15 +1169,17 @@ asmlinkage ssize_t sys_readahead(int fd, * This adds the requested page to the page cache if it isn't already there, * and schedules an I/O to read in its contents from disk. */ -static int FASTCALL(page_cache_read(struct file * file, unsigned long offset)); -static int fastcall page_cache_read(struct file * file, unsigned long offset) +static int FASTCALL(page_cache_read(struct vm_area_struct *vma, unsigned long offset)); +static int fastcall page_cache_read(struct vm_area_struct *vma, unsigned long offset) { + struct file *file = vma->vm_file; struct address_space *mapping = file->f_mapping; - struct page *page; + struct page *page; int ret; do { - page = page_cache_alloc_cold(mapping); + page = alloc_page_vma(mapping_gfp_mask(mapping)|__GFP_COLD, vma, offset); + if (!page) return -ENOMEM; @@ -1311,7 +1313,7 @@ no_cached_page: * We're only likely to ever get here if MADV_RANDOM is in * effect. */ - error = page_cache_read(file, pgoff); + error = page_cache_read(area, pgoff); grab_swap_token(); /* @@ -1402,9 +1404,10 @@ page_not_uptodate: EXPORT_SYMBOL(filemap_nopage); -static struct page * filemap_getpage(struct file *file, unsigned long pgoff, +static struct page * filemap_getpage(struct vm_area_struct *vma, unsigned long pgoff, int nonblock) { + struct file *file = vma->vm_file; struct address_space *mapping = file->f_mapping; struct page *page; int error; @@ -1440,7 +1443,7 @@ success: return page; no_cached_page: - error = page_cache_read(file, pgoff); + error = page_cache_read(vma, pgoff); /* * The page we want has now been added to the page cache. @@ -1543,7 +1546,7 @@ repeat: if (pgoff + (len >> PAGE_CACHE_SHIFT) > size) return -EINVAL; - page = filemap_getpage(file, pgoff, nonblock); + page = filemap_getpage(vma, pgoff, nonblock); /* XXX: This is wrong, a filesystem I/O error may have happened. Fix that as * done in shmem_populate calling shmem_getpage */