summaryrefslogtreecommitdiffstats
path: root/fs/erofs/decompressor.c
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2021-03-29 18:00:12 +0800
committerGao Xiang <hsiangkao@redhat.com>2021-03-29 18:01:42 +0800
commit14373711dd54be8a84e2f4f624bc58787f80cfbd (patch)
tree46b55e6a840c01886d88145052f5b2460dfbf0e8 /fs/erofs/decompressor.c
parent46249cded18ac0c4ffb7b177219510a133a51c00 (diff)
downloadlinux-14373711dd54be8a84e2f4f624bc58787f80cfbd.tar.gz
linux-14373711dd54be8a84e2f4f624bc58787f80cfbd.tar.bz2
linux-14373711dd54be8a84e2f4f624bc58787f80cfbd.zip
erofs: add on-disk compression configurations
Add a bitmap for available compression algorithms and a variable-sized on-disk table for compression options in preparation for upcoming big pcluster and LZMA algorithm, which follows the end of super block. To parse the compression options, the bitmap is scanned one by one. For each available algorithm, there is data followed by 2-byte `length' correspondingly (it's enough for most cases, or entire fs blocks should be used.) With such available algorithm bitmap, kernel itself can also refuse to mount such filesystem if any unsupported compression algorithm exists. Note that COMPR_CFGS feature will be enabled with BIG_PCLUSTER. Link: https://lore.kernel.org/r/20210329100012.12980-1-hsiangkao@aol.com Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Diffstat (limited to 'fs/erofs/decompressor.c')
-rw-r--r--fs/erofs/decompressor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
index 97538ff24a19..27aa6a99b371 100644
--- a/fs/erofs/decompressor.c
+++ b/fs/erofs/decompressor.c
@@ -41,7 +41,7 @@ int z_erofs_load_lz4_config(struct super_block *sb,
}
distance = le16_to_cpu(lz4->max_distance);
} else {
- distance = le16_to_cpu(dsb->lz4_max_distance);
+ distance = le16_to_cpu(dsb->u1.lz4_max_distance);
}
EROFS_SB(sb)->lz4.max_distance_pages = distance ?