0001
0002 #ifndef DECOMPRESSOR_H
0003 #define DECOMPRESSOR_H
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include <linux/bio.h>
0014
0015 struct squashfs_decompressor {
0016 void *(*init)(struct squashfs_sb_info *, void *);
0017 void *(*comp_opts)(struct squashfs_sb_info *, void *, int);
0018 void (*free)(void *);
0019 int (*decompress)(struct squashfs_sb_info *, void *,
0020 struct bio *, int, int, struct squashfs_page_actor *);
0021 int id;
0022 char *name;
0023 int alloc_buffer;
0024 int supported;
0025 };
0026
0027 static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk,
0028 void *buff, int length)
0029 {
0030 return msblk->decompressor->comp_opts ?
0031 msblk->decompressor->comp_opts(msblk, buff, length) : NULL;
0032 }
0033
0034 #ifdef CONFIG_SQUASHFS_XZ
0035 extern const struct squashfs_decompressor squashfs_xz_comp_ops;
0036 #endif
0037
0038 #ifdef CONFIG_SQUASHFS_LZ4
0039 extern const struct squashfs_decompressor squashfs_lz4_comp_ops;
0040 #endif
0041
0042 #ifdef CONFIG_SQUASHFS_LZO
0043 extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
0044 #endif
0045
0046 #ifdef CONFIG_SQUASHFS_ZLIB
0047 extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
0048 #endif
0049
0050 #ifdef CONFIG_SQUASHFS_ZSTD
0051 extern const struct squashfs_decompressor squashfs_zstd_comp_ops;
0052 #endif
0053
0054 #endif