]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
f2fs: set zstd compress level correctly
authorSheng Yong <shengyong@oppo.com>
Thu, 17 Nov 2022 15:10:54 +0000 (23:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:36 +0000 (13:32 +0100)
[ Upstream commit 4ff23a6547b81ca22adb852dfe93ee5fc45328ac ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/compress.c

index d315c2de136f26f544a5518f49cdade81e693898..74d3f2d2271f36efa52fe14bcb1776366ecce54d 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),