@@ -137,7 +137,8 @@ static int v9fs_release_page(struct page *page, gfp_t gfp)
* @offset: offset in the page
*/
-static void v9fs_invalidate_page(struct page *page, unsigned int offset,
+static void v9fs_invalidate_page(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
/*
@@ -41,7 +41,8 @@ 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 void afs_dir_invalidatepage(struct page *page, unsigned int offset,
+static void afs_dir_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length);
static int afs_dir_set_page_dirty(struct address_space *__mapping,
@@ -1990,7 +1991,8 @@ static int afs_dir_releasepage(struct page *page, gfp_t gfp_flags)
* - release a page and clean up its private data if offset is 0 (indicating
* the entire page)
*/
-static void afs_dir_invalidatepage(struct page *page, unsigned int offset,
+static void afs_dir_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
struct afs_vnode *dvnode = AFS_FS_I(page->mapping->host);
@@ -19,7 +19,8 @@
static int afs_file_mmap(struct file *file, struct vm_area_struct *vma);
static int afs_readpage(struct file *file, struct address_space *__mapping,
struct page *page);
-static void afs_invalidatepage(struct page *page, unsigned int offset,
+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);
@@ -607,7 +608,8 @@ static int afs_readpages(struct file *file, struct address_space *mapping,
* - release a page and clean up its private data if offset is 0 (indicating
* the entire page)
*/
-static void afs_invalidatepage(struct page *page, unsigned int offset,
+static void afs_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
struct afs_vnode *vnode = AFS_FS_I(page->mapping->host);
@@ -965,7 +965,8 @@ static int btree_releasepage(struct page *page, gfp_t gfp_flags)
return try_release_extent_buffer(page);
}
-static void btree_invalidatepage(struct page *page, unsigned int offset,
+static void btree_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
struct extent_io_tree *tree;
@@ -3632,7 +3632,8 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
pg_offset = offset_in_page(i_size);
if (page->index > end_index ||
(page->index == end_index && !pg_offset)) {
- page->mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE);
+ page->mapping->a_ops->invalidatepage(MAPPING_NULL, page, 0,
+ PAGE_SIZE);
unlock_page(page);
return 0;
}
@@ -8091,7 +8091,8 @@ static int btrfs_migratepage(struct address_space *mapping,
}
#endif
-static void btrfs_invalidatepage(struct page *page, unsigned int offset,
+static void btrfs_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
struct inode *inode = page->mapping->host;
@@ -1499,7 +1499,8 @@ static void discard_buffer(struct buffer_head * bh)
* point. Because the caller is about to free (and possibly reuse) those
* blocks on-disk.
*/
-void block_invalidatepage(struct page *page, unsigned int offset,
+void block_invalidatepage(struct address_space *__mapping, struct page *page,
+ unsigned int offset,
unsigned int length)
{
struct buffer_head *head, *bh, *next;
@@ -140,7 +140,8 @@ static int ceph_set_page_dirty(struct address_space *__mapping,
* dirty page counters appropriately. Only called if there is private
* data on the page.
*/
-static void ceph_invalidatepage(struct page *page, unsigned int offset,
+static void ceph_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
struct inode *inode;
@@ -708,7 +709,8 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
/* is this a partial page at end of file? */
if (page_off >= ceph_wbc.i_size) {
dout("%p page eof %llu\n", page, ceph_wbc.i_size);
- page->mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE);
+ page->mapping->a_ops->invalidatepage(MAPPING_NULL, page, 0,
+ PAGE_SIZE);
return 0;
}
@@ -1004,8 +1006,10 @@ static int ceph_writepages_start(struct address_space *mapping,
if ((ceph_wbc.size_stable ||
page_offset(page) >= i_size_read(inode)) &&
clear_page_dirty_for_io(page))
- mapping->a_ops->invalidatepage(page,
- 0, PAGE_SIZE);
+ mapping->a_ops->invalidatepage(MAPPING_NULL,
+ page,
+ 0,
+ PAGE_SIZE);
unlock_page(page);
continue;
}
@@ -4702,7 +4702,8 @@ static int cifs_release_page(struct page *page, gfp_t gfp)
return cifs_fscache_release_page(page, gfp);
}
-static void cifs_invalidate_page(struct page *page, unsigned int offset,
+static void cifs_invalidate_page(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
struct cifsInodeInfo *cifsi = CIFS_I(page->mapping->host);
@@ -295,7 +295,8 @@ static int erofs_managed_cache_releasepage(struct page *page, gfp_t gfp_mask)
return ret;
}
-static void erofs_managed_cache_invalidatepage(struct page *page,
+static void erofs_managed_cache_invalidatepage(struct address_space *__mapping,
+ struct page *page,
unsigned int offset,
unsigned int length)
{
@@ -135,7 +135,8 @@ static inline int ext4_begin_ordered_truncate(struct inode *inode,
new_size);
}
-static void ext4_invalidatepage(struct page *page, unsigned int offset,
+static void ext4_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length);
static int __ext4_journalled_writepage(struct page *page, unsigned int len);
static int ext4_bh_delay_or_unwritten(handle_t *handle, struct buffer_head *bh);
@@ -1572,7 +1573,8 @@ static void mpage_release_unused_pages(struct mpage_da_data *mpd,
if (invalidate) {
if (page_mapped(page))
clear_page_dirty_for_io(page);
- block_invalidatepage(page, 0, PAGE_SIZE);
+ block_invalidatepage(MAPPING_NULL, page, 0,
+ PAGE_SIZE);
ClearPageUptodate(page);
}
unlock_page(page);
@@ -1981,7 +1983,8 @@ static int ext4_writepage(struct address_space *__mapping, struct page *page,
bool keep_towrite = false;
if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) {
- inode->i_mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE);
+ inode->i_mapping->a_ops->invalidatepage(MAPPING_NULL, page, 0,
+ PAGE_SIZE);
unlock_page(page);
return -EIO;
}
@@ -3242,7 +3245,8 @@ static void ext4_readahead(struct readahead_control *rac)
ext4_mpage_readpages(inode, rac, NULL);
}
-static void ext4_invalidatepage(struct page *page, unsigned int offset,
+static void ext4_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
trace_ext4_invalidatepage(page, offset, length);
@@ -3250,7 +3254,7 @@ static void ext4_invalidatepage(struct page *page, unsigned int offset,
/* No journalling happens on data buffers when this function is used */
WARN_ON(page_has_buffers(page) && buffer_jbd(page_buffers(page)));
- block_invalidatepage(page, offset, length);
+ block_invalidatepage(MAPPING_NULL, page, offset, length);
}
static int __ext4_journalled_invalidatepage(struct page *page,
@@ -3271,7 +3275,8 @@ static int __ext4_journalled_invalidatepage(struct page *page,
}
/* Wrapper for aops... */
-static void ext4_journalled_invalidatepage(struct page *page,
+static void ext4_journalled_invalidatepage(struct address_space *__mapping,
+ struct page *page,
unsigned int offset,
unsigned int length)
{
@@ -3690,7 +3690,8 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
return err;
}
-void f2fs_invalidate_page(struct page *page, unsigned int offset,
+void f2fs_invalidate_page(struct address_space *__mapping, struct page *page,
+ unsigned int offset,
unsigned int length)
{
struct inode *inode = page->mapping->host;
@@ -3469,8 +3469,9 @@ int f2fs_write_single_data_page(struct page *page, int *submitted,
struct writeback_control *wbc,
enum iostat_type io_type,
int compr_blocks);
-void f2fs_invalidate_page(struct page *page, unsigned int offset,
- unsigned int length);
+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);
#ifdef CONFIG_MIGRATION
int f2fs_migrate_page(struct address_space *mapping, struct page *newpage,
@@ -103,7 +103,8 @@ static int gfs2_writepage(struct address_space *__mapping, struct page *page,
/* Is the page fully outside i_size? (truncate in progress) */
offset = i_size & (PAGE_SIZE-1);
if (page->index > end_index || (page->index == end_index && !offset)) {
- page->mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE);
+ page->mapping->a_ops->invalidatepage(MAPPING_NULL, page, 0,
+ PAGE_SIZE);
goto out;
}
@@ -680,7 +681,8 @@ static void gfs2_discard(struct gfs2_sbd *sdp, struct buffer_head *bh)
unlock_buffer(bh);
}
-static void gfs2_invalidatepage(struct page *page, unsigned int offset,
+static void gfs2_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host);
@@ -494,7 +494,8 @@ iomap_releasepage(struct page *page, gfp_t gfp_mask)
EXPORT_SYMBOL_GPL(iomap_releasepage);
void
-iomap_invalidatepage(struct page *page, unsigned int offset, unsigned int len)
+iomap_invalidatepage(struct address_space *__mapping, struct page *page,
+ unsigned int offset, unsigned int len)
{
trace_iomap_invalidatepage(page->mapping->host, offset, len);
@@ -557,7 +557,8 @@ static int metapage_releasepage(struct page *page, gfp_t gfp_mask)
return ret;
}
-static void metapage_invalidatepage(struct page *page, unsigned int offset,
+static void metapage_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
BUG_ON(offset || length < PAGE_SIZE);
@@ -1172,8 +1172,9 @@ int noop_set_page_dirty(struct address_space *__mapping, struct page *page)
}
EXPORT_SYMBOL_GPL(noop_set_page_dirty);
-void noop_invalidatepage(struct page *page, unsigned int offset,
- unsigned int length)
+void noop_invalidatepage(struct address_space *__mapping, struct page *page,
+ unsigned int offset,
+ unsigned int length)
{
/*
* There is no page cache to invalidate in the dax case, however
@@ -405,7 +405,8 @@ static int nfs_write_end(struct file *file, struct address_space *mapping,
* - Called if either PG_private or PG_fscache is set on the page
* - Caller holds page lock
*/
-static void nfs_invalidate_page(struct page *page, unsigned int offset,
+static void nfs_invalidate_page(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
dfprintk(PAGECACHE, "NFS: invalidate_page(%p, %u, %u)\n",
@@ -1356,7 +1356,7 @@ static int ntfs_writepage(struct address_space *__mapping, struct page *page,
* The page may have dirty, unmapped buffers. Make them
* freeable here, so the page does not leak.
*/
- block_invalidatepage(page, 0, PAGE_SIZE);
+ block_invalidatepage(MAPPING_NULL, page, 0, PAGE_SIZE);
unlock_page(page);
ntfs_debug("Write outside i_size - truncated?");
return 0;
@@ -448,9 +448,10 @@ static int orangefs_write_end(struct file *file, struct address_space *mapping,
return copied;
}
-static void orangefs_invalidatepage(struct page *page,
- unsigned int offset,
- unsigned int length)
+static void orangefs_invalidatepage(struct address_space *__mapping,
+ struct page *page,
+ unsigned int offset,
+ unsigned int length)
{
struct orangefs_write_range *wr;
wr = (struct orangefs_write_range *)page_private(page);
@@ -3156,7 +3156,8 @@ static int invalidatepage_can_drop(struct inode *inode, struct buffer_head *bh)
}
/* clm -- taken from fs/buffer.c:block_invalidate_page */
-static void reiserfs_invalidatepage(struct page *page, unsigned int offset,
+static void reiserfs_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
struct buffer_head *head, *bh, *next;
@@ -1288,7 +1288,8 @@ int ubifs_setattr(struct dentry *dentry, struct iattr *attr)
return err;
}
-static void ubifs_invalidatepage(struct page *page, unsigned int offset,
+static void ubifs_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
unsigned int length)
{
struct inode *inode = page->mapping->host;
@@ -548,7 +548,7 @@ xfs_discard_page(
if (error && !XFS_FORCED_SHUTDOWN(mp))
xfs_alert(mp, "page discard unable to remove delalloc mapping.");
out_invalidate:
- iomap_invalidatepage(page, 0, PAGE_SIZE);
+ iomap_invalidatepage(MAPPING_NULL, page, 0, PAGE_SIZE);
}
static const struct iomap_writeback_ops xfs_writeback_ops = {
@@ -214,7 +214,8 @@ extern int buffer_heads_over_limit;
* Generic address_space_operations implementations for buffer_head-backed
* address_spaces.
*/
-void block_invalidatepage(struct page *page, unsigned int offset,
+void block_invalidatepage(struct address_space *__mapping, struct page *page,
+ unsigned int offset,
unsigned int length);
int block_write_full_page(struct page *page, get_block_t *get_block,
struct writeback_control *wbc);
@@ -397,7 +397,8 @@ struct address_space_operations {
/* Unfortunately this kludge is needed for FIBMAP. Don't use it */
sector_t (*bmap)(struct address_space *, sector_t);
- void (*invalidatepage) (struct page *, unsigned int, unsigned int);
+ void (*invalidatepage) (struct address_space *, struct page *,
+ unsigned int, unsigned int);
int (*releasepage) (struct page *, gfp_t);
void (*freepage)(struct page *);
ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter);
@@ -3225,8 +3226,9 @@ extern void simple_recursive_removal(struct dentry *,
extern int noop_fsync(struct file *, loff_t, loff_t, int);
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 void noop_invalidatepage(struct address_space *__mapping,
+ struct page *page, unsigned int offset,
+ unsigned int length);
extern ssize_t noop_direct_IO(struct kiocb *iocb, struct iov_iter *iter);
extern int simple_empty(struct dentry *);
extern int simple_readpage(struct file *file, struct address_space *__mapping,
@@ -160,8 +160,9 @@ 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);
-void iomap_invalidatepage(struct page *page, unsigned int offset,
- unsigned int len);
+void iomap_invalidatepage(struct address_space *__mapping, struct page *page,
+ unsigned int offset,
+ unsigned int len);
#ifdef CONFIG_MIGRATION
int iomap_migrate_page(struct address_space *mapping, struct page *newpage,
struct page *page, enum migrate_mode mode);
@@ -152,7 +152,8 @@ static int invalidate_exceptional_entry2(struct address_space *mapping,
void do_invalidatepage(struct page *page, unsigned int offset,
unsigned int length)
{
- void (*invalidatepage)(struct page *, unsigned int, unsigned int);
+ void (*invalidatepage)(struct address_space *, struct page *,
+ unsigned int, unsigned int);
invalidatepage = page->mapping->a_ops->invalidatepage;
#ifdef CONFIG_BLOCK
@@ -160,7 +161,7 @@ void do_invalidatepage(struct page *page, unsigned int offset,
invalidatepage = block_invalidatepage;
#endif
if (invalidatepage)
- (*invalidatepage)(page, offset, length);
+ (*invalidatepage)(MAPPING_NULL, page, offset, length);
}
/*