Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61574
b: refs/heads/master
c: 431a482
h: refs/heads/master
v: v3
  • Loading branch information
Fengguang Wu authored and Linus Torvalds committed Jul 19, 2007
1 parent 4fe3c38 commit 6a38449
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 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: c743d96b6d2ff55a94df7b5ac7c74987bb9c343b
refs/heads/master: 431a4820bfcdf7ff530e745230bafb06c9bf2d6d
11 changes: 6 additions & 5 deletions trunk/fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,23 +290,24 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
* Lookup the (hopefully) full range of pages we need.
*/
spd.nr_pages = find_get_pages_contig(mapping, index, nr_pages, pages);
index += spd.nr_pages;

/*
* If find_get_pages_contig() returned fewer pages than we needed,
* allocate the rest and fill in the holes.
* readahead/allocate the rest and fill in the holes.
*/
if (spd.nr_pages < nr_pages)
page_cache_readahead_ondemand(mapping, &in->f_ra, in,
NULL, index, nr_pages - spd.nr_pages);

error = 0;
index += spd.nr_pages;
while (spd.nr_pages < nr_pages) {
/*
* Page could be there, find_get_pages_contig() breaks on
* the first hole.
*/
page = find_get_page(mapping, index);
if (!page) {
page_cache_readahead_ondemand(mapping, &in->f_ra, in,
NULL, index, nr_pages - spd.nr_pages);

/*
* page didn't exist, allocate one.
*/
Expand Down

0 comments on commit 6a38449

Please sign in to comment.