Skip to content

Commit

Permalink
[PATCH] splice: switch to using page_cache_readahead()
Browse files Browse the repository at this point in the history
Avoids doing useless work, when the file is fully cached.

Signed-off-by: Jens Axboe <axboe@suse.de>
  • Loading branch information
Jens Axboe authored and Jens Axboe committed Apr 27, 2006
1 parent 2be4d50 commit eb645a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit eb645a2

Please sign in to comment.