diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-11 00:00:29 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-11 00:00:29 -0400 |
commit | e4d35be584be88a3db3fa5635a97c62a2ec5aafe (patch) | |
tree | fc22a7fb65697306edd71411959ccee6df60c64d /fs/splice.c | |
parent | 99d825822eade8d827a1817357cbf3f889a552d6 (diff) | |
parent | 38b78a5f18584db6fa7441e0f4531b283b0e6725 (diff) |
Merge branch 'ovl-fixes' into for-linus
Diffstat (limited to 'fs/splice.c')
-rw-r--r-- | fs/splice.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/splice.c b/fs/splice.c index a6b87b7e0745..dd9bf7e410d2 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -88,7 +88,7 @@ out_unlock: | |||
88 | static void page_cache_pipe_buf_release(struct pipe_inode_info *pipe, | 88 | static void page_cache_pipe_buf_release(struct pipe_inode_info *pipe, |
89 | struct pipe_buffer *buf) | 89 | struct pipe_buffer *buf) |
90 | { | 90 | { |
91 | page_cache_release(buf->page); | 91 | put_page(buf->page); |
92 | buf->flags &= ~PIPE_BUF_FLAG_LRU; | 92 | buf->flags &= ~PIPE_BUF_FLAG_LRU; |
93 | } | 93 | } |
94 | 94 | ||
@@ -268,7 +268,7 @@ EXPORT_SYMBOL_GPL(splice_to_pipe); | |||
268 | 268 | ||
269 | void spd_release_page(struct splice_pipe_desc *spd, unsigned int i) | 269 | void spd_release_page(struct splice_pipe_desc *spd, unsigned int i) |
270 | { | 270 | { |
271 | page_cache_release(spd->pages[i]); | 271 | put_page(spd->pages[i]); |
272 | } | 272 | } |
273 | 273 | ||
274 | /* | 274 | /* |
@@ -328,9 +328,9 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, | |||
328 | if (splice_grow_spd(pipe, &spd)) | 328 | if (splice_grow_spd(pipe, &spd)) |
329 | return -ENOMEM; | 329 | return -ENOMEM; |
330 | 330 | ||
331 | index = *ppos >> PAGE_CACHE_SHIFT; | 331 | index = *ppos >> PAGE_SHIFT; |
332 | loff = *ppos & ~PAGE_CACHE_MASK; | 332 | loff = *ppos & ~PAGE_MASK; |
333 | req_pages = (len + loff + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 333 | req_pages = (len + loff + PAGE_SIZE - 1) >> PAGE_SHIFT; |
334 | nr_pages = min(req_pages, spd.nr_pages_max); | 334 | nr_pages = min(req_pages, spd.nr_pages_max); |
335 | 335 | ||
336 | /* | 336 | /* |
@@ -365,7 +365,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, | |||
365 | error = add_to_page_cache_lru(page, mapping, index, | 365 | error = add_to_page_cache_lru(page, mapping, index, |
366 | mapping_gfp_constraint(mapping, GFP_KERNEL)); | 366 | mapping_gfp_constraint(mapping, GFP_KERNEL)); |
367 | if (unlikely(error)) { | 367 | if (unlikely(error)) { |
368 | page_cache_release(page); | 368 | put_page(page); |
369 | if (error == -EEXIST) | 369 | if (error == -EEXIST) |
370 | continue; | 370 | continue; |
371 | break; | 371 | break; |
@@ -385,7 +385,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, | |||
385 | * Now loop over the map and see if we need to start IO on any | 385 | * Now loop over the map and see if we need to start IO on any |
386 | * pages, fill in the partial map, etc. | 386 | * pages, fill in the partial map, etc. |
387 | */ | 387 | */ |
388 | index = *ppos >> PAGE_CACHE_SHIFT; | 388 | index = *ppos >> PAGE_SHIFT; |
389 | nr_pages = spd.nr_pages; | 389 | nr_pages = spd.nr_pages; |
390 | spd.nr_pages = 0; | 390 | spd.nr_pages = 0; |
391 | for (page_nr = 0; page_nr < nr_pages; page_nr++) { | 391 | for (page_nr = 0; page_nr < nr_pages; page_nr++) { |
@@ -397,7 +397,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, | |||
397 | /* | 397 | /* |
398 | * this_len is the max we'll use from this page | 398 | * this_len is the max we'll use from this page |
399 | */ | 399 | */ |
400 | this_len = min_t(unsigned long, len, PAGE_CACHE_SIZE - loff); | 400 | this_len = min_t(unsigned long, len, PAGE_SIZE - loff); |
401 | page = spd.pages[page_nr]; | 401 | page = spd.pages[page_nr]; |
402 | 402 | ||
403 | if (PageReadahead(page)) | 403 | if (PageReadahead(page)) |
@@ -426,7 +426,7 @@ retry_lookup: | |||
426 | error = -ENOMEM; | 426 | error = -ENOMEM; |
427 | break; | 427 | break; |
428 | } | 428 | } |
429 | page_cache_release(spd.pages[page_nr]); | 429 | put_page(spd.pages[page_nr]); |
430 | spd.pages[page_nr] = page; | 430 | spd.pages[page_nr] = page; |
431 | } | 431 | } |
432 | /* | 432 | /* |
@@ -456,7 +456,7 @@ fill_it: | |||
456 | * i_size must be checked after PageUptodate. | 456 | * i_size must be checked after PageUptodate. |
457 | */ | 457 | */ |
458 | isize = i_size_read(mapping->host); | 458 | isize = i_size_read(mapping->host); |
459 | end_index = (isize - 1) >> PAGE_CACHE_SHIFT; | 459 | end_index = (isize - 1) >> PAGE_SHIFT; |
460 | if (unlikely(!isize || index > end_index)) | 460 | if (unlikely(!isize || index > end_index)) |
461 | break; | 461 | break; |
462 | 462 | ||
@@ -470,7 +470,7 @@ fill_it: | |||
470 | /* | 470 | /* |
471 | * max good bytes in this page | 471 | * max good bytes in this page |
472 | */ | 472 | */ |
473 | plen = ((isize - 1) & ~PAGE_CACHE_MASK) + 1; | 473 | plen = ((isize - 1) & ~PAGE_MASK) + 1; |
474 | if (plen <= loff) | 474 | if (plen <= loff) |
475 | break; | 475 | break; |
476 | 476 | ||
@@ -494,8 +494,8 @@ fill_it: | |||
494 | * we got, 'nr_pages' is how many pages are in the map. | 494 | * we got, 'nr_pages' is how many pages are in the map. |
495 | */ | 495 | */ |
496 | while (page_nr < nr_pages) | 496 | while (page_nr < nr_pages) |
497 | page_cache_release(spd.pages[page_nr++]); | 497 | put_page(spd.pages[page_nr++]); |
498 | in->f_ra.prev_pos = (loff_t)index << PAGE_CACHE_SHIFT; | 498 | in->f_ra.prev_pos = (loff_t)index << PAGE_SHIFT; |
499 | 499 | ||
500 | if (spd.nr_pages) | 500 | if (spd.nr_pages) |
501 | error = splice_to_pipe(pipe, &spd); | 501 | error = splice_to_pipe(pipe, &spd); |
@@ -636,8 +636,8 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos, | |||
636 | goto shrink_ret; | 636 | goto shrink_ret; |
637 | } | 637 | } |
638 | 638 | ||
639 | offset = *ppos & ~PAGE_CACHE_MASK; | 639 | offset = *ppos & ~PAGE_MASK; |
640 | nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 640 | nr_pages = (len + offset + PAGE_SIZE - 1) >> PAGE_SHIFT; |
641 | 641 | ||
642 | for (i = 0; i < nr_pages && i < spd.nr_pages_max && len; i++) { | 642 | for (i = 0; i < nr_pages && i < spd.nr_pages_max && len; i++) { |
643 | struct page *page; | 643 | struct page *page; |
@@ -647,7 +647,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos, | |||
647 | if (!page) | 647 | if (!page) |
648 | goto err; | 648 | goto err; |
649 | 649 | ||
650 | this_len = min_t(size_t, len, PAGE_CACHE_SIZE - offset); | 650 | this_len = min_t(size_t, len, PAGE_SIZE - offset); |
651 | vec[i].iov_base = (void __user *) page_address(page); | 651 | vec[i].iov_base = (void __user *) page_address(page); |
652 | vec[i].iov_len = this_len; | 652 | vec[i].iov_len = this_len; |
653 | spd.pages[i] = page; | 653 | spd.pages[i] = page; |