]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: factor out metadata subpage detection into a dedicated helper
authorQu Wenruo <wqu@suse.com>
Tue, 28 Jan 2025 04:56:42 +0000 (15:26 +1030)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Mar 2025 19:35:41 +0000 (20:35 +0100)
commitf64e81815377c943c2869415c48d4378f8dea58f
treee3cdd57a82d0d35b94726cadcb34c47c5d15805c
parent619611e87fcca1fdaa67c2bf6b030863ab90216e
btrfs: factor out metadata subpage detection into a dedicated helper

Currently we have only one btrfs_is_subpage() to cover both data and
metadata.

But there is a special case for metadata:

- dummy extent buffer, sector size < PAGE_SIZE and node size >= PAGE_SIZE

In such case, btrfs_is_subpage() will return true for extent buffer
folio.

But that is not correct, and that's exactly why we have some open-coded
checks for functions like set_extent_buffer_uptodate() and
clear_extent_buffer_uptodate().

Just extract the metadata specific checks into a helper, and replace
those call sites.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/subpage.c
fs/btrfs/subpage.h