diff options
| author | David Sterba <[email protected]> | 2023-09-14 14:24:43 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2024-03-04 15:24:49 +0000 |
| commit | b33d2e535f9b2a1c4210cfc4843ac0dbacbeebcc (patch) | |
| tree | 239967d4bacf6574b0a97638c561b8d77d5c1c75 /fs/btrfs/compression.c | |
| parent | btrfs: add helpers to get inode from page/folio pointers (diff) | |
| download | kernel-b33d2e535f9b2a1c4210cfc4843ac0dbacbeebcc.tar.gz kernel-b33d2e535f9b2a1c4210cfc4843ac0dbacbeebcc.zip | |
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 <[email protected]>
Reviewed-by: Anand Jain <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/compression.c')
| -rw-r--r-- | fs/btrfs/compression.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 488089acd49f..9cae8542c7e0 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -1036,7 +1036,7 @@ static int btrfs_decompress_bio(struct compressed_bio *cb) int btrfs_decompress(int type, const u8 *data_in, struct page *dest_page, unsigned long dest_pgoff, size_t srclen, size_t destlen) { - struct btrfs_fs_info *fs_info = btrfs_sb(dest_page->mapping->host->i_sb); + struct btrfs_fs_info *fs_info = page_to_fs_info(dest_page); struct list_head *workspace; const u32 sectorsize = fs_info->sectorsize; int ret; |
