|
@@ -139,7 +139,8 @@ map_buffer_to_page(struct page *page, struct buffer_head *bh, int page_block)
|
|
static struct bio *
|
|
static struct bio *
|
|
do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,
|
|
do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,
|
|
sector_t *last_block_in_bio, struct buffer_head *map_bh,
|
|
sector_t *last_block_in_bio, struct buffer_head *map_bh,
|
|
- unsigned long *first_logical_block, get_block_t get_block)
|
|
|
|
|
|
+ unsigned long *first_logical_block, get_block_t get_block,
|
|
|
|
+ gfp_t gfp)
|
|
{
|
|
{
|
|
struct inode *inode = page->mapping->host;
|
|
struct inode *inode = page->mapping->host;
|
|
const unsigned blkbits = inode->i_blkbits;
|
|
const unsigned blkbits = inode->i_blkbits;
|
|
@@ -277,8 +278,7 @@ alloc_new:
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9),
|
|
bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9),
|
|
- min_t(int, nr_pages, BIO_MAX_PAGES),
|
|
|
|
- GFP_KERNEL);
|
|
|
|
|
|
+ min_t(int, nr_pages, BIO_MAX_PAGES), gfp);
|
|
if (bio == NULL)
|
|
if (bio == NULL)
|
|
goto confused;
|
|
goto confused;
|
|
}
|
|
}
|
|
@@ -361,6 +361,7 @@ mpage_readpages(struct address_space *mapping, struct list_head *pages,
|
|
sector_t last_block_in_bio = 0;
|
|
sector_t last_block_in_bio = 0;
|
|
struct buffer_head map_bh;
|
|
struct buffer_head map_bh;
|
|
unsigned long first_logical_block = 0;
|
|
unsigned long first_logical_block = 0;
|
|
|
|
+ gfp_t gfp = GFP_KERNEL & mapping_gfp_mask(mapping);
|
|
|
|
|
|
map_bh.b_state = 0;
|
|
map_bh.b_state = 0;
|
|
map_bh.b_size = 0;
|
|
map_bh.b_size = 0;
|
|
@@ -370,12 +371,13 @@ mpage_readpages(struct address_space *mapping, struct list_head *pages,
|
|
prefetchw(&page->flags);
|
|
prefetchw(&page->flags);
|
|
list_del(&page->lru);
|
|
list_del(&page->lru);
|
|
if (!add_to_page_cache_lru(page, mapping,
|
|
if (!add_to_page_cache_lru(page, mapping,
|
|
- page->index, GFP_KERNEL)) {
|
|
|
|
|
|
+ page->index,
|
|
|
|
+ gfp)) {
|
|
bio = do_mpage_readpage(bio, page,
|
|
bio = do_mpage_readpage(bio, page,
|
|
nr_pages - page_idx,
|
|
nr_pages - page_idx,
|
|
&last_block_in_bio, &map_bh,
|
|
&last_block_in_bio, &map_bh,
|
|
&first_logical_block,
|
|
&first_logical_block,
|
|
- get_block);
|
|
|
|
|
|
+ get_block, gfp);
|
|
}
|
|
}
|
|
page_cache_release(page);
|
|
page_cache_release(page);
|
|
}
|
|
}
|
|
@@ -395,11 +397,12 @@ int mpage_readpage(struct page *page, get_block_t get_block)
|
|
sector_t last_block_in_bio = 0;
|
|
sector_t last_block_in_bio = 0;
|
|
struct buffer_head map_bh;
|
|
struct buffer_head map_bh;
|
|
unsigned long first_logical_block = 0;
|
|
unsigned long first_logical_block = 0;
|
|
|
|
+ gfp_t gfp = GFP_KERNEL & mapping_gfp_mask(page->mapping);
|
|
|
|
|
|
map_bh.b_state = 0;
|
|
map_bh.b_state = 0;
|
|
map_bh.b_size = 0;
|
|
map_bh.b_size = 0;
|
|
bio = do_mpage_readpage(bio, page, 1, &last_block_in_bio,
|
|
bio = do_mpage_readpage(bio, page, 1, &last_block_in_bio,
|
|
- &map_bh, &first_logical_block, get_block);
|
|
|
|
|
|
+ &map_bh, &first_logical_block, get_block, gfp);
|
|
if (bio)
|
|
if (bio)
|
|
mpage_bio_submit(READ, bio);
|
|
mpage_bio_submit(READ, bio);
|
|
return 0;
|
|
return 0;
|