[PATCH] splice: switch to using page_cache_readahead()
authorJens Axboe <axboe@suse.de>
Thu, 27 Apr 2006 06:44:27 +0000 (08:44 +0200)
committerJens Axboe <axboe@nelson.home.kernel.dk>
Thu, 27 Apr 2006 06:59:48 +0000 (08:59 +0200)
Avoids doing useless work, when the file is fully cached.

Signed-off-by: Jens Axboe <axboe@suse.de>
fs/splice.c

index 447ebc0a37f342eea7075ee18abb2f4a7a40714e..dc205f6430901208599f3e88e2ae6321010f505c 100644 (file)
@@ -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: