diff options
author | 2025-03-10 13:40:47 +1030 | |
---|---|---|
committer | 2025-03-18 20:35:52 +0100 | |
commit | 4c14d5c85503da0a21540b1fb80bf5abb723f16e (patch) | |
tree | f84b9dfc122edd62e126b3adf1ad5de00564c973 /fs/btrfs/subpage.h | |
parent | btrfs: add extra warning if delayed iput is added when it's not allowed (diff) | |
download | wireguard-linux-4c14d5c85503da0a21540b1fb80bf5abb723f16e.tar.xz wireguard-linux-4c14d5c85503da0a21540b1fb80bf5abb723f16e.zip |
btrfs: subpage: make btrfs_is_subpage() check against a folio
To support large data folios, we can no longer assume every filemap
folio is page sized.
So btrfs_is_subpage() check must be done against a folio.
Thankfully for metadata folios, we have the full control and ensure a
large folio will not be large than nodesize, so
btrfs_meta_is_subpage() doesn't need this change.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to '')
-rw-r--r-- | fs/btrfs/subpage.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/subpage.h b/fs/btrfs/subpage.h index 9d1ad6c7c6bd..baa23258e7fa 100644 --- a/fs/btrfs/subpage.h +++ b/fs/btrfs/subpage.h @@ -85,10 +85,10 @@ static inline bool btrfs_meta_is_subpage(const struct btrfs_fs_info *fs_info) return fs_info->nodesize < PAGE_SIZE; } static inline bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, - struct address_space *mapping) + struct folio *folio) { - if (mapping && mapping->host) - ASSERT(is_data_inode(BTRFS_I(mapping->host))); + if (folio->mapping && folio->mapping->host) + ASSERT(is_data_inode(BTRFS_I(folio->mapping->host))); return fs_info->sectorsize < PAGE_SIZE; } #else @@ -97,10 +97,10 @@ static inline bool btrfs_meta_is_subpage(const struct btrfs_fs_info *fs_info) return false; } static inline bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, - struct address_space *mapping) + struct folio *folio) { - if (mapping && mapping->host) - ASSERT(is_data_inode(BTRFS_I(mapping->host))); + if (folio->mapping && folio->mapping->host) + ASSERT(is_data_inode(BTRFS_I(folio->mapping->host))); return false; } #endif |