提交 eb645a24 编写于 作者: J Jens Axboe 提交者: Jens Axboe

[PATCH] splice: switch to using page_cache_readahead()

Avoids doing useless work, when the file is fully cached.
Signed-off-by: NJens Axboe <axboe@suse.de>
上级 2be4d502
......@@ -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
* chunk splice and the page is already there) for a single page.
*/
if (!loff || spd.nr_pages > 1)
do_page_cache_readahead(mapping, in, index, spd.nr_pages);
if (!loff || nr_pages > 1)
page_cache_readahead(mapping, &in->f_ra, in, index, nr_pages);
/*
* Now fill in the holes:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册