btrfs: add helpers to get inode from page/folio pointers
authorDavid Sterba <dsterba@suse.com>
Wed, 13 Sep 2023 14:11:29 +0000 (16:11 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Mar 2024 15:24:49 +0000 (16:24 +0100)
commitc8293894afa718653688b2fa98ab68317c875a00
tree470bf3dfdc68cdaea79bd4ef0c9c8d7fa2811d96
parentb2136cc288fce2f24a92f3d656531b2d50ebec5a
btrfs: add helpers to get inode from page/folio pointers

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>
fs/btrfs/disk-io.c
fs/btrfs/extent_io.c
fs/btrfs/fs.h
fs/btrfs/inode.c