aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-04-05 16:21:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-04-05 16:21:15 -0400
commit795d580baec0d5386b83a8b557df47c20810e86b (patch)
treed0387c37562e9e27a4f43cf7ae425319cbdad359 /fs/btrfs/extent_io.c
parent449cedf099b23a250e7d61982e35555ccb871182 (diff)
parent109f6aef5fc436f355ad027f4d97bd696df2049a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: Btrfs: add check for changed leaves in setup_leaf_for_split Btrfs: create snapshot references in same commit as snapshot Btrfs: fix small race with delalloc flushing waitqueue's Btrfs: use add_to_page_cache_lru, use __page_cache_alloc Btrfs: fix chunk allocate size calculation Btrfs: kill max_extent mount option Btrfs: fail to mount if we have problems reading the block groups Btrfs: check btrfs_get_extent return for IS_ERR() Btrfs: handle kmalloc() failure in inode lookup ioctl Btrfs: dereferencing freed memory Btrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk() Btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree() Btrfs: Remove unnecessary finish_wait() in wait_current_trans() Btrfs: add NULL check for do_walk_down() Btrfs: remove duplicate include in ioctl.c Fix trivial conflict in fs/btrfs/compression.c due to slab.h include cleanups.
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);