summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/zstd.c
diff options
context:
space:
mode:
authorDennis Zhou2019-02-04 21:20:04 +0100
committerDavid Sterba2019-02-25 14:13:32 +0100
commit7bf4994304e27454c5cf99de1d43033cb29b34fd (patch)
tree573166fb907ca78db50dfcad60921bf09a9f4923 /fs/btrfs/zstd.c
parentbtrfs: move to function pointers for get/put workspaces (diff)
downloadkernel-qcow2-linux-7bf4994304e27454c5cf99de1d43033cb29b34fd.tar.gz
kernel-qcow2-linux-7bf4994304e27454c5cf99de1d43033cb29b34fd.tar.xz
kernel-qcow2-linux-7bf4994304e27454c5cf99de1d43033cb29b34fd.zip
btrfs: plumb level through the compression interface
Zlib compression supports multiple levels, but doesn't require changing in how a workspace itself is created and managed. Zstd introduces a different memory requirement such that higher levels of compression require more memory. This requires changes in how the alloc()/get() methods work for zstd. This pach plumbs compression level through the interface as a parameter in preparation for zstd compression levels. This gives the compression types opportunity to create/manage based on the compression level. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Dennis Zhou <dennis@kernel.org> 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c
index b06eaf171be7..404101864220 100644
--- a/fs/btrfs/zstd.c
+++ b/fs/btrfs/zstd.c
@@ -53,9 +53,9 @@ static void zstd_cleanup_workspace_manager(void)
btrfs_cleanup_workspace_manager(&wsm);
}
-static struct list_head *zstd_get_workspace(void)
+static struct list_head *zstd_get_workspace(unsigned int level)
{
- return btrfs_get_workspace(&wsm);
+ return btrfs_get_workspace(&wsm, level);
}
static void zstd_put_workspace(struct list_head *ws)
@@ -72,7 +72,7 @@ static void zstd_free_workspace(struct list_head *ws)
kfree(workspace);
}
-static struct list_head *zstd_alloc_workspace(void)
+static struct list_head *zstd_alloc_workspace(unsigned int level)
{
ZSTD_parameters params =
zstd_get_btrfs_parameters(ZSTD_BTRFS_MAX_INPUT);