diff options
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index c99121ac5d6b..d2d03684fab2 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2,7 +2,6 @@ | |||
2 | #include <linux/slab.h> | 2 | #include <linux/slab.h> |
3 | #include <linux/bio.h> | 3 | #include <linux/bio.h> |
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <linux/gfp.h> | ||
6 | #include <linux/pagemap.h> | 5 | #include <linux/pagemap.h> |
7 | #include <linux/page-flags.h> | 6 | #include <linux/page-flags.h> |
8 | #include <linux/module.h> | 7 | #include <linux/module.h> |
@@ -2679,33 +2678,20 @@ int extent_readpages(struct extent_io_tree *tree, | |||
2679 | { | 2678 | { |
2680 | struct bio *bio = NULL; | 2679 | struct bio *bio = NULL; |
2681 | unsigned page_idx; | 2680 | unsigned page_idx; |
2682 | struct pagevec pvec; | ||
2683 | unsigned long bio_flags = 0; | 2681 | unsigned long bio_flags = 0; |
2684 | 2682 | ||
2685 | pagevec_init(&pvec, 0); | ||
2686 | for (page_idx = 0; page_idx < nr_pages; page_idx++) { | 2683 | for (page_idx = 0; page_idx < nr_pages; page_idx++) { |
2687 | struct page *page = list_entry(pages->prev, struct page, lru); | 2684 | struct page *page = list_entry(pages->prev, struct page, lru); |
2688 | 2685 | ||
2689 | prefetchw(&page->flags); | 2686 | prefetchw(&page->flags); |
2690 | list_del(&page->lru); | 2687 | list_del(&page->lru); |
2691 | /* | 2688 | 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)) { | 2689 | 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, | 2690 | __extent_read_full_page(tree, page, get_extent, |
2703 | &bio, 0, &bio_flags); | 2691 | &bio, 0, &bio_flags); |
2704 | } | 2692 | } |
2705 | page_cache_release(page); | 2693 | page_cache_release(page); |
2706 | } | 2694 | } |
2707 | if (pagevec_count(&pvec)) | ||
2708 | __pagevec_lru_add_file(&pvec); | ||
2709 | BUG_ON(!list_empty(pages)); | 2695 | BUG_ON(!list_empty(pages)); |
2710 | if (bio) | 2696 | if (bio) |
2711 | submit_one_bio(READ, bio, 0, bio_flags); | 2697 | submit_one_bio(READ, bio, 0, bio_flags); |