f2fs: set zstd compress level correctly
authorSheng Yong <shengyong@oppo.com>
Thu, 17 Nov 2022 15:10:54 +0000 (23:10 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Nov 2022 20:47:05 +0000 (12:47 -0800)
Fixes: cf30f6a5f0c6 ("lib: zstd: Add kernel-specific API")
Signed-off-by: Sheng Yong <shengyong@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Reviewed-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/compress.c

index d315c2d..74d3f2d 100644 (file)
@@ -346,7 +346,7 @@ static int zstd_init_compress_ctx(struct compress_ctx *cc)
        if (!level)
                level = F2FS_ZSTD_DEFAULT_CLEVEL;
 
-       params = zstd_get_params(F2FS_ZSTD_DEFAULT_CLEVEL, cc->rlen);
+       params = zstd_get_params(level, cc->rlen);
        workspace_size = zstd_cstream_workspace_bound(&params.cParams);
 
        workspace = f2fs_kvmalloc(F2FS_I_SB(cc->inode),