@@ -151,7 +151,8 @@ static const struct vm_operations_struct fb_deferred_io_vm_ops = {
.page_mkwrite = fb_deferred_io_mkwrite,
};
-static int fb_deferred_io_set_page_dirty(struct page *page)
+static int fb_deferred_io_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
if (!PageDirty(page))
SetPageDirty(page);
@@ -44,7 +44,8 @@ static int afs_dir_releasepage(struct page *page, gfp_t gfp_flags);
static void afs_dir_invalidatepage(struct page *page, unsigned int offset,
unsigned int length);
-static int afs_dir_set_page_dirty(struct page *page)
+static int afs_dir_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
BUG(); /* This should never happen. */
}
@@ -1422,7 +1422,7 @@ extern int afs_check_volume_status(struct afs_volume *, struct afs_operation *);
/*
* write.c
*/
-extern int afs_set_page_dirty(struct page *);
+extern int afs_set_page_dirty(struct address_space *, struct page *);
extern int afs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata);
@@ -16,10 +16,10 @@
/*
* mark a page as having been made dirty and thus needing writeback
*/
-int afs_set_page_dirty(struct page *page)
+int afs_set_page_dirty(struct address_space *__mapping, struct page *page)
{
_enter("");
- return __set_page_dirty_nobuffers(page);
+ return __set_page_dirty_nobuffers(MAPPING_NULL, page);
}
/*
@@ -980,7 +980,8 @@ static void btree_invalidatepage(struct page *page, unsigned int offset,
}
}
-static int btree_set_page_dirty(struct page *page)
+static int btree_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
#ifdef DEBUG
struct extent_buffer *eb;
@@ -992,7 +993,7 @@ static int btree_set_page_dirty(struct page *page)
BUG_ON(!atomic_read(&eb->refs));
btrfs_assert_tree_locked(eb);
#endif
- return __set_page_dirty_nobuffers(page);
+ return __set_page_dirty_nobuffers(MAPPING_NULL, page);
}
static const struct address_space_operations btree_aops = {
@@ -1514,7 +1514,7 @@ void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
while (index <= end_index) {
page = find_get_page(inode->i_mapping, index);
BUG_ON(!page); /* Pages should be in the extent_io_tree */
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
account_page_redirty(page);
put_page(page);
index++;
@@ -735,7 +735,8 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
if (async_chunk->locked_page &&
(page_offset(async_chunk->locked_page) >= start &&
page_offset(async_chunk->locked_page)) <= end) {
- __set_page_dirty_nobuffers(async_chunk->locked_page);
+ __set_page_dirty_nobuffers(MAPPING_NULL,
+ async_chunk->locked_page);
/* unlocked later on in the async handlers */
}
@@ -9814,9 +9815,10 @@ int btrfs_prealloc_file_range_trans(struct inode *inode,
min_size, actual_len, alloc_hint, trans);
}
-static int btrfs_set_page_dirty(struct page *page)
+static int btrfs_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
- return __set_page_dirty_nobuffers(page);
+ return __set_page_dirty_nobuffers(MAPPING_NULL, page);
}
static int btrfs_permission(struct inode *inode, int mask)
@@ -638,7 +638,8 @@ EXPORT_SYMBOL_GPL(__set_page_dirty);
* FIXME: may need to call ->reservepage here as well. That's rather up to the
* address_space though.
*/
-int __set_page_dirty_buffers(struct page *page)
+int __set_page_dirty_buffers(struct address_space *__mapping,
+ struct page *page)
{
int newly_dirty;
struct address_space *mapping = page_mapping(page);
@@ -72,7 +72,8 @@ static inline struct ceph_snap_context *page_snap_context(struct page *page)
* Dirty a page. Optimistically adjust accounting, on the assumption
* that we won't race with invalidate. If we do, readjust.
*/
-static int ceph_set_page_dirty(struct page *page)
+static int ceph_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
struct address_space *mapping = page->mapping;
struct inode *inode;
@@ -127,7 +128,7 @@ static int ceph_set_page_dirty(struct page *page)
page->private = (unsigned long)snapc;
SetPagePrivate(page);
- ret = __set_page_dirty_nobuffers(page);
+ ret = __set_page_dirty_nobuffers(MAPPING_NULL, page);
WARN_ON(!PageLocked(page));
WARN_ON(!page->mapping);
@@ -2105,7 +2105,7 @@ cifs_writev_complete(struct work_struct *work)
for (i = 0; i < wdata->nr_pages; i++) {
struct page *page = wdata->pages[i];
if (wdata->result == -EAGAIN)
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
else if (wdata->result < 0)
SetPageError(page);
end_page_writeback(page);
@@ -3589,17 +3589,19 @@ const struct iomap_ops ext4_iomap_report_ops = {
* So what we do is to mark the page "pending dirty" and next time writepage
* is called, propagate that into the buffers appropriately.
*/
-static int ext4_journalled_set_page_dirty(struct page *page)
+static int ext4_journalled_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
SetPageChecked(page);
- return __set_page_dirty_nobuffers(page);
+ return __set_page_dirty_nobuffers(MAPPING_NULL, page);
}
-static int ext4_set_page_dirty(struct page *page)
+static int ext4_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
WARN_ON_ONCE(!PageLocked(page) && !PageDirty(page));
WARN_ON_ONCE(!page_has_buffers(page));
- return __set_page_dirty_buffers(page);
+ return __set_page_dirty_buffers(MAPPING_NULL, page);
}
static const struct address_space_operations ext4_aops = {
@@ -432,14 +432,15 @@ long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
return nwritten;
}
-static int f2fs_set_meta_page_dirty(struct page *page)
+static int f2fs_set_meta_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
trace_f2fs_set_page_dirty(page, META);
if (!PageUptodate(page))
SetPageUptodate(page);
if (!PageDirty(page)) {
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
inc_page_count(F2FS_P_SB(page), F2FS_DIRTY_META);
f2fs_set_page_private(page, 0);
f2fs_trace_pid(page);
@@ -3734,7 +3734,8 @@ int f2fs_release_page(struct page *page, gfp_t wait)
return 1;
}
-static int f2fs_set_data_page_dirty(struct page *page)
+static int f2fs_set_data_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
struct inode *inode = page_file_mapping(page)->host;
@@ -3743,7 +3744,7 @@ static int f2fs_set_data_page_dirty(struct page *page)
if (!PageUptodate(page))
SetPageUptodate(page);
if (PageSwapCache(page))
- return __set_page_dirty_nobuffers(page);
+ return __set_page_dirty_nobuffers(MAPPING_NULL, page);
if (f2fs_is_atomic_file(inode) && !f2fs_is_commit_atomic_write(inode)) {
if (!IS_ATOMIC_WRITTEN_PAGE(page)) {
@@ -3758,7 +3759,7 @@ static int f2fs_set_data_page_dirty(struct page *page)
}
if (!PageDirty(page)) {
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
f2fs_update_dirty_page(inode, page);
return 1;
}
@@ -2072,7 +2072,8 @@ static int f2fs_write_node_pages(struct address_space *mapping,
return 0;
}
-static int f2fs_set_node_page_dirty(struct page *page)
+static int f2fs_set_node_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
trace_f2fs_set_page_dirty(page, NODE);
@@ -2083,7 +2084,7 @@ static int f2fs_set_node_page_dirty(struct page *page)
f2fs_inode_chksum_set(F2FS_P_SB(page), page);
#endif
if (!PageDirty(page)) {
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
inc_page_count(F2FS_P_SB(page), F2FS_DIRTY_NODES);
f2fs_set_page_private(page, 0);
f2fs_trace_pid(page);
@@ -624,10 +624,11 @@ void adjust_fs_space(struct inode *inode)
* Returns: 1 if it dirtyed the page, or 0 otherwise
*/
-static int jdata_set_page_dirty(struct page *page)
+static int jdata_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
SetPageChecked(page);
- return __set_page_dirty_buffers(page);
+ return __set_page_dirty_buffers(MAPPING_NULL, page);
}
/**
@@ -947,7 +947,8 @@ static int hugetlbfs_symlink(struct inode *dir,
/*
* mark the head page dirty
*/
-static int hugetlbfs_set_page_dirty(struct page *page)
+static int hugetlbfs_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
struct page *head = compound_head(page);
@@ -661,7 +661,7 @@ iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, unsigned flags,
}
int
-iomap_set_page_dirty(struct page *page)
+iomap_set_page_dirty(struct address_space *__mapping, struct page *page)
{
struct address_space *mapping = page_mapping(page);
int newly_dirty;
@@ -705,7 +705,7 @@ __iomap_write_end(struct inode *inode, loff_t pos, unsigned len,
if (unlikely(copied < len && !PageUptodate(page)))
return 0;
iomap_set_range_uptodate(page, offset_in_page(pos), len);
- iomap_set_page_dirty(page);
+ iomap_set_page_dirty(MAPPING_NULL, page);
return copied;
}
@@ -1156,7 +1156,7 @@ int noop_fsync(struct file *file, loff_t start, loff_t end, int datasync)
}
EXPORT_SYMBOL(noop_fsync);
-int noop_set_page_dirty(struct page *page)
+int noop_set_page_dirty(struct address_space *__mapping, struct page *page)
{
/*
* Unlike __set_page_dirty_no_writeback that handles dirty page
@@ -1206,7 +1206,8 @@ EXPORT_SYMBOL(kfree_link);
* nop .set_page_dirty method so that people can use .page_mkwrite on
* anon inodes.
*/
-static int anon_set_page_dirty(struct page *page)
+static int anon_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
return 0;
};
@@ -808,7 +808,7 @@ static void
nfs_mark_request_dirty(struct nfs_page *req)
{
if (req->wb_page)
- __set_page_dirty_nobuffers(req->wb_page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, req->wb_page);
}
/*
@@ -1376,7 +1376,7 @@ int nfs_updatepage(struct file *file, struct page *page,
if (status < 0)
nfs_set_pageerror(mapping);
else
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
out:
dprintk("NFS: nfs_updatepage returns %d (isize %lld)\n",
status, (long long)i_size_read(inode));
@@ -1792,7 +1792,7 @@ static void
nfs_commit_resched_write(struct nfs_commit_info *cinfo,
struct nfs_page *req)
{
- __set_page_dirty_nobuffers(req->wb_page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, req->wb_page);
}
/*
@@ -201,10 +201,11 @@ static int nilfs_writepage(struct address_space *__mapping, struct page *page,
return 0;
}
-static int nilfs_set_page_dirty(struct page *page)
+static int nilfs_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
struct inode *inode = page->mapping->host;
- int ret = __set_page_dirty_nobuffers(page);
+ int ret = __set_page_dirty_nobuffers(MAPPING_NULL, page);
if (page_has_buffers(page)) {
unsigned int nr_dirty = 0;
@@ -270,7 +270,7 @@ int nilfs_copy_dirty_pages(struct address_space *dmap,
"found empty page in dat page cache");
nilfs_copy_page(dpage, page, 1);
- __set_page_dirty_nobuffers(dpage);
+ __set_page_dirty_nobuffers(MAPPING_NULL, dpage);
unlock_page(dpage);
put_page(dpage);
@@ -1732,10 +1732,10 @@ static void nilfs_end_page_io(struct page *page, int err)
if (!err) {
if (!nilfs_page_buffers_clean(page))
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
ClearPageError(page);
} else {
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
SetPageError(page);
}
@@ -1749,7 +1749,7 @@ void mark_ntfs_record_dirty(struct page *page, const unsigned int ofs) {
set_buffer_dirty(bh);
} while ((bh = bh->b_this_page) != head);
spin_unlock(&mapping->private_lock);
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
if (unlikely(buffers_to_free)) {
do {
bh = buffers_to_free->b_this_page;
@@ -1660,7 +1660,7 @@ static int ntfs_commit_pages_after_write(struct page **pages,
* Put the page on mapping->dirty_pages, but leave its
* buffers' dirty state as-is.
*/
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
err = 0;
} else
ntfs_error(vi->i_sb, "Page is not uptodate. Written "
@@ -3209,14 +3209,15 @@ static void reiserfs_invalidatepage(struct page *page, unsigned int offset,
return;
}
-static int reiserfs_set_page_dirty(struct page *page)
+static int reiserfs_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
struct inode *inode = page->mapping->host;
if (reiserfs_file_data_log(inode)) {
SetPageChecked(page);
- return __set_page_dirty_nobuffers(page);
+ return __set_page_dirty_nobuffers(MAPPING_NULL, page);
}
- return __set_page_dirty_buffers(page);
+ return __set_page_dirty_buffers(MAPPING_NULL, page);
}
/*
@@ -572,7 +572,7 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,
if (!PagePrivate(page)) {
SetPagePrivate(page);
atomic_long_inc(&c->dirty_pg_cnt);
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
}
if (appending) {
@@ -1446,13 +1446,14 @@ static ssize_t ubifs_write_iter(struct kiocb *iocb, struct iov_iter *from)
return generic_file_write_iter(iocb, from);
}
-static int ubifs_set_page_dirty(struct page *page)
+static int ubifs_set_page_dirty(struct address_space *__mapping,
+ struct page *page)
{
int ret;
struct inode *inode = page->mapping->host;
struct ubifs_info *c = inode->i_sb->s_fs_info;
- ret = __set_page_dirty_nobuffers(page);
+ ret = __set_page_dirty_nobuffers(MAPPING_NULL, page);
/*
* An attempt to dirty a page without budgeting for it - should not
* happen.
@@ -1570,7 +1571,7 @@ static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf)
ubifs_convert_page_budget(c);
SetPagePrivate(page);
atomic_long_inc(&c->dirty_pg_cnt);
- __set_page_dirty_nobuffers(page);
+ __set_page_dirty_nobuffers(MAPPING_NULL, page);
}
if (update_time) {
@@ -396,7 +396,8 @@ __bread(struct block_device *bdev, sector_t block, unsigned size)
return __bread_gfp(bdev, block, size, __GFP_MOVABLE);
}
-extern int __set_page_dirty_buffers(struct page *page);
+extern int __set_page_dirty_buffers(struct address_space *__mapping,
+ struct page *page);
#else /* CONFIG_BLOCK */
@@ -378,7 +378,7 @@ struct address_space_operations {
int (*writepages)(struct address_space *, struct writeback_control *);
/* Set a page dirty. Return true if this dirtied it */
- int (*set_page_dirty)(struct page *page);
+ int (*set_page_dirty)(struct address_space *, struct page *page);
/*
* Reads in the requested pages. Unlike ->readpage(), this is
@@ -3223,7 +3223,8 @@ extern int simple_rename(struct inode *, struct dentry *,
extern void simple_recursive_removal(struct dentry *,
void (*callback)(struct dentry *));
extern int noop_fsync(struct file *, loff_t, loff_t, int);
-extern int noop_set_page_dirty(struct page *page);
+extern int noop_set_page_dirty(struct address_space *__mapping,
+ struct page *page);
extern void noop_invalidatepage(struct page *page, unsigned int offset,
unsigned int length);
extern ssize_t noop_direct_IO(struct kiocb *iocb, struct iov_iter *iter);
@@ -156,7 +156,7 @@ ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from,
const struct iomap_ops *ops);
int iomap_readpage(struct page *page, const struct iomap_ops *ops);
void iomap_readahead(struct readahead_control *, const struct iomap_ops *ops);
-int iomap_set_page_dirty(struct page *page);
+int iomap_set_page_dirty(struct address_space *__mapping, struct page *page);
int iomap_is_partially_uptodate(struct page *page, unsigned long from,
unsigned long count);
int iomap_releasepage(struct page *page, gfp_t gfp_mask);
@@ -1796,8 +1796,10 @@ extern void do_invalidatepage(struct page *page, unsigned int offset,
unsigned int length);
void __set_page_dirty(struct page *, struct address_space *, int warn);
-int __set_page_dirty_nobuffers(struct page *page);
-int __set_page_dirty_no_writeback(struct page *page);
+int __set_page_dirty_nobuffers(struct address_space *__mapping,
+ struct page *page);
+int __set_page_dirty_no_writeback(struct address_space *__mapping,
+ struct page *page);
int redirty_page_for_writepage(struct writeback_control *wbc,
struct page *page);
void account_page_dirtied(struct page *page, struct address_space *mapping);
@@ -397,7 +397,8 @@ extern int swap_writepage(struct address_space *__mapping, struct page *page,
extern void end_swap_bio_write(struct bio *bio);
extern int __swap_writepage(struct page *page, struct writeback_control *wbc,
bio_end_io_t end_write_func);
-extern int swap_set_page_dirty(struct page *page);
+extern int swap_set_page_dirty(struct address_space *__mapping,
+ struct page *page);
int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
unsigned long nr_pages, sector_t start_block);
@@ -2403,7 +2403,8 @@ EXPORT_SYMBOL(write_one_page);
/*
* For address_spaces which do not use buffers nor write back.
*/
-int __set_page_dirty_no_writeback(struct page *page)
+int __set_page_dirty_no_writeback(struct address_space *__mapping,
+ struct page *page)
{
if (!PageDirty(page))
return !TestSetPageDirty(page);
@@ -2470,7 +2471,8 @@ void account_page_cleaned(struct page *page, struct address_space *mapping,
* hold the page lock, but e.g. zap_pte_range() calls with the page mapped and
* the pte lock held, which also locks out truncation.
*/
-int __set_page_dirty_nobuffers(struct page *page)
+int __set_page_dirty_nobuffers(struct address_space *__mapping,
+ struct page *page)
{
lock_page_memcg(page);
if (!TestSetPageDirty(page)) {
@@ -2537,7 +2539,7 @@ int redirty_page_for_writepage(struct writeback_control *wbc, struct page *page)
int ret;
wbc->pages_skipped++;
- ret = __set_page_dirty_nobuffers(page);
+ ret = __set_page_dirty_nobuffers(MAPPING_NULL, page);
account_page_redirty(page);
return ret;
}
@@ -2560,7 +2562,7 @@ int set_page_dirty(struct page *page)
page = compound_head(page);
if (likely(mapping)) {
- int (*spd)(struct page *) = mapping->a_ops->set_page_dirty;
+ int (*spd)(struct address_space *, struct page *) = mapping->a_ops->set_page_dirty;
/*
* readahead/lru_deactivate_page could remain
* PG_readahead/PG_reclaim due to race with end_page_writeback
@@ -2577,7 +2579,7 @@ int set_page_dirty(struct page *page)
if (!spd)
spd = __set_page_dirty_buffers;
#endif
- return (*spd)(page);
+ return (*spd)(MAPPING_NULL, page);
}
if (!PageDirty(page)) {
if (!TestSetPageDirty(page))
@@ -452,7 +452,7 @@ int swap_readpage(struct page *page, bool synchronous)
return ret;
}
-int swap_set_page_dirty(struct page *page)
+int swap_set_page_dirty(struct address_space *__mapping, struct page *page)
{
struct swap_info_struct *sis = page_swap_info(page);
@@ -460,8 +460,8 @@ int swap_set_page_dirty(struct page *page)
struct address_space *mapping = sis->swap_file->f_mapping;
VM_BUG_ON_PAGE(!PageSwapCache(page), page);
- return mapping->a_ops->set_page_dirty(page);
+ return mapping->a_ops->set_page_dirty(MAPPING_NULL, page);
} else {
- return __set_page_dirty_no_writeback(page);
+ return __set_page_dirty_no_writeback(MAPPING_NULL, page);
}
}