@@ -691,7 +691,7 @@ static int write_exec(struct page_collect *pcol)
* previous segment and will start a new collection.
* Eventually caller must submit the last segment if present.
*/
-static int writepage_strip(struct page *page,
+static int writepage_strip(struct page *page, struct address_space *mapping,
struct writeback_control *wbc_unused, void *data)
{
struct page_collect *pcol = data;
@@ -2697,10 +2697,9 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
return err;
}
-static int __writepage(struct page *page, struct writeback_control *wbc,
- void *data)
+static int __writepage(struct page *page, struct address_space *mapping,
+ struct writeback_control *wbc, void *data)
{
- struct address_space *mapping = data;
int ret = ext4_writepage(mapping, page, wbc);
mapping_set_error(mapping, ret);
return ret;
@@ -2746,7 +2745,7 @@ static int ext4_writepages(struct address_space *mapping,
struct blk_plug plug;
blk_start_plug(&plug);
- ret = write_cache_pages(mapping, wbc, __writepage, mapping);
+ ret = write_cache_pages(mapping, wbc, __writepage, NULL);
blk_finish_plug(&plug);
goto out_writepages;
}
@@ -1794,6 +1794,7 @@ static bool fuse_writepage_in_flight(struct fuse_req *new_req,
}
static int fuse_writepages_fill(struct page *page,
+ struct address_space *mapping,
struct writeback_control *wbc, void *_data)
{
struct fuse_fill_wb_data *data = _data;
@@ -479,8 +479,8 @@ void clean_page_buffers(struct page *page)
clean_buffers(page, ~0U);
}
-static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
- void *data)
+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;
@@ -734,7 +734,7 @@ int mpage_writepage(struct page *page, get_block_t get_block,
.get_block = get_block,
.use_writepage = 0,
};
- int ret = __mpage_writepage(page, wbc, &mpd);
+ int ret = __mpage_writepage(page, page->mapping, wbc, &mpd);
if (mpd.bio) {
int op_flags = (wbc->sync_mode == WB_SYNC_ALL ?
REQ_SYNC : 0);
@@ -693,7 +693,9 @@ int nfs_writepage(struct address_space *mapping, struct page *page,
return ret;
}
-static int nfs_writepages_callback(struct page *page, struct writeback_control *wbc, void *data)
+static int nfs_writepages_callback(struct page *page,
+ struct address_space *mapping,
+ struct writeback_control *wbc, void *data)
{
int ret;
@@ -1060,6 +1060,7 @@ xfs_writepage_map(
STATIC int
xfs_do_writepage(
struct page *page,
+ struct address_space *mapping,
struct writeback_control *wbc,
void *data)
{
@@ -1179,7 +1180,7 @@ xfs_vm_writepage(
};
int ret;
- ret = xfs_do_writepage(page, wbc, &wpc);
+ ret = xfs_do_writepage(page, mapping, wbc, &wpc);
if (wpc.ioend)
ret = xfs_submit_ioend(wbc, wpc.ioend, ret);
return ret;
@@ -358,8 +358,8 @@ void wb_update_bandwidth(struct bdi_writeback *wb, unsigned long start_time);
void balance_dirty_pages_ratelimited(struct address_space *mapping);
bool wb_over_bg_thresh(struct bdi_writeback *wb);
-typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
- void *data);
+typedef int (*writepage_t)(struct page *page, struct address_space *mapping,
+ struct writeback_control *wbc, void *data);
int generic_writepages(struct address_space *mapping,
struct writeback_control *wbc);
@@ -2236,7 +2236,7 @@ int write_cache_pages(struct address_space *mapping,
goto continue_unlock;
trace_wbc_writepage(wbc, inode_to_bdi(mapping->host));
- ret = (*writepage)(page, wbc, data);
+ ret = (*writepage)(page, mapping, wbc, data);
if (unlikely(ret)) {
if (ret == AOP_WRITEPAGE_ACTIVATE) {
unlock_page(page);
@@ -2294,10 +2294,9 @@ EXPORT_SYMBOL(write_cache_pages);
* Function used by generic_writepages to call the real writepage
* function and set the mapping flags on error
*/
-static int __writepage(struct page *page, struct writeback_control *wbc,
- void *data)
+static int __writepage(struct page *page, struct address_space *mapping,
+ struct writeback_control *wbc, void *data)
{
- struct address_space *mapping = data;
int ret = mapping->a_ops->writepage(mapping, page, wbc);
mapping_set_error(mapping, ret);
return ret;
@@ -2322,7 +2321,7 @@ int generic_writepages(struct address_space *mapping,
return 0;
blk_start_plug(&plug);
- ret = write_cache_pages(mapping, wbc, __writepage, mapping);
+ ret = write_cache_pages(mapping, wbc, __writepage, NULL);
blk_finish_plug(&plug);
return ret;
}