From addd2eaad83b640c8d143e5e098aeafff658804c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 10 Apr 2006 09:05:04 +0200 Subject: [PATCH] --- yaml --- r: 25603 b: refs/heads/master c: 0b749ce3802428007a37870eb51ba3c0bdf90857 h: refs/heads/master i: 25601: 7bb8a08b852d8871462bcf5f734dc7357f0cb454 25599: e77db04c33e00d37243d60d2e82633e3bb5331ed v: v3 --- [refs] | 2 +- trunk/fs/splice.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index a7c89c53fc56..3d4d321ce15c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 49d0b21be21efc07526d637e0ae935019667e532 +refs/heads/master: 0b749ce3802428007a37870eb51ba3c0bdf90857 diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index 50c43a1e0923..9bfd6af0cf45 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -250,9 +250,12 @@ static int __generic_file_splice_read(struct file *in, struct inode *pipe, nr_pages = PIPE_BUFFERS; /* - * initiate read-ahead on this page range + * initiate read-ahead on this page range. however, don't call into + * 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. */ - do_page_cache_readahead(mapping, in, index, nr_pages); + if (!offset || nr_pages > 1) + do_page_cache_readahead(mapping, in, index, nr_pages); /* * now fill in the holes