aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-07-19 04:48:08 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:44 -0400
commitcf914a7d656e62b9dd3e0dffe4f62b953ae6048d (patch)
treebaf7e79de006ca80eac426d2d1be4c52f5f19624 /mm/filemap.c
parentfe3cba17c49471e99d3421e675fc8b3deaaf0b70 (diff)
readahead: split ondemand readahead interface into two functions
Split ondemand readahead interface into two functions. I think this makes it a little clearer for non-readahead experts (like Rusty). Internally they both call ondemand_readahead(), but the page argument is changed to an obvious boolean flag. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 5eb0a6b9d607..49a6fe375d01 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -894,15 +894,15 @@ void do_generic_mapping_read(struct address_space *mapping,
894find_page: 894find_page:
895 page = find_get_page(mapping, index); 895 page = find_get_page(mapping, index);
896 if (!page) { 896 if (!page) {
897 page_cache_readahead_ondemand(mapping, 897 page_cache_sync_readahead(mapping,
898 &ra, filp, page, 898 &ra, filp,
899 index, last_index - index); 899 index, last_index - index);
900 page = find_get_page(mapping, index); 900 page = find_get_page(mapping, index);
901 if (unlikely(page == NULL)) 901 if (unlikely(page == NULL))
902 goto no_cached_page; 902 goto no_cached_page;
903 } 903 }
904 if (PageReadahead(page)) { 904 if (PageReadahead(page)) {
905 page_cache_readahead_ondemand(mapping, 905 page_cache_async_readahead(mapping,
906 &ra, filp, page, 906 &ra, filp, page,
907 index, last_index - index); 907 index, last_index - index);
908 } 908 }
@@ -1348,14 +1348,14 @@ retry_find:
1348 */ 1348 */
1349 if (VM_SequentialReadHint(vma)) { 1349 if (VM_SequentialReadHint(vma)) {
1350 if (!page) { 1350 if (!page) {
1351 page_cache_readahead_ondemand(mapping, ra, file, page, 1351 page_cache_sync_readahead(mapping, ra, file,
1352 vmf->pgoff, 1); 1352 vmf->pgoff, 1);
1353 page = find_lock_page(mapping, vmf->pgoff); 1353 page = find_lock_page(mapping, vmf->pgoff);
1354 if (!page) 1354 if (!page)
1355 goto no_cached_page; 1355 goto no_cached_page;
1356 } 1356 }
1357 if (PageReadahead(page)) { 1357 if (PageReadahead(page)) {
1358 page_cache_readahead_ondemand(mapping, ra, file, page, 1358 page_cache_async_readahead(mapping, ra, file, page,
1359 vmf->pgoff, 1); 1359 vmf->pgoff, 1);
1360 } 1360 }
1361 } 1361 }