acrn-kernel/fs/erofs
Gao Xiang 9a53410038 erofs: fix compact 4B support for 16k block size
[ Upstream commit 001b8ccd06 ]

In compact 4B, two adjacent lclusters are packed together as a unit to
form on-disk indexes for effective random access, as below:

(amortized = 4, vcnt = 2)
       _____________________________________________
      |___@_____ encoded bits __________|_ blkaddr _|
      0        .                                    amortized * vcnt = 8
      .             .
      .                  .              amortized * vcnt - 4 = 4
      .                        .
      .____________________________.
      |_type (2 bits)_|_clusterofs_|

Therefore, encoded bits for each pack are 32 bits (4 bytes). IOWs,
since each lcluster can get 16 bits for its type and clusterofs, the
maximum supported lclustersize for compact 4B format is 16k (14 bits).

Fix this to enable compact 4B format for 16k lclusters (blocks), which
is tested on an arm64 server with 16k page size.

Fixes: 152a333a58 ("staging: erofs: add compacted compression indexes support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230601112341.56960-1-hsiangkao@linux.alibaba.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-19 16:20:59 +02:00
..
Kconfig
Makefile
compress.h
data.c erofs: simplify iloc() 2023-07-19 16:20:59 +02:00
decompressor.c
decompressor_lzma.c
dir.c
erofs_fs.h
fscache.c
inode.c erofs: simplify iloc() 2023-07-19 16:20:59 +02:00
internal.h erofs: simplify iloc() 2023-07-19 16:20:59 +02:00
namei.c
pcpubuf.c
super.c erofs: initialize packed inode after root inode is assigned 2023-05-11 23:03:07 +09:00
sysfs.c
utils.c
xattr.c erofs: simplify iloc() 2023-07-19 16:20:59 +02:00
xattr.h
zdata.c erofs: kill hooked chains to avoid loops on deduplicated compressed images 2023-07-19 16:20:55 +02:00
zmap.c erofs: fix compact 4B support for 16k block size 2023-07-19 16:20:59 +02:00