diff options
author | Gao Xiang <hsiangkao@linux.alibaba.com> | 2024-05-09 02:44:53 +0300 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2024-05-09 02:46:56 +0300 |
commit | 7c35de4df1056a5a1fb4de042197b8f5b1033b61 (patch) | |
tree | 44d235d68bdeeb597c516ec547ed8781b369a096 /fs/erofs/super.c | |
parent | d69189428d50c9a8de6475f3c8c241f86f4e764a (diff) | |
download | linux-7c35de4df1056a5a1fb4de042197b8f5b1033b61.tar.xz |
erofs: Zstandard compression support
Add Zstandard compression as the 4th supported algorithm since it
becomes more popular now and some end users have asked this for
quite a while [1][2].
Each EROFS physical cluster contains only one valid standard
Zstandard frame as described in [3] so that decompression can be
performed on a per-pcluster basis independently.
Currently, it just leverages multi-call stream decompression APIs with
internal sliding window buffers. One-shot or bufferless decompression
could be implemented later for even better performance if needed.
[1] https://github.com/erofs/erofs-utils/issues/6
[2] https://lore.kernel.org/r/Y08h+z6CZdnS1XBm@B-P7TQMD6M-0146.lan
[3] https://www.rfc-editor.org/rfc/rfc8478.txt
Acked-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240508234453.17896-1-xiang@kernel.org
Diffstat (limited to 'fs/erofs/super.c')
-rw-r--r-- | fs/erofs/super.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c index e3438f1a7bac..044c79229a78 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -859,6 +859,10 @@ static int __init erofs_module_init(void) if (err) goto deflate_err; + err = z_erofs_zstd_init(); + if (err) + goto zstd_err; + err = z_erofs_gbuf_init(); if (err) goto gbuf_err; @@ -884,6 +888,8 @@ sysfs_err: zip_err: z_erofs_gbuf_exit(); gbuf_err: + z_erofs_zstd_exit(); +zstd_err: z_erofs_deflate_exit(); deflate_err: z_erofs_lzma_exit(); @@ -903,6 +909,7 @@ static void __exit erofs_module_exit(void) erofs_exit_sysfs(); z_erofs_exit_zip_subsystem(); + z_erofs_zstd_exit(); z_erofs_deflate_exit(); z_erofs_lzma_exit(); erofs_exit_shrinker(); |