@@ -123,7 +123,8 @@ static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping,
* Returns 1 if the page can be released, false otherwise.
*/
-static int v9fs_release_page(struct page *page, gfp_t gfp)
+static int v9fs_release_page(struct address_space *__mapping,
+ struct page *page, gfp_t gfp)
{
if (PagePrivate(page))
return 0;
@@ -40,7 +40,8 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry,
static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry,
unsigned int flags);
-static int afs_dir_releasepage(struct page *page, gfp_t gfp_flags);
+static int afs_dir_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t gfp_flags);
static void afs_dir_invalidatepage(struct address_space *__mapping,
struct page *page, unsigned int offset,
unsigned int length);
@@ -1971,7 +1972,8 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
* Release a directory page and clean up its private state if it's not busy
* - return true if the page can now be released, false if not
*/
-static int afs_dir_releasepage(struct page *page, gfp_t gfp_flags)
+static int afs_dir_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t gfp_flags)
{
struct afs_vnode *dvnode = AFS_FS_I(page->mapping->host);
@@ -22,7 +22,8 @@ static int afs_readpage(struct file *file, struct address_space *__mapping,
static void afs_invalidatepage(struct address_space *__mapping,
struct page *page, unsigned int offset,
unsigned int length);
-static int afs_releasepage(struct page *page, gfp_t gfp_flags);
+static int afs_releasepage(struct address_space *__mapping, struct page *page,
+ gfp_t gfp_flags);
static int afs_readpages(struct file *filp, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages);
@@ -645,7 +646,8 @@ static void afs_invalidatepage(struct address_space *__mapping,
* release a page and clean up its private state if it's not busy
* - return true if the page can now be released, false if not
*/
-static int afs_releasepage(struct page *page, gfp_t gfp_flags)
+static int afs_releasepage(struct address_space *__mapping, struct page *page,
+ gfp_t gfp_flags)
{
struct afs_vnode *vnode = AFS_FS_I(page->mapping->host);
unsigned long priv;
@@ -1935,7 +1935,8 @@ EXPORT_SYMBOL_GPL(blkdev_read_iter);
* Try to release a page associated with block device when the system
* is under memory pressure.
*/
-static int blkdev_releasepage(struct page *page, gfp_t wait)
+static int blkdev_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t wait)
{
struct super_block *super = BDEV_I(page->mapping->host)->bdev.bd_super;
@@ -957,7 +957,8 @@ static int btree_readpage(struct file *file, struct address_space *__mapping,
return extent_read_full_page(page, btree_get_extent, 0);
}
-static int btree_releasepage(struct page *page, gfp_t gfp_flags)
+static int btree_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t gfp_flags)
{
if (PageWriteback(page) || PageDirty(page))
return 0;
@@ -972,7 +973,7 @@ static void btree_invalidatepage(struct address_space *__mapping,
struct extent_io_tree *tree;
tree = &BTRFS_I(page->mapping->host)->io_tree;
extent_invalidatepage(tree, page, offset);
- btree_releasepage(page, GFP_NOFS);
+ btree_releasepage(MAPPING_NULL, page, GFP_NOFS);
if (PagePrivate(page)) {
btrfs_warn(BTRFS_I(page->mapping->host)->root->fs_info,
"page private not zero on page %llu",
@@ -8057,7 +8057,8 @@ static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags)
return ret;
}
-static int btrfs_releasepage(struct page *page, gfp_t gfp_flags)
+static int btrfs_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t gfp_flags)
{
if (PageWriteback(page) || PageDirty(page))
return 0;
@@ -8116,7 +8117,7 @@ static void btrfs_invalidatepage(struct address_space *__mapping,
tree = &BTRFS_I(inode)->io_tree;
if (offset) {
- btrfs_releasepage(page, GFP_NOFS);
+ btrfs_releasepage(MAPPING_NULL, page, GFP_NOFS);
return;
}
@@ -172,7 +172,8 @@ static void ceph_invalidatepage(struct address_space *__mapping,
ClearPagePrivate(page);
}
-static int ceph_releasepage(struct page *page, gfp_t g)
+static int ceph_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t g)
{
dout("%p releasepage %p idx %lu (%sdirty)\n", page->mapping->host,
page, page->index, PageDirty(page) ? "" : "not ");
@@ -4694,7 +4694,8 @@ static int cifs_write_begin(struct file *file, struct address_space *mapping,
return rc;
}
-static int cifs_release_page(struct page *page, gfp_t gfp)
+static int cifs_release_page(struct address_space *__mapping,
+ struct page *page, gfp_t gfp)
{
if (PagePrivate(page))
return 0;
@@ -281,7 +281,8 @@ static int erofs_fc_parse_param(struct fs_context *fc,
#ifdef CONFIG_EROFS_FS_ZIP
static const struct address_space_operations managed_cache_aops;
-static int erofs_managed_cache_releasepage(struct page *page, gfp_t gfp_mask)
+static int erofs_managed_cache_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t gfp_mask)
{
int ret = 1; /* 0 - busy */
struct address_space *const mapping = page->mapping;
@@ -308,7 +309,7 @@ static void erofs_managed_cache_invalidatepage(struct address_space *__mapping,
DBG_BUGON(stop > PAGE_SIZE || stop < length);
if (offset == 0 && stop == PAGE_SIZE)
- while (!erofs_managed_cache_releasepage(page, GFP_NOFS))
+ while (!erofs_managed_cache_releasepage(MAPPING_NULL, page, GFP_NOFS))
cond_resched();
}
@@ -3283,7 +3283,8 @@ static void ext4_journalled_invalidatepage(struct address_space *__mapping,
WARN_ON(__ext4_journalled_invalidatepage(page, offset, length) < 0);
}
-static int ext4_releasepage(struct page *page, gfp_t wait)
+static int ext4_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t wait)
{
journal_t *journal = EXT4_JOURNAL(page->mapping->host);
@@ -3720,7 +3720,8 @@ void f2fs_invalidate_page(struct address_space *__mapping, struct page *page,
f2fs_clear_page_private(page);
}
-int f2fs_release_page(struct page *page, gfp_t wait)
+int f2fs_release_page(struct address_space *__mapping, struct page *page,
+ gfp_t wait)
{
/* If this is dirty page, keep PagePrivate */
if (PageDirty(page))
@@ -3472,7 +3472,8 @@ int f2fs_write_single_data_page(struct page *page, int *submitted,
void f2fs_invalidate_page(struct address_space *__mapping, struct page *page,
unsigned int offset,
unsigned int length);
-int f2fs_release_page(struct page *page, gfp_t wait);
+int f2fs_release_page(struct address_space *__mapping, struct page *page,
+ gfp_t wait);
#ifdef CONFIG_MIGRATION
int f2fs_migrate_page(struct address_space *mapping, struct page *newpage,
struct page *page, enum migrate_mode mode);
@@ -723,7 +723,8 @@ static void gfs2_invalidatepage(struct address_space *__mapping,
* Returns: 1 if the page was put or else 0
*/
-int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
+int gfs2_releasepage(struct address_space *__mapping, struct page *page,
+ gfp_t gfp_mask)
{
struct address_space *mapping = page->mapping;
struct gfs2_sbd *sdp = gfs2_mapping2sbd(mapping);
@@ -12,7 +12,8 @@
#include <linux/mm.h>
#include "util.h"
-extern int gfs2_releasepage(struct page *page, gfp_t gfp_mask);
+extern int gfs2_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t gfp_mask);
extern int gfs2_internal_read(struct gfs2_inode *ip,
char *buf, loff_t *pos, unsigned size);
extern void gfs2_set_aops(struct inode *inode);
@@ -72,7 +72,8 @@ static sector_t hfs_bmap(struct address_space *mapping, sector_t block)
return generic_block_bmap(mapping, block, hfs_get_block);
}
-static int hfs_releasepage(struct page *page, gfp_t mask)
+static int hfs_releasepage(struct address_space *__mapping, struct page *page,
+ gfp_t mask)
{
struct inode *inode = page->mapping->host;
struct super_block *sb = inode->i_sb;
@@ -66,7 +66,8 @@ static sector_t hfsplus_bmap(struct address_space *mapping, sector_t block)
return generic_block_bmap(mapping, block, hfsplus_get_block);
}
-static int hfsplus_releasepage(struct page *page, gfp_t mask)
+static int hfsplus_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t mask)
{
struct inode *inode = page->mapping->host;
struct super_block *sb = inode->i_sb;
@@ -476,7 +476,8 @@ iomap_is_partially_uptodate(struct page *page, unsigned long from,
EXPORT_SYMBOL_GPL(iomap_is_partially_uptodate);
int
-iomap_releasepage(struct page *page, gfp_t gfp_mask)
+iomap_releasepage(struct address_space *__mapping, struct page *page,
+ gfp_t gfp_mask)
{
trace_iomap_releasepage(page->mapping->host, page_offset(page),
PAGE_SIZE);
@@ -528,7 +528,8 @@ static int metapage_readpage(struct file *fp, struct address_space *__mapping,
return -EIO;
}
-static int metapage_releasepage(struct page *page, gfp_t gfp_mask)
+static int metapage_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t gfp_mask)
{
struct metapage *mp;
int ret = 1;
@@ -565,7 +566,7 @@ static void metapage_invalidatepage(struct address_space *__mapping,
BUG_ON(PageWriteback(page));
- metapage_releasepage(page, 0);
+ metapage_releasepage(MAPPING_NULL, page, 0);
}
const struct address_space_operations jfs_metapage_aops = {
@@ -426,7 +426,8 @@ static void nfs_invalidate_page(struct address_space *__mapping,
* - Caller holds page lock
* - Return true (may release page) or false (may not)
*/
-static int nfs_release_page(struct page *page, gfp_t gfp)
+static int nfs_release_page(struct address_space *__mapping,
+ struct page *page, gfp_t gfp)
{
dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page);
@@ -501,7 +501,8 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
return status;
}
-static int ocfs2_releasepage(struct page *page, gfp_t wait)
+static int ocfs2_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t wait)
{
if (!page_has_buffers(page))
return 0;
@@ -520,7 +520,8 @@ static void orangefs_invalidatepage(struct address_space *__mapping,
orangefs_launder_page(page);
}
-static int orangefs_releasepage(struct page *page, gfp_t foo)
+static int orangefs_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t foo)
{
return !PagePrivate(page);
}
@@ -3230,7 +3230,8 @@ static int reiserfs_set_page_dirty(struct address_space *__mapping,
* even in -o notail mode, we can't be sure an old mount without -o notail
* didn't create files with tails.
*/
-static int reiserfs_releasepage(struct page *page, gfp_t unused_gfp_flags)
+static int reiserfs_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t unused_gfp_flags)
{
struct inode *inode = page->mapping->host;
struct reiserfs_journal *j = SB_JOURNAL(inode->i_sb);
@@ -1486,7 +1486,8 @@ static int ubifs_migrate_page(struct address_space *mapping,
}
#endif
-static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
+static int ubifs_releasepage(struct address_space *__mapping,
+ struct page *page, gfp_t unused_gfp_flags)
{
struct inode *inode = page->mapping->host;
struct ubifs_info *c = inode->i_sb->s_fs_info;
@@ -399,7 +399,7 @@ struct address_space_operations {
sector_t (*bmap)(struct address_space *, sector_t);
void (*invalidatepage) (struct address_space *, struct page *,
unsigned int, unsigned int);
- int (*releasepage) (struct page *, gfp_t);
+ int (*releasepage) (struct address_space *, struct page *, gfp_t);
void (*freepage)(struct page *);
ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter);
/*
@@ -159,7 +159,8 @@ void iomap_readahead(struct readahead_control *, const struct iomap_ops *ops);
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);
+int iomap_releasepage(struct address_space *__mapping, struct page *page,
+ gfp_t gfp_mask);
void iomap_invalidatepage(struct address_space *__mapping, struct page *page,
unsigned int offset,
unsigned int len);
@@ -3694,7 +3694,8 @@ int try_to_release_page(struct page *page, gfp_t gfp_mask)
return 0;
if (mapping && mapping->a_ops->releasepage)
- return mapping->a_ops->releasepage(page, gfp_mask);
+ return mapping->a_ops->releasepage(MAPPING_NULL, page,
+ gfp_mask);
return try_to_free_buffers(page);
}