From 4d2ba57266db297f43d329961eb7d07b5ef263a4 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 7 Jun 2007 09:39:42 +0200 Subject: [PATCH] --- yaml --- r: 57517 b: refs/heads/master c: 620a324b744a7d66c3c45a83042f8e7fc9fc5a04 h: refs/heads/master i: 57515: 6a76d7c327bc308378f78eb92bf8fa5851a711c4 v: v3 --- [refs] | 2 +- trunk/fs/splice.c | 46 +++++++++++++++++++++++----------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/[refs] b/[refs] index e7172ce4f34e..cefd4aa427af 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 475ecade683566b19ebb84972de864039ac5fce3 +refs/heads/master: 620a324b744a7d66c3c45a83042f8e7fc9fc5a04 diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index 123fcdb2e4d9..cb211360273a 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -413,37 +413,37 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, break; } + } +fill_it: + /* + * i_size must be checked after PageUptodate. + */ + isize = i_size_read(mapping->host); + end_index = (isize - 1) >> PAGE_CACHE_SHIFT; + if (unlikely(!isize || index > end_index)) + break; + + /* + * if this is the last page, see if we need to shrink + * the length and stop + */ + if (end_index == index) { + unsigned int plen; /* - * i_size must be checked after ->readpage(). + * max good bytes in this page */ - isize = i_size_read(mapping->host); - end_index = (isize - 1) >> PAGE_CACHE_SHIFT; - if (unlikely(!isize || index > end_index)) + plen = ((isize - 1) & ~PAGE_CACHE_MASK) + 1; + if (plen <= loff) break; /* - * if this is the last page, see if we need to shrink - * the length and stop + * force quit after adding this page */ - if (end_index == index) { - unsigned int plen; - - /* - * max good bytes in this page - */ - plen = ((isize - 1) & ~PAGE_CACHE_MASK) + 1; - if (plen <= loff) - break; - - /* - * force quit after adding this page - */ - this_len = min(this_len, plen - loff); - len = this_len; - } + this_len = min(this_len, plen - loff); + len = this_len; } -fill_it: + partial[page_nr].offset = loff; partial[page_nr].len = this_len; len -= this_len;