staging: erofs: introduce a customized LZ4 decompression
authorGao Xiang <gaoxiang25@huawei.com>
Thu, 26 Jul 2018 12:22:01 +0000 (20:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jul 2018 15:24:09 +0000 (17:24 +0200)
commit366c96a3a8681c90d0663f580ebc4dd077df2152
tree0abdecf56ddff2a8c94326c172fede65b04351cb
parent55441958bb8d1a7b5509f1332ce98b0a733231da
staging: erofs: introduce a customized LZ4 decompression

We have to reduce the memory cost as much as possible,
so we don't want to decompress more data beyond
the output buffer size, however "LZ4_decompress_safe_partial"
doesn't guarantee to stop at the arbitary end position,
but stop just after its current LZ4 "sequence" is completed.

Link: https://groups.google.com/forum/#!topic/lz4c/_3kkz5N6n00
Therefore, I hacked the LZ4 decompression logic by hand,
probably NOT the fastest approach, and hope for better
implementation.

Signed-off-by: Miao Xie <miaoxie@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/Makefile
drivers/staging/erofs/lz4defs.h [new file with mode: 0644]
drivers/staging/erofs/unzip_lz4.c [new file with mode: 0644]