]> git.hungrycats.org Git - linux/commit
btrfs: use folios for reading super blocks from the block device
authorTal Zussman <tz2294@columbia.edu>
Mon, 7 Sep 2026 20:20:01 +0000 (16:20 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Sep 2026 11:23:38 +0000 (13:23 +0200)
commit6995a1a22ec71b75b7955777cc47c665702e5ebe
tree594aa90632433f9cd7eb8f578b0e9d08f6c28ac7
parentf05334e583a040540f0564eab5d36f96385da046
btrfs: use folios for reading super blocks from the block device

btrfs_read_disk_super() and the zoned super block log comparison go
through read_cache_page_gfp() and page_address(), and
btrfs_release_disk_super() recovers the page with virt_to_page(). Use
mapping_read_folio_gfp(), folio_address(), and virt_to_folio() instead.
This removes the last callers of read_cache_page_gfp() and put_page()
in btrfs.

Compute the super block address with offset_in_folio() as
write_dev_supers() does, rather than assuming it is at the start of
the page.

Assisted-by: Claude:claude-fable-5-1
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c
fs/btrfs/zoned.c