diff options
author | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-10-22 15:09:57 +0200 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-10-30 23:57:19 +0100 |
commit | efb4fb02cef3ab410b603c8f0e1c67f61d55f542 (patch) | |
tree | a6d08a3dbf0fd50b573a1fa67cc96dd6802dc624 /fs/erofs/decompressor_deflate.c | |
parent | erofs: don't warn MicroLZMA format anymore (diff) | |
download | linux-efb4fb02cef3ab410b603c8f0e1c67f61d55f542.tar.xz linux-efb4fb02cef3ab410b603c8f0e1c67f61d55f542.zip |
erofs: simplify compression configuration parser
Move erofs_load_compr_cfgs() into decompressor.c as well as introduce
a callback instead of a hard-coded switch for each algorithm for
simplicity.
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20231022130957.11398-1-xiang@kernel.org
Diffstat (limited to 'fs/erofs/decompressor_deflate.c')
-rw-r--r-- | fs/erofs/decompressor_deflate.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/erofs/decompressor_deflate.c b/fs/erofs/decompressor_deflate.c index 19e5bdeb30b6..0e1946a6bda5 100644 --- a/fs/erofs/decompressor_deflate.c +++ b/fs/erofs/decompressor_deflate.c @@ -77,9 +77,10 @@ out_failed: } int z_erofs_load_deflate_config(struct super_block *sb, - struct erofs_super_block *dsb, - struct z_erofs_deflate_cfgs *dfl, int size) + struct erofs_super_block *dsb, void *data, int size) { + struct z_erofs_deflate_cfgs *dfl = data; + if (!dfl || size < sizeof(struct z_erofs_deflate_cfgs)) { erofs_err(sb, "invalid deflate cfgs, size=%u", size); return -EINVAL; |