[PATCH 04/10] btrfs: convert btrfs_compr_pool_scan() to use folios
From: Tal Zussman
Date: Sun Sep 06 2026 - 18:33:58 EST
The compression pool holds order-0 folios, but btrfs_compr_pool_scan()
walks it as struct page through page->lru. Walk it as folios, matching
the other compression pool functions. This removes the last use of
page->lru in btrfs and saves a call to compound_head() per freed
folio.
Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
---
fs/btrfs/compression.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index c62b5148d5ac..979b2ffbd8fc 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -168,10 +168,10 @@ static unsigned long btrfs_compr_pool_scan(struct shrinker *sh, struct shrink_co
spin_unlock(&compr_pool.lock);
list_for_each_safe(tmp, next, &remove) {
- struct page *page = list_entry(tmp, struct page, lru);
+ struct folio *folio = list_entry(tmp, struct folio, lru);
- ASSERT(page_ref_count(page) == 1);
- put_page(page);
+ ASSERT(folio_ref_count(folio) == 1);
+ folio_put(folio);
}
return freed;
--
2.39.5