summaryrefslogtreecommitdiff
path: root/fs/btrfs/zlib.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2024-01-29 12:46:07 +0300
committerDavid Sterba <dsterba@suse.com>2024-05-07 22:31:02 +0300
commit98fe01af7ebe44bcc11afe4b4d681e27b959adb4 (patch)
tree7af95ec3e3cbdb381675070a8d7f03625ff7f8e4 /fs/btrfs/zlib.c
parent6de3595473b0bae11102ef6db40e6f2334f13ed2 (diff)
downloadlinux-98fe01af7ebe44bcc11afe4b4d681e27b959adb4.tar.xz
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/zlib.c')
-rw-r--r--fs/btrfs/zlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c
index ad6f011eab69..c260e42b0a33 100644
--- a/fs/btrfs/zlib.c
+++ b/fs/btrfs/zlib.c
@@ -121,7 +121,7 @@ int zlib_compress_pages(struct list_head *ws, struct address_space *mapping,
workspace->strm.total_in = 0;
workspace->strm.total_out = 0;
- out_page = btrfs_alloc_compr_page();
+ out_page = folio_page(btrfs_alloc_compr_folio(), 0);
if (out_page == NULL) {
ret = -ENOMEM;
goto out;
@@ -206,7 +206,7 @@ int zlib_compress_pages(struct list_head *ws, struct address_space *mapping,
ret = -E2BIG;
goto out;
}
- out_page = btrfs_alloc_compr_page();
+ out_page = folio_page(btrfs_alloc_compr_folio(), 0);
if (out_page == NULL) {
ret = -ENOMEM;
goto out;
@@ -242,7 +242,7 @@ int zlib_compress_pages(struct list_head *ws, struct address_space *mapping,
ret = -E2BIG;
goto out;
}
- out_page = btrfs_alloc_compr_page();
+ out_page = folio_page(btrfs_alloc_compr_folio(), 0);
if (out_page == NULL) {
ret = -ENOMEM;
goto out;