aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:34:52 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:34:52 -0400
commit02a93208edec0d655c9f18613d830dc6afeda7d4 (patch)
tree3a48dbae348c02d4b108cb3fcc5f1600ad3dd53a /fs
parent18062a91d2ddc40e19fc674afeb7cad58cfa23ab (diff)
parent821de3a27bf33f11ec878562577c586cd5f83c64 (diff)
Merge branch 'for-2.6.22' of git://git.kernel.dk/data/git/linux-2.6-block
* 'for-2.6.22' of git://git.kernel.dk/data/git/linux-2.6-block: [PATCH] ll_rw_blk: fix missing bounce in blk_rq_map_kern() [PATCH] splice: always call into page_cache_readahead() [PATCH] splice(): fix interaction with readahead
Diffstat (limited to 'fs')
-rw-r--r--fs/splice.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 5428b0ff3b6f..12f28281d2b1 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -289,12 +289,10 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
289 nr_pages = PIPE_BUFFERS; 289 nr_pages = PIPE_BUFFERS;
290 290
291 /* 291 /*
292 * Initiate read-ahead on this page range. however, don't call into 292 * Don't try to 2nd guess the read-ahead logic, call into
293 * read-ahead if this is a non-zero offset (we are likely doing small 293 * page_cache_readahead() like the page cache reads would do.
294 * chunk splice and the page is already there) for a single page.
295 */ 294 */
296 if (!loff || nr_pages > 1) 295 page_cache_readahead(mapping, &in->f_ra, in, index, nr_pages);
297 page_cache_readahead(mapping, &in->f_ra, in, index, nr_pages);
298 296
299 /* 297 /*
300 * Now fill in the holes: 298 * Now fill in the holes:
@@ -378,10 +376,11 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
378 * If in nonblock mode then dont block on waiting 376 * If in nonblock mode then dont block on waiting
379 * for an in-flight io page 377 * for an in-flight io page
380 */ 378 */
381 if (flags & SPLICE_F_NONBLOCK) 379 if (flags & SPLICE_F_NONBLOCK) {
382 break; 380 if (TestSetPageLocked(page))
383 381 break;
384 lock_page(page); 382 } else
383 lock_page(page);
385 384
386 /* 385 /*
387 * page was truncated, stop here. if this isn't the 386 * page was truncated, stop here. if this isn't the