aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-04-10 03:05:04 -0400
committerJens Axboe <axboe@suse.de>2006-04-10 03:05:04 -0400
commit0b749ce3802428007a37870eb51ba3c0bdf90857 (patch)
tree8e3a2278fab3dae95310570ea54d0dfee1af9fe5 /fs/splice.c
parent49d0b21be21efc07526d637e0ae935019667e532 (diff)
[PATCH] splice: be smarter about calling do_page_cache_readahead()
We don't want to call into the read-ahead logic unless we are at the start of a page, _or_ we have multiple pages to read. Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 50c43a1e0923..9bfd6af0cf45 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -250,9 +250,12 @@ static int __generic_file_splice_read(struct file *in, struct inode *pipe,
250 nr_pages = PIPE_BUFFERS; 250 nr_pages = PIPE_BUFFERS;
251 251
252 /* 252 /*
253 * initiate read-ahead on this page range 253 * initiate read-ahead on this page range. however, don't call into
254 * read-ahead if this is a non-zero offset (we are likely doing small
255 * chunk splice and the page is already there) for a single page.
254 */ 256 */
255 do_page_cache_readahead(mapping, in, index, nr_pages); 257 if (!offset || nr_pages > 1)
258 do_page_cache_readahead(mapping, in, index, nr_pages);
256 259
257 /* 260 /*
258 * now fill in the holes 261 * now fill in the holes