1 /* SPDX-License-Identifier: GPL-2.0-or-later * << 2 #ifndef DECOMPRESSOR_H 1 #ifndef DECOMPRESSOR_H 3 #define DECOMPRESSOR_H 2 #define DECOMPRESSOR_H 4 /* 3 /* 5 * Squashfs - a compressed read only filesyste 4 * Squashfs - a compressed read only filesystem for Linux 6 * 5 * 7 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 6 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 8 * Phillip Lougher <phillip@squashfs.org.uk> 7 * Phillip Lougher <phillip@squashfs.org.uk> 9 * 8 * >> 9 * This program is free software; you can redistribute it and/or >> 10 * modify it under the terms of the GNU General Public License >> 11 * as published by the Free Software Foundation; either version 2, >> 12 * or (at your option) any later version. >> 13 * >> 14 * This program is distributed in the hope that it will be useful, >> 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of >> 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> 17 * GNU General Public License for more details. >> 18 * >> 19 * You should have received a copy of the GNU General Public License >> 20 * along with this program; if not, write to the Free Software >> 21 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. >> 22 * 10 * decompressor.h 23 * decompressor.h 11 */ 24 */ 12 25 13 #include <linux/bio.h> << 14 << 15 struct squashfs_decompressor { 26 struct squashfs_decompressor { 16 void *(*init)(struct squashfs_sb_in 27 void *(*init)(struct squashfs_sb_info *, void *); 17 void *(*comp_opts)(struct squashfs_ 28 void *(*comp_opts)(struct squashfs_sb_info *, void *, int); 18 void (*free)(void *); 29 void (*free)(void *); 19 int (*decompress)(struct squashfs_ 30 int (*decompress)(struct squashfs_sb_info *, void *, 20 struct bio *, int, int, struct !! 31 struct buffer_head **, int, int, int, >> 32 struct squashfs_page_actor *); 21 int id; 33 int id; 22 char *name; 34 char *name; 23 int alloc_buffer; << 24 int supported; 35 int supported; 25 }; 36 }; 26 37 27 static inline void *squashfs_comp_opts(struct 38 static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk, 28 39 void *buff, int length) 29 { 40 { 30 return msblk->decompressor->comp_opts 41 return msblk->decompressor->comp_opts ? 31 msblk->decompressor->comp_opts 42 msblk->decompressor->comp_opts(msblk, buff, length) : NULL; 32 } 43 } 33 44 34 #ifdef CONFIG_SQUASHFS_XZ 45 #ifdef CONFIG_SQUASHFS_XZ 35 extern const struct squashfs_decompressor squa 46 extern const struct squashfs_decompressor squashfs_xz_comp_ops; 36 #endif 47 #endif 37 48 38 #ifdef CONFIG_SQUASHFS_LZ4 49 #ifdef CONFIG_SQUASHFS_LZ4 39 extern const struct squashfs_decompressor squa 50 extern const struct squashfs_decompressor squashfs_lz4_comp_ops; 40 #endif 51 #endif 41 52 42 #ifdef CONFIG_SQUASHFS_LZO 53 #ifdef CONFIG_SQUASHFS_LZO 43 extern const struct squashfs_decompressor squa 54 extern const struct squashfs_decompressor squashfs_lzo_comp_ops; 44 #endif 55 #endif 45 56 46 #ifdef CONFIG_SQUASHFS_ZLIB 57 #ifdef CONFIG_SQUASHFS_ZLIB 47 extern const struct squashfs_decompressor squa 58 extern const struct squashfs_decompressor squashfs_zlib_comp_ops; 48 #endif 59 #endif 49 60 50 #ifdef CONFIG_SQUASHFS_ZSTD 61 #ifdef CONFIG_SQUASHFS_ZSTD 51 extern const struct squashfs_decompressor squa 62 extern const struct squashfs_decompressor squashfs_zstd_comp_ops; 52 #endif 63 #endif 53 64 54 #endif 65 #endif 55 66
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.