fs/squashfs: Add init and clean-up functions to decompression
Add sqfs_decompressor_init() and sqfs_decompressor_cleanup(). These
functions are called respectively in sqfs_probe() and sqfs_close(). For
now, only ZSTD requires an initialization logic. ZSTD support will be
added in a follow-up commit.
Move squashfs_ctxt definition to sqfs_filesystem.h. This structure is
passed to sqfs_decompressor_init() and sqfs_decompressor_cleanup(), so
it can no longer be local to sqfs.c.
Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
diff --git a/fs/squashfs/sqfs_decompressor.h b/fs/squashfs/sqfs_decompressor.h
index 378965d..450257e 100644
--- a/fs/squashfs/sqfs_decompressor.h
+++ b/fs/squashfs/sqfs_decompressor.h
@@ -9,6 +9,7 @@
#define SQFS_DECOMPRESSOR_H
#include <stdint.h>
+#include "sqfs_filesystem.h"
#define SQFS_COMP_ZLIB 1
#define SQFS_COMP_LZMA 2
@@ -54,5 +55,7 @@
int sqfs_decompress(u16 comp_type, void *dest, unsigned long *dest_len,
void *source, u32 lenp);
+int sqfs_decompressor_init(struct squashfs_ctxt *ctxt);
+void sqfs_decompressor_cleanup(struct squashfs_ctxt *ctxt);
#endif /* SQFS_DECOMPRESSOR_H */