Commit 087701ef authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] pagefault readaround fix

Mika Kukkonen <mika@osdl.org> says:

  CC      mm/filemap.o
mm/filemap.c: In function `filemap_nopage':
mm/filemap.c:1161: warning: comparison of unsigned expression < 0 is always false

The pagefault readaround code is currently doing purely readahead.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c0f0c166
......@@ -1155,12 +1155,11 @@ struct page * filemap_nopage(struct vm_area_struct * area, unsigned long address
did_readaround = 1;
ra_pages = max_sane_readahead(file->f_ra.ra_pages);
if (ra_pages) {
long start;
pgoff_t start = 0;
if (pgoff > ra_pages / 2)
start = pgoff - ra_pages / 2;
if (pgoff < 0)
pgoff = 0;
do_page_cache_readahead(mapping, file, pgoff, ra_pages);
do_page_cache_readahead(mapping, file, start, ra_pages);
}
page = find_get_page(mapping, pgoff);
if (!page)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment