summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2024-01-29 20:16:07 +1030
committerDavid Sterba <dsterba@suse.com>2024-05-07 21:31:02 +0200
commit98fe01af7ebe44bcc11afe4b4d681e27b959adb4 (patch)
tree7af95ec3e3cbdb381675070a8d7f03625ff7f8e4 /fs/btrfs/inode.c
parent6de3595473b0bae11102ef6db40e6f2334f13ed2 (diff)
downloadlinux-98fe01af7ebe44bcc11afe4b4d681e27b959adb4.tar.gz
linux-98fe01af7ebe44bcc11afe4b4d681e27b959adb4.tar.bz2
linux-98fe01af7ebe44bcc11afe4b4d681e27b959adb4.zip
btrfs: compression: convert page allocation to folio interfaces
Currently we have two wrappers to allocate and free a page for compression usage: - btrfs_alloc_compr_page() - btrfs_free_compr_page() The allocator would try to grab a page from the pool, and only allocate a new page if the pool is empty. The reclaimer would check if the pool is full, and if not full it would put the page into the pool. This patch converts both helpers to use folio interfaces, and allowing further conversion of compression path to folios. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 2d75e04a5a9b..2deb662f171c 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1047,7 +1047,7 @@ free_pages:
if (pages) {
for (i = 0; i < nr_pages; i++) {
WARN_ON(pages[i]->mapping);
- btrfs_free_compr_page(pages[i]);
+ btrfs_free_compr_folio(page_folio(pages[i]));
}
kfree(pages);
}
@@ -1062,7 +1062,7 @@ static void free_async_extent_pages(struct async_extent *async_extent)
for (i = 0; i < async_extent->nr_pages; i++) {
WARN_ON(async_extent->pages[i]->mapping);
- btrfs_free_compr_page(async_extent->pages[i]);
+ btrfs_free_compr_folio(page_folio(async_extent->pages[i]));
}
kfree(async_extent->pages);
async_extent->nr_pages = 0;