[PATCH 1/2] erofs-utils: lib: fix up compact indexes for block size < 4096
Yue Hu
zbestahu at gmail.com
Thu Nov 23 20:11:59 AEDT 2023
On Thu, 23 Nov 2023 13:22:44 +0800
Gao Xiang <hsiangkao at linux.alibaba.com> wrote:
> Previously, the block size always equaled to PAGE_SIZE in kernel,
> therefore `lclusterbits` couldn't be less than 12.
>
> Since sub-page compressed blocks are now considered, `lobits` for
> a lcluster in each pack of compact indexes cannot always be
> `lclusterbits` as before. Otherwise, there is no enough room for
> the special value `Z_EROFS_LI_D0_CBLKCNT`.
>
> To support smaller block sizes, `lobits` for each compacted lcluster is
> now calculated as:
> lobits = max(lclusterbits, ilog2(Z_EROFS_LI_D0_CBLKCNT) + 1)
>
> Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
Reviewed-by: Yue Hu <huyue2 at coolpad.com>
More information about the Linux-erofs
mailing list