afs: Convert directory aops to invalidate_folio

Use folio->index instead of folio_index() because there's no way we're
writing a page from the swapcache to a directory.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs
Tested-by: David Howells <dhowells@redhat.com> # afs
parent 040cdd4b
...@@ -42,8 +42,8 @@ static int afs_rename(struct user_namespace *mnt_userns, struct inode *old_dir, ...@@ -42,8 +42,8 @@ static int afs_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
struct dentry *old_dentry, struct inode *new_dir, struct dentry *old_dentry, struct inode *new_dir,
struct dentry *new_dentry, unsigned int flags); 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 page *page, gfp_t gfp_flags);
static void afs_dir_invalidatepage(struct page *page, unsigned int offset, static void afs_dir_invalidate_folio(struct folio *folio, size_t offset,
unsigned int length); size_t length);
static int afs_dir_set_page_dirty(struct page *page) static int afs_dir_set_page_dirty(struct page *page)
{ {
...@@ -75,7 +75,7 @@ const struct inode_operations afs_dir_inode_operations = { ...@@ -75,7 +75,7 @@ const struct inode_operations afs_dir_inode_operations = {
const struct address_space_operations afs_dir_aops = { const struct address_space_operations afs_dir_aops = {
.set_page_dirty = afs_dir_set_page_dirty, .set_page_dirty = afs_dir_set_page_dirty,
.releasepage = afs_dir_releasepage, .releasepage = afs_dir_releasepage,
.invalidatepage = afs_dir_invalidatepage, .invalidate_folio = afs_dir_invalidate_folio,
}; };
const struct dentry_operations afs_fs_dentry_operations = { const struct dentry_operations afs_fs_dentry_operations = {
...@@ -2019,13 +2019,12 @@ static int afs_dir_releasepage(struct page *subpage, gfp_t gfp_flags) ...@@ -2019,13 +2019,12 @@ static int afs_dir_releasepage(struct page *subpage, gfp_t gfp_flags)
/* /*
* Invalidate part or all of a folio. * Invalidate part or all of a folio.
*/ */
static void afs_dir_invalidatepage(struct page *subpage, unsigned int offset, static void afs_dir_invalidate_folio(struct folio *folio, size_t offset,
unsigned int length) size_t length)
{ {
struct folio *folio = page_folio(subpage);
struct afs_vnode *dvnode = AFS_FS_I(folio_inode(folio)); struct afs_vnode *dvnode = AFS_FS_I(folio_inode(folio));
_enter("{%lu},%u,%u", folio_index(folio), offset, length); _enter("{%lu},%zu,%zu", folio->index, offset, length);
BUG_ON(!folio_test_locked(folio)); BUG_ON(!folio_test_locked(folio));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment