aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 0adceb525167..d2d03684fab2 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2678,33 +2678,20 @@ int extent_readpages(struct extent_io_tree *tree,
2678{ 2678{
2679 struct bio *bio = NULL; 2679 struct bio *bio = NULL;
2680 unsigned page_idx; 2680 unsigned page_idx;
2681 struct pagevec pvec;
2682 unsigned long bio_flags = 0; 2681 unsigned long bio_flags = 0;
2683 2682
2684 pagevec_init(&pvec, 0);
2685 for (page_idx = 0; page_idx < nr_pages; page_idx++) { 2683 for (page_idx = 0; page_idx < nr_pages; page_idx++) {
2686 struct page *page = list_entry(pages->prev, struct page, lru); 2684 struct page *page = list_entry(pages->prev, struct page, lru);
2687 2685
2688 prefetchw(&page->flags); 2686 prefetchw(&page->flags);
2689 list_del(&page->lru); 2687 list_del(&page->lru);
2690 /* 2688 if (!add_to_page_cache_lru(page, mapping,
2691 * what we want to do here is call add_to_page_cache_lru,
2692 * but that isn't exported, so we reproduce it here
2693 */
2694 if (!add_to_page_cache(page, mapping,
2695 page->index, GFP_KERNEL)) { 2689 page->index, GFP_KERNEL)) {
2696
2697 /* open coding of lru_cache_add, also not exported */
2698 page_cache_get(page);
2699 if (!pagevec_add(&pvec, page))
2700 __pagevec_lru_add_file(&pvec);
2701 __extent_read_full_page(tree, page, get_extent, 2690 __extent_read_full_page(tree, page, get_extent,
2702 &bio, 0, &bio_flags); 2691 &bio, 0, &bio_flags);
2703 } 2692 }
2704 page_cache_release(page); 2693 page_cache_release(page);
2705 } 2694 }
2706 if (pagevec_count(&pvec))
2707 __pagevec_lru_add_file(&pvec);
2708 BUG_ON(!list_empty(pages)); 2695 BUG_ON(!list_empty(pages));
2709 if (bio) 2696 if (bio)
2710 submit_one_bio(READ, bio, 0, bio_flags); 2697 submit_one_bio(READ, bio, 0, bio_flags);