Merge two similar page_cache_readahead_adaptive() calls into one. No behavior change. Signed-off-by: Fengguang Wu --- mm/filemap.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) --- linux-2.6.21-rc3-mm2.orig/mm/filemap.c +++ linux-2.6.21-rc3-mm2/mm/filemap.c @@ -934,17 +934,13 @@ void do_generic_mapping_read(struct addr find_page: page = find_get_page(mapping, index); if (prefer_adaptive_readahead()) { - if (unlikely(page == NULL)) { - ra.prev_page = prev_index; - page_cache_readahead_adaptive(mapping, - &ra, filp, NULL, - index, last_index - index); - page = find_get_page(mapping, index); - } else if (PageReadahead(page)) { + if (!page || PageReadahead(page)) { ra.prev_page = prev_index; page_cache_readahead_adaptive(mapping, &ra, filp, page, index, last_index - index); + if (!page) + page = find_get_page(mapping, index); } } if (unlikely(page == NULL)) { @@ -1394,13 +1390,11 @@ struct page *filemap_fault(struct vm_are retry_find: page = find_lock_page(mapping, fdata->pgoff); if (prefer_adaptive_readahead() && VM_SequentialReadHint(vma)) { - if (!page) { - page_cache_readahead_adaptive(mapping, ra, file, NULL, - fdata->pgoff, 1); - page = find_lock_page(mapping, fdata->pgoff); - } else if (PageReadahead(page)) { + if (!page || PageReadahead(page)) { page_cache_readahead_adaptive(mapping, ra, file, page, fdata->pgoff, 1); + if (!page) + page = find_lock_page(mapping, fdata->pgoff); } } if (!page) { -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/