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