^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef DECOMPRESSOR_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define DECOMPRESSOR_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Squashfs - a compressed read only filesystem for Linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Phillip Lougher <phillip@squashfs.org.uk>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * decompressor.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/bio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct squashfs_decompressor {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) void *(*init)(struct squashfs_sb_info *, void *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) void *(*comp_opts)(struct squashfs_sb_info *, void *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) void (*free)(void *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) int (*decompress)(struct squashfs_sb_info *, void *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct bio *, int, int, struct squashfs_page_actor *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) int id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) int supported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) void *buff, int length)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) return msblk->decompressor->comp_opts ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) msblk->decompressor->comp_opts(msblk, buff, length) : NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #ifdef CONFIG_SQUASHFS_XZ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) extern const struct squashfs_decompressor squashfs_xz_comp_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #ifdef CONFIG_SQUASHFS_LZ4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) extern const struct squashfs_decompressor squashfs_lz4_comp_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #ifdef CONFIG_SQUASHFS_LZO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #ifdef CONFIG_SQUASHFS_ZLIB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #ifdef CONFIG_SQUASHFS_ZSTD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) extern const struct squashfs_decompressor squashfs_zstd_comp_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #endif