]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: add helpers to get fs_info from page/folio pointers
authorDavid Sterba <dsterba@suse.com>
Thu, 14 Sep 2023 14:24:43 +0000 (16:24 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Mar 2024 15:24:49 +0000 (16:24 +0100)
commitb33d2e535f9b2a1c4210cfc4843ac0dbacbeebcc
tree239967d4bacf6574b0a97638c561b8d77d5c1c75
parentc8293894afa718653688b2fa98ab68317c875a00
btrfs: add helpers to get fs_info from page/folio pointers

Add convenience helpers to get a fs_info from a page or folio 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 page, folio,
btrfs_root and btrfs_fs_info. The latter can't be static inlines as this
would create loop between ctree.h <-> fs.h, or the headers would have to
be restructured.

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