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