diff options
author | Qu Wenruo <wqu@suse.com> | 2024-01-29 20:16:07 +1030 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2024-05-07 21:31:02 +0200 |
commit | 98fe01af7ebe44bcc11afe4b4d681e27b959adb4 (patch) | |
tree | 7af95ec3e3cbdb381675070a8d7f03625ff7f8e4 /fs/btrfs/zstd.c | |
parent | 6de3595473b0bae11102ef6db40e6f2334f13ed2 (diff) | |
download | linux-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/zstd.c')
-rw-r--r-- | fs/btrfs/zstd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c index b647ad036af3..4ec5dd84b93e 100644 --- a/fs/btrfs/zstd.c +++ b/fs/btrfs/zstd.c @@ -414,7 +414,7 @@ int zstd_compress_pages(struct list_head *ws, struct address_space *mapping, workspace->in_buf.size = min_t(size_t, len, PAGE_SIZE); /* Allocate and map in the output buffer */ - out_page = btrfs_alloc_compr_page(); + out_page = folio_page(btrfs_alloc_compr_folio(), 0); if (out_page == NULL) { ret = -ENOMEM; goto out; @@ -459,7 +459,7 @@ int zstd_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; @@ -519,7 +519,7 @@ int zstd_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; |