Commit eb645a24 authored by Jens Axboe's avatar Jens Axboe Committed by Jens Axboe

[PATCH] splice: switch to using page_cache_readahead()

Avoids doing useless work, when the file is fully cached.
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
parent 2be4d502
...@@ -299,8 +299,8 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, ...@@ -299,8 +299,8 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
* read-ahead if this is a non-zero offset (we are likely doing small * read-ahead if this is a non-zero offset (we are likely doing small
* chunk splice and the page is already there) for a single page. * chunk splice and the page is already there) for a single page.
*/ */
if (!loff || spd.nr_pages > 1) if (!loff || nr_pages > 1)
do_page_cache_readahead(mapping, in, index, spd.nr_pages); page_cache_readahead(mapping, &in->f_ra, in, index, nr_pages);
/* /*
* Now fill in the holes: * Now fill in the holes:
......
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