[PATCH 00/10] btrfs: convert some struct page users to folios

From: Tal Zussman

Date: Sun Sep 06 2026 - 18:32:38 EST


This series converts four areas of btrfs that still use struct page:

1. The extent-io tests. test_find_delalloc() uses the page APIs, and the
extent buffer memory checks assume one page per folio.

2. Compression. btrfs_compr_pool_scan() walks the folio pool as struct
page, the last use of page->lru in btrfs, and the heuristic sampler
is the last caller of find_get_page().

3. Super block reads. btrfs_read_disk_super() and the zoned super block
log comparison are the last page cache lookups by page in btrfs.

4. The v1 free space cache. struct btrfs_io_ctl stores pages that
io_ctl_prepare_pages() has just converted from folios. Its mapping
allows large folios, which the io_ctl code can't handle, so the first
patch keeps it at order 0 to match the v1 format. While this is
deprecated, it uses page APIs that we would like to remove, so it is
still worth converting in the meantime.

Tested with KASAN, lockdep, DEBUG_VM and the btrfs selftests enabled.
The v1 space cache paths were tested by mounting a filesystem whose
cache was written by an older kernel. xfstests' compress group under
compress=zstd and the btrfs group both pass.

---
Tal Zussman (10):
btrfs: tests: rename process_page_range() to process_folio_range()
btrfs: tests: convert test_find_delalloc() to use folios
btrfs: tests: use eb folio helpers in extent buffer memory checks
btrfs: convert btrfs_compr_pool_scan() to use folios
btrfs: convert heuristic_collect_sample() to use folios
btrfs: fix stale function references in compression comments
btrfs: use folios for reading super blocks from the block device
btrfs: keep the free space cache inode mapping at order 0
btrfs: convert struct btrfs_io_ctl to use folios
btrfs: rename io_ctl page helpers to folio helpers

fs/btrfs/btrfs_inode.h | 7 ++
fs/btrfs/compression.c | 20 +++---
fs/btrfs/disk-io.c | 2 +-
fs/btrfs/free-space-cache.c | 146 +++++++++++++++++++--------------------
fs/btrfs/free-space-cache.h | 8 +--
fs/btrfs/tests/extent-io-tests.c | 126 ++++++++++++++++-----------------
fs/btrfs/volumes.c | 16 ++---
fs/btrfs/zoned.c | 12 ++--
8 files changed, 173 insertions(+), 164 deletions(-)
---
base-commit: 966bb86e7420c64f20edaac5ea096da9b16dc458
change-id: 20260905-btrfs-folio-conversions-47950cc1faca

Best regards,
--
Tal Zussman <tz2294@xxxxxxxxxxxx>