diff options
author | David Sterba <dsterba@suse.com> | 2023-09-13 17:11:29 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-03 16:32:29 +0300 |
commit | 9d2ed098768453d38c28b2ec14ad53d5ab994c86 (patch) | |
tree | 864df4a04c8ca72a50b4c2777fce20a3fe45068b /fs/btrfs/inode.c | |
parent | 101d6f446315e64534066a7075fb2c64ca4f7c80 (diff) | |
download | linux-9d2ed098768453d38c28b2ec14ad53d5ab994c86.tar.xz |
btrfs: add helpers to get inode from page/folio pointers
[ Upstream commit c8293894afa718653688b2fa98ab68317c875a00 ]
Add convenience helpers to get a struct btrfs_inode from a page or folio
pointer instead of open coding the chain or intermediate BTRFS_I. This
is implemented as a macro (still with type checking) so we don't need
full definitions of struct page or address_space.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Stable-dep-of: 86211eea8ae1 ("btrfs: qgroup: validate btrfs_qgroup_inherit parameter")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index bd3f348d503d..6948440286e5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7970,7 +7970,7 @@ static int btrfs_migrate_folio(struct address_space *mapping, static void btrfs_invalidate_folio(struct folio *folio, size_t offset, size_t length) { - struct btrfs_inode *inode = BTRFS_I(folio->mapping->host); + struct btrfs_inode *inode = folio_to_inode(folio); struct btrfs_fs_info *fs_info = inode->root->fs_info; struct extent_io_tree *tree = &inode->io_tree; struct extent_state *cached_state = NULL; |