• G
    staging: erofs: add compacted ondisk compression indexes · ec8c2442
    Gao Xiang 提交于
    This patch introduces new compacted compression indexes.
    
    In contract to legacy compression indexes that
       each 4k logical cluster has an 8-byte index,
    compacted ondisk compression indexes will have
       amortized 2 bytes for each 4k logical cluster (compacted 2B)
       amortized 4 bytes for each 4k logical cluster (compacted 4B)
    
    In detail, several continuous clusters will be encoded in
    a compacted pack with cluster types, offsets, and one blkaddr
    at the end of the pack to leave 4-byte margin for better
    decoding performance, as illustrated below:
       _____________________________________________
      |___@_____ encoded bits __________|_ blkaddr _|
      0       .                                     amortized * vcnt
      .          .
      .             .                   amortized * vcnt - 4
      .                .
      .___________________.
      |_type_|_clusterofs_|
    
    Note that compacted 2 / 4B should be aligned with 32 / 8 bytes
    in order to avoid each pack crossing page boundary.
    Reviewed-by: NChao Yu <yuchao0@huawei.com>
    Signed-off-by: NGao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ec8c2442
erofs_fs.h 9.8 KB