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