UPSTREAM: erofs-utils: fsck: add --extract=X support to extract to path X

Add support to extract directories, regular files and symlinks.
Allocation for extract_path is done only once, then the buffer is
reused.

Raw and compressed data chunks are handled with a unified function
to avoid code duplication, compressed data is verified linearly (with
EROFS_GET_BLOCKS_FIEMAP) instead of lookback, as it's problematic to
extract data when looking backwards.

Link: https://lore.kernel.org/r/20220120013203.25990-1-xiang@kernel.org
Signed-off-by: Igor Ostapenko <igoreisberg@gmail.com>
Signed-off-by: Gao Xiang <xiang@kernel.org>
Change-Id: Iea39e71a3bf63a34e20b7f7445510705f5ffa00e
3 files changed