diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/mpage.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/mpage.c b/fs/mpage.c index b1c3e5890508..d54f8f897224 100644 --- a/fs/mpage.c +++ b/fs/mpage.c | |||
@@ -379,31 +379,25 @@ mpage_readpages(struct address_space *mapping, struct list_head *pages, | |||
379 | struct bio *bio = NULL; | 379 | struct bio *bio = NULL; |
380 | unsigned page_idx; | 380 | unsigned page_idx; |
381 | sector_t last_block_in_bio = 0; | 381 | sector_t last_block_in_bio = 0; |
382 | struct pagevec lru_pvec; | ||
383 | struct buffer_head map_bh; | 382 | struct buffer_head map_bh; |
384 | unsigned long first_logical_block = 0; | 383 | unsigned long first_logical_block = 0; |
385 | 384 | ||
386 | clear_buffer_mapped(&map_bh); | 385 | clear_buffer_mapped(&map_bh); |
387 | pagevec_init(&lru_pvec, 0); | ||
388 | for (page_idx = 0; page_idx < nr_pages; page_idx++) { | 386 | for (page_idx = 0; page_idx < nr_pages; page_idx++) { |
389 | struct page *page = list_entry(pages->prev, struct page, lru); | 387 | struct page *page = list_entry(pages->prev, struct page, lru); |
390 | 388 | ||
391 | prefetchw(&page->flags); | 389 | prefetchw(&page->flags); |
392 | list_del(&page->lru); | 390 | list_del(&page->lru); |
393 | if (!add_to_page_cache(page, mapping, | 391 | if (!add_to_page_cache_lru(page, mapping, |
394 | page->index, GFP_KERNEL)) { | 392 | page->index, GFP_KERNEL)) { |
395 | bio = do_mpage_readpage(bio, page, | 393 | bio = do_mpage_readpage(bio, page, |
396 | nr_pages - page_idx, | 394 | nr_pages - page_idx, |
397 | &last_block_in_bio, &map_bh, | 395 | &last_block_in_bio, &map_bh, |
398 | &first_logical_block, | 396 | &first_logical_block, |
399 | get_block); | 397 | get_block); |
400 | if (!pagevec_add(&lru_pvec, page)) | ||
401 | __pagevec_lru_add(&lru_pvec); | ||
402 | } else { | ||
403 | page_cache_release(page); | ||
404 | } | 398 | } |
399 | page_cache_release(page); | ||
405 | } | 400 | } |
406 | pagevec_lru_add(&lru_pvec); | ||
407 | BUG_ON(!list_empty(pages)); | 401 | BUG_ON(!list_empty(pages)); |
408 | if (bio) | 402 | if (bio) |
409 | mpage_bio_submit(READ, bio); | 403 | mpage_bio_submit(READ, bio); |