@@ -872,7 +872,7 @@ static int ext2_writepage(struct address_space *mapping, struct page *page,
static int ext2_readpage(struct file *file, struct address_space *mapping,
struct page *page)
{
- return mpage_readpage(page, ext2_get_block);
+ return mpage_readpage(page->mapping, page, ext2_get_block);
}
static int
@@ -197,7 +197,7 @@ static int fat_writepages(struct address_space *mapping,
static int fat_readpage(struct file *file, struct address_space *mapping,
struct page *page)
{
- return mpage_readpage(page, fat_get_block);
+ return mpage_readpage(page->mapping, page, fat_get_block);
}
static int fat_readpages(struct file *file, struct address_space *mapping,
@@ -524,7 +524,7 @@ static int __gfs2_readpage(void *file, struct address_space *mapping,
error = stuffed_readpage(ip, page);
unlock_page(page);
} else {
- error = mpage_readpage(page, gfs2_block_map);
+ error = mpage_readpage(page->mapping, page, gfs2_block_map);
}
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
@@ -118,7 +118,7 @@ static int hpfs_get_block(struct inode *inode, sector_t iblock, struct buffer_he
static int hpfs_readpage(struct file *file, struct address_space *mapping,
struct page *page)
{
- return mpage_readpage(page, hpfs_get_block);
+ return mpage_readpage(page->mapping, page, hpfs_get_block);
}
static int hpfs_writepage(struct address_space *mapping, struct page *page,
@@ -1171,7 +1171,7 @@ struct buffer_head *isofs_bread(struct inode *inode, sector_t block)
static int isofs_readpage(struct file *file, struct address_space *mapping,
struct page *page)
{
- return mpage_readpage(page, isofs_get_block);
+ return mpage_readpage(page->mapping, page, isofs_get_block);
}
static int isofs_readpages(struct file *file, struct address_space *mapping,
@@ -297,7 +297,7 @@ static int jfs_writepages(struct address_space *mapping,
static int jfs_readpage(struct file *file, struct address_space *mapping,
struct page *page)
{
- return mpage_readpage(page, jfs_get_block);
+ return mpage_readpage(page->mapping, page, jfs_get_block);
}
static int jfs_readpages(struct file *file, struct address_space *mapping,
@@ -143,12 +143,13 @@ map_buffer_to_page(struct inode *inode, struct page *page,
* get_block() call.
*/
static struct bio *
-do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,
+do_mpage_readpage(struct bio *bio, struct address_space *mapping,
+ struct page *page, unsigned nr_pages,
sector_t *last_block_in_bio, struct buffer_head *map_bh,
unsigned long *first_logical_block, get_block_t get_block,
gfp_t gfp)
{
- struct inode *inode = page->mapping->host;
+ struct inode *inode = mapping->host;
const unsigned blkbits = inode->i_blkbits;
const unsigned blocks_per_page = PAGE_SIZE >> blkbits;
const unsigned blocksize = 1 << blkbits;
@@ -381,7 +382,7 @@ mpage_readpages(struct address_space *mapping, struct list_head *pages,
if (!add_to_page_cache_lru(page, mapping,
page->index,
gfp)) {
- bio = do_mpage_readpage(bio, page,
+ bio = do_mpage_readpage(bio, mapping, page,
nr_pages - page_idx,
&last_block_in_bio, &map_bh,
&first_logical_block,
@@ -399,17 +400,18 @@ EXPORT_SYMBOL(mpage_readpages);
/*
* This isn't called much at all
*/
-int mpage_readpage(struct page *page, get_block_t get_block)
+int mpage_readpage(struct address_space *mapping, struct page *page,
+ get_block_t get_block)
{
struct bio *bio = NULL;
sector_t last_block_in_bio = 0;
struct buffer_head map_bh;
unsigned long first_logical_block = 0;
- gfp_t gfp = mapping_gfp_constraint(page->mapping, GFP_KERNEL);
+ gfp_t gfp = mapping_gfp_constraint(mapping, GFP_KERNEL);
map_bh.b_state = 0;
map_bh.b_size = 0;
- bio = do_mpage_readpage(bio, page, 1, &last_block_in_bio,
+ bio = do_mpage_readpage(bio, mapping, page, 1, &last_block_in_bio,
&map_bh, &first_logical_block, get_block, gfp);
if (bio)
mpage_bio_submit(REQ_OP_READ, 0, bio);
@@ -152,7 +152,7 @@ int nilfs_get_block(struct inode *inode, sector_t blkoff,
static int nilfs_readpage(struct file *file, struct address_space *mapping,
struct page *page)
{
- return mpage_readpage(page, nilfs_get_block);
+ return mpage_readpage(page->mapping, page, nilfs_get_block);
}
/**
@@ -96,7 +96,7 @@ static int qnx6_check_blockptr(__fs32 ptr)
static int qnx6_readpage(struct file *file, struct address_space *mapping,
struct page *page)
{
- return mpage_readpage(page, qnx6_get_block);
+ return mpage_readpage(page->mapping, page, qnx6_get_block);
}
static int qnx6_readpages(struct file *file, struct address_space *mapping,
@@ -188,7 +188,7 @@ static int udf_writepages(struct address_space *mapping,
static int udf_readpage(struct file *file, struct address_space *mapping,
struct page *page)
{
- return mpage_readpage(page, udf_get_block);
+ return mpage_readpage(page->mapping, page, udf_get_block);
}
static int udf_readpages(struct file *file, struct address_space *mapping,
@@ -1415,7 +1415,7 @@ xfs_vm_readpage(
struct page *page)
{
trace_xfs_vm_readpage(page->mapping->host, 1);
- return mpage_readpage(page, xfs_get_blocks);
+ return mpage_readpage(page->mapping, page, xfs_get_blocks);
}
STATIC int
@@ -16,7 +16,8 @@ struct writeback_control;
int mpage_readpages(struct address_space *mapping, struct list_head *pages,
unsigned nr_pages, get_block_t get_block);
-int mpage_readpage(struct page *page, get_block_t get_block);
+int mpage_readpage(struct address_space *mapping, struct page *page,
+ get_block_t get_block);
int mpage_writepages(struct address_space *mapping,
struct writeback_control *wbc, get_block_t get_block);
int mpage_writepage(struct address_space *mapping, struct page *page,