@@ -327,7 +327,7 @@ void end_buffer_async_write(struct address_space *mapping, struct page *page,
set_buffer_uptodate(bh);
} else {
buffer_io_error(bh, ", lost async page write");
- mark_buffer_write_io_error(page->mapping, page, bh);
+ mark_buffer_write_io_error(mapping, page, bh);
clear_buffer_uptodate(bh);
SetPageError(page);
}
@@ -597,11 +597,10 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode);
*
* The caller must hold lock_page_memcg().
*/
-static void __set_page_dirty(struct page *page, struct address_space *_mapping,
+static void __set_page_dirty(struct page *page, struct address_space *mapping,
int warn)
{
unsigned long flags;
- struct address_space *mapping = page_mapping(page);
spin_lock_irqsave(&mapping->tree_lock, flags);
if (page_is_truncated(page, mapping)) { /* Race with truncate? */
@@ -1954,7 +1953,7 @@ int __block_write_begin_int(struct address_space *mapping, struct page *page,
{
unsigned from = pos & (PAGE_SIZE - 1);
unsigned to = from + len;
- struct inode *inode = page->mapping->host;
+ struct inode *inode = mapping->host;
unsigned block_start, block_end;
sector_t block;
int err = 0;
@@ -2456,7 +2455,7 @@ EXPORT_SYMBOL(cont_write_begin);
int block_commit_write(struct address_space *mapping, struct page *page,
unsigned from, unsigned to)
{
- struct inode *inode = page->mapping->host;
+ struct inode *inode = mapping->host;
__block_commit_write(inode,page,from,to);
return 0;
}
@@ -2705,7 +2704,7 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata)
{
- struct inode *inode = page->mapping->host;
+ struct inode *inode = mapping->host;
struct buffer_head *head = fsdata;
struct buffer_head *bh;
BUG_ON(fsdata != NULL && page_has_buffers(page));
@@ -475,7 +475,7 @@ int simple_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata)
{
- struct inode *inode = page->mapping->host;
+ struct inode *inode = mapping->host;
loff_t last_pos = pos + copied;
/* zero the stale part of the page if we did a short copy */
@@ -231,7 +231,7 @@ do_mpage_readpage(struct bio *bio, struct address_space *mapping,
* so readpage doesn't have to repeat the get_block call
*/
if (buffer_uptodate(map_bh)) {
- map_buffer_to_page(page->mapping->host, page,
+ map_buffer_to_page(mapping->host, page,
map_bh, page_block);
goto confused;
}
@@ -312,7 +312,7 @@ do_mpage_readpage(struct bio *bio, struct address_space *mapping,
if (bio)
bio = mpage_bio_submit(REQ_OP_READ, 0, bio);
if (!PageUptodate(page))
- block_read_full_page(page->mapping->host, page, get_block);
+ block_read_full_page(mapping->host, page, get_block);
else
unlock_page(page);
goto out;
@@ -484,13 +484,12 @@ void clean_page_buffers(struct address_space *mapping, struct page *page)
clean_buffers(mapping, page, ~0U);
}
-static int __mpage_writepage(struct page *page, struct address_space *_mapping,
+static int __mpage_writepage(struct page *page, struct address_space *mapping,
struct writeback_control *wbc, void *data)
{
struct mpage_data *mpd = data;
struct bio *bio = mpd->bio;
- struct address_space *mapping = page->mapping;
- struct inode *inode = page->mapping->host;
+ struct inode *inode = mapping->host;
const unsigned blkbits = inode->i_blkbits;
unsigned long end_index;
const unsigned blocks_per_page = PAGE_SIZE >> blkbits;