1#ifndef DECOMPRESSOR_H
2#define DECOMPRESSOR_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26struct squashfs_decompressor {
27 void *(*init)(struct squashfs_sb_info *, void *, int);
28 void (*free)(void *);
29 int (*decompress)(struct squashfs_sb_info *, void **,
30 struct buffer_head **, int, int, int, int, int);
31 int id;
32 char *name;
33 int supported;
34};
35
36static inline void squashfs_decompressor_free(struct squashfs_sb_info *msblk,
37 void *s)
38{
39 if (msblk->decompressor)
40 msblk->decompressor->free(s);
41}
42
43static inline int squashfs_decompress(struct squashfs_sb_info *msblk,
44 void **buffer, struct buffer_head **bh, int b, int offset, int length,
45 int srclength, int pages)
46{
47 return msblk->decompressor->decompress(msblk, buffer, bh, b, offset,
48 length, srclength, pages);
49}
50
51#ifdef CONFIG_SQUASHFS_XZ
52extern const struct squashfs_decompressor squashfs_xz_comp_ops;
53#endif
54
55#ifdef CONFIG_SQUASHFS_LZO
56extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
57#endif
58
59#ifdef CONFIG_SQUASHFS_ZLIB
60extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
61#endif
62
63#endif
64