btrfs: replace __free_page with folio_put() in attach_eb_folio_to_filemap()

Calling __free_page() on folio_page() happens to work today, but
won't always.  Besides, it's far simpler to call folio_put().

Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Tested-by: Boris Burkov <boris@bur.io>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Matthew Wilcox (Oracle) 2026-05-22 19:14:08 +01:00 committed by Johannes Thumshirn
parent 0279bed34c
commit 03f1fc95a7

View File

@ -3400,8 +3400,8 @@ static int attach_eb_folio_to_filemap(struct extent_buffer *eb, int i,
finish:
spin_lock(&mapping->i_private_lock);
if (existing_folio && btrfs_meta_is_subpage(fs_info)) {
/* We're going to reuse the existing page, can drop our folio now. */
__free_page(folio_page(eb->folios[i], 0));
/* We're going to reuse the existing folio, can drop our folio now. */
folio_put(eb->folios[i]);
eb->folios[i] = existing_folio;
} else if (existing_folio) {
struct extent_buffer *existing_eb;
@ -3416,7 +3416,7 @@ static int attach_eb_folio_to_filemap(struct extent_buffer *eb, int i,
return 1;
}
/* The extent buffer no longer exists, we can reuse the folio. */
__free_page(folio_page(eb->folios[i], 0));
folio_put(eb->folios[i]);
eb->folios[i] = existing_folio;
}
eb->folio_size = folio_size(eb->folios[i]);