btrfs: add helper to get fs_info from struct inode pointer
authorDavid Sterba <dsterba@suse.com>
Thu, 14 Sep 2023 14:45:41 +0000 (16:45 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Mar 2024 15:24:49 +0000 (16:24 +0100)
commit41044b41ad2c8c8165a42ec6e9a4096826dcf153
tree9c99810f8a8fe29a29410a0b4170c708763e00e4
parentb33d2e535f9b2a1c4210cfc4843ac0dbacbeebcc
btrfs: add helper to get fs_info from struct inode pointer

Add a convenience helper to get a fs_info from a VFS inode pointer
instead of open coding the chain or using btrfs_sb() that in some cases
does one more pointer hop.  This is implemented as a macro (still with
type checking) so we don't need full definitions of struct btrfs_inode,
btrfs_root or btrfs_fs_info.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
14 files changed:
fs/btrfs/compression.c
fs/btrfs/defrag.c
fs/btrfs/disk-io.c
fs/btrfs/export.c
fs/btrfs/extent_io.c
fs/btrfs/file.c
fs/btrfs/free-space-cache.c
fs/btrfs/fs.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/lzo.c
fs/btrfs/props.c
fs/btrfs/reflink.c
fs/btrfs/relocation.c