Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26060
b: refs/heads/master
c: 82aa5d6
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe committed Apr 20, 2006
1 parent bc8364a commit d49b7e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0aa7f68afeeb92f6274b395177c20e617c8ed2d
refs/heads/master: 82aa5d6183667aa2a5f3c61e390934b0273d2ad7
13 changes: 12 additions & 1 deletion trunk/fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
error = 0;
bytes = 0;
for (i = 0; i < nr_pages; i++, index++) {
unsigned int this_len;

if (!len)
break;

/*
* this_len is the max we'll use from this page
*/
this_len = min(len, PAGE_CACHE_SIZE - loff);
find_page:
/*
* lookup the page for this index
Expand Down Expand Up @@ -366,11 +375,13 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
* force quit after adding this page
*/
nr_pages = i;
this_len = min(this_len, loff);
}
}
fill_it:
pages[i] = page;
bytes += PAGE_CACHE_SIZE - loff;
bytes += this_len;
len -= this_len;
loff = 0;
}

Expand Down

0 comments on commit d49b7e6

Please sign in to comment.