mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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>
This commit is contained in:
@@ -7904,7 +7904,7 @@ static void btrfs_readahead(struct readahead_control *rac)
|
||||
*/
|
||||
static void wait_subpage_spinlock(struct page *page)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = btrfs_sb(page->mapping->host->i_sb);
|
||||
struct btrfs_fs_info *fs_info = page_to_fs_info(page);
|
||||
struct folio *folio = page_folio(page);
|
||||
struct btrfs_subpage *subpage;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user