OSDN Git Service

erofs: support interlaced uncompressed data for compressed files
authorYue Hu <huyue2@coolpad.com>
Fri, 23 Sep 2022 02:11:21 +0000 (10:11 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 23 Sep 2022 02:55:56 +0000 (10:55 +0800)
commitfdffc091e6f94602558bba712b51bc16f79fd6d5
treed6daa04f5f2e867786577dca54fd0ef194145fa5
parent1ae9470c3e14624b0f4d8741c22b5a94062c0e33
erofs: support interlaced uncompressed data for compressed files

Currently, uncompressed data is all handled in the shifted way, which
means we have to shift the whole on-disk plain pcluster to get the
logical data.   However, since we are also using in-place I/O for
uncompressed data, data copy will be reduced a lot if pcluster is
recorded in the interlaced way as illustrated below:
 _______________________________________________________________
|               |    |               |_ tail part |_ head part _|
|<-   blk0    ->| .. |<-   blkn-2  ->|<-         blkn-1       ->|

The logical data then becomes:
 ________________________________________________________
|_ head part _|_  blk0  _| .. |_  blkn-2  _|_ tail part _|

In addition, non-4k plain pclusters are also survived by the
interlaced way, which can be used for non-4k lclusters as well.

However, it's almost impossible to de-duplicate uncompressed data
in the interlaced way, therefore shifted uncompressed data is still
useful.

Signed-off-by: Yue Hu <huyue2@coolpad.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/8369112678604fdf4ef796626d59b1fdd0745a53.1663898962.git.huyue2@coolpad.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/decompressor.c
fs/erofs/erofs_fs.h
fs/erofs/internal.h
fs/erofs/zmap.c