aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/splice.c b/fs/splice.c
index efdbfece9932..8f1dfaecc8f0 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -399,17 +399,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
399 * If the page isn't uptodate, we may need to start io on it 399 * If the page isn't uptodate, we may need to start io on it
400 */ 400 */
401 if (!PageUptodate(page)) { 401 if (!PageUptodate(page)) {
402 /* 402 lock_page(page);
403 * If in nonblock mode then dont block on waiting
404 * for an in-flight io page
405 */
406 if (flags & SPLICE_F_NONBLOCK) {
407 if (!trylock_page(page)) {
408 error = -EAGAIN;
409 break;
410 }
411 } else
412 lock_page(page);
413 403
414 /* 404 /*
415 * Page was truncated, or invalidated by the 405 * Page was truncated, or invalidated by the
@@ -597,7 +587,6 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
597 struct page *pages[PIPE_DEF_BUFFERS]; 587 struct page *pages[PIPE_DEF_BUFFERS];
598 struct partial_page partial[PIPE_DEF_BUFFERS]; 588 struct partial_page partial[PIPE_DEF_BUFFERS];
599 struct iovec *vec, __vec[PIPE_DEF_BUFFERS]; 589 struct iovec *vec, __vec[PIPE_DEF_BUFFERS];
600 pgoff_t index;
601 ssize_t res; 590 ssize_t res;
602 size_t this_len; 591 size_t this_len;
603 int error; 592 int error;
@@ -621,7 +610,6 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
621 goto shrink_ret; 610 goto shrink_ret;
622 } 611 }
623 612
624 index = *ppos >> PAGE_CACHE_SHIFT;
625 offset = *ppos & ~PAGE_CACHE_MASK; 613 offset = *ppos & ~PAGE_CACHE_MASK;
626 nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 614 nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
627 615