aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/lzo.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/lzo.c
parent6de3595473b0bae11102ef6db40e6f2334f13ed2 (diff)
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/lzo.c')
-rw-r--r--fs/btrfs/lzo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
index 6ac2cd177d44..c0e8894c9727 100644
--- a/fs/btrfs/lzo.c
+++ b/fs/btrfs/lzo.c
@@ -152,7 +152,7 @@ static int copy_compressed_data_to_page(char *compressed_data,
cur_page = out_pages[*cur_out / PAGE_SIZE];
/* Allocate a new page */
if (!cur_page) {
- cur_page = btrfs_alloc_compr_page();
+ cur_page = folio_page(btrfs_alloc_compr_folio(), 0);
if (!cur_page)
return -ENOMEM;
out_pages[*cur_out / PAGE_SIZE] = cur_page;
@@ -178,7 +178,7 @@ static int copy_compressed_data_to_page(char *compressed_data,
cur_page = out_pages[*cur_out / PAGE_SIZE];
/* Allocate a new page */
if (!cur_page) {
- cur_page = btrfs_alloc_compr_page();
+ cur_page = folio_page(btrfs_alloc_compr_folio(), 0);
if (!cur_page)
return -ENOMEM;
out_pages[*cur_out / PAGE_SIZE] = cur_page;