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.
This commit is contained in:
@@ -2678,33 +2678,20 @@ int extent_readpages(struct extent_io_tree *tree,
|
||||
{
|
||||
struct bio *bio = NULL;
|
||||
unsigned page_idx;
|
||||
struct pagevec pvec;
|
||||
unsigned long bio_flags = 0;
|
||||
|
||||
pagevec_init(&pvec, 0);
|
||||
for (page_idx = 0; page_idx < nr_pages; page_idx++) {
|
||||
struct page *page = list_entry(pages->prev, struct page, lru);
|
||||
|
||||
prefetchw(&page->flags);
|
||||
list_del(&page->lru);
|
||||
/*
|
||||
* what we want to do here is call add_to_page_cache_lru,
|
||||
* but that isn't exported, so we reproduce it here
|
||||
*/
|
||||
if (!add_to_page_cache(page, mapping,
|
||||
if (!add_to_page_cache_lru(page, mapping,
|
||||
page->index, GFP_KERNEL)) {
|
||||
|
||||
/* open coding of lru_cache_add, also not exported */
|
||||
page_cache_get(page);
|
||||
if (!pagevec_add(&pvec, page))
|
||||
__pagevec_lru_add_file(&pvec);
|
||||
__extent_read_full_page(tree, page, get_extent,
|
||||
&bio, 0, &bio_flags);
|
||||
}
|
||||
page_cache_release(page);
|
||||
}
|
||||
if (pagevec_count(&pvec))
|
||||
__pagevec_lru_add_file(&pvec);
|
||||
BUG_ON(!list_empty(pages));
|
||||
if (bio)
|
||||
submit_one_bio(READ, bio, 0, bio_flags);
|
||||
|
Reference in New Issue
Block a user