diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2013-11-13 03:56:26 +0100 |
---|---|---|
committer | Phillip Lougher <phillip@squashfs.org.uk> | 2013-11-20 04:35:18 +0100 |
commit | 9508c6b90b3f57ecea4e7a896cf8325400fc0c6e (patch) | |
tree | a31589009d7d85d722b52c0ef21838ca6d2888da /fs/squashfs/squashfs.h | |
parent | Linux 3.12-rc7 (diff) | |
download | linux-9508c6b90b3f57ecea4e7a896cf8325400fc0c6e.tar.xz linux-9508c6b90b3f57ecea4e7a896cf8325400fc0c6e.zip |
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>
Diffstat (limited to 'fs/squashfs/squashfs.h')
-rw-r--r-- | fs/squashfs/squashfs.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h index d1266516ed08..2e2751df8452 100644 --- a/fs/squashfs/squashfs.h +++ b/fs/squashfs/squashfs.h @@ -48,7 +48,14 @@ extern void *squashfs_read_table(struct super_block *, u64, int); /* decompressor.c */ extern const struct squashfs_decompressor *squashfs_lookup_decompressor(int); -extern void *squashfs_decompressor_init(struct super_block *, unsigned short); +extern void *squashfs_decompressor_setup(struct super_block *, unsigned short); + +/* decompressor_xxx.c */ +extern void *squashfs_decompressor_create(struct squashfs_sb_info *, void *); +extern void squashfs_decompressor_destroy(struct squashfs_sb_info *); +extern int squashfs_decompress(struct squashfs_sb_info *, void **, + struct buffer_head **, int, int, int, int, int); +extern int squashfs_max_decompressors(void); /* export.c */ extern __le64 *squashfs_read_inode_lookup_table(struct super_block *, u64, u64, |