Squashfs: Refactor decompressor interface and code
authorPhillip Lougher <phillip@squashfs.org.uk>
Wed, 13 Nov 2013 02:56:26 +0000 (02:56 +0000)
committerMohamad Ayyash <mkayyash@google.com>
Wed, 4 Mar 2015 19:22:02 +0000 (11:22 -0800)
commit06e4ac0b0a206086bff4cb34c07f5a87e87aef4c
tree8811b9d5cd77313c33068ab57b67a5c12b76ac14
parentbb5919cc205072075aab3639a9c62302db148d25
Squashfs: Refactor decompressor interface and code

The decompressor interface and code was written from
the point of view of single-threaded operation.  In doing
so it mixed a lot of single-threaded implementation specific
aspects into the decompressor code and elsewhere which makes it
difficult to seamlessly support multiple different decompressor
implementations.

This patch does the following:

1.  It removes compressor_options parsing from the decompressor
    init() function.  This allows the decompressor init() function
    to be dynamically called to instantiate multiple decompressors,
    without the compressor options needing to be read and parsed each
    time.

2.  It moves threading and all sleeping operations out of the
    decompressors.  In doing so, it makes the decompressors
    non-blocking wrappers which only deal with interfacing with
    the decompressor implementation.

3. It splits decompressor.[ch] into decompressor generic functions
   in decompressor.[ch], and moves the single threaded
   decompressor implementation into decompressor_single.c.

The result of this patch is Squashfs should now be able to
support multiple decompressors by adding new decompressor_xxx.c
files with specialised implementations of the functions in
decompressor_single.c

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Reviewed-by: Minchan Kim <minchan@kernel.org>
fs/squashfs/Makefile
fs/squashfs/block.c
fs/squashfs/decompressor.c
fs/squashfs/decompressor.h
fs/squashfs/decompressor_single.c [new file with mode: 0644]
fs/squashfs/lzo_wrapper.c
fs/squashfs/squashfs.h
fs/squashfs/squashfs_fs_sb.h
fs/squashfs/super.c
fs/squashfs/xz_wrapper.c
fs/squashfs/zlib_wrapper.c