aboutsummaryrefslogtreecommitdiffstats
path: root/fs/squashfs/decompressor.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/squashfs/decompressor.h')
-rw-r--r--fs/squashfs/decompressor.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/squashfs/decompressor.h b/fs/squashfs/decompressor.h
index 330073e29029..6cdb20a3878a 100644
--- a/fs/squashfs/decompressor.h
+++ b/fs/squashfs/decompressor.h
@@ -24,28 +24,21 @@
24 */ 24 */
25 25
26struct squashfs_decompressor { 26struct squashfs_decompressor {
27 void *(*init)(struct squashfs_sb_info *, void *, int); 27 void *(*init)(struct squashfs_sb_info *, void *);
28 void *(*comp_opts)(struct squashfs_sb_info *, void *, int);
28 void (*free)(void *); 29 void (*free)(void *);
29 int (*decompress)(struct squashfs_sb_info *, void **, 30 int (*decompress)(struct squashfs_sb_info *, void *, void **,
30 struct buffer_head **, int, int, int, int, int); 31 struct buffer_head **, int, int, int, int, int);
31 int id; 32 int id;
32 char *name; 33 char *name;
33 int supported; 34 int supported;
34}; 35};
35 36
36static inline void squashfs_decompressor_free(struct squashfs_sb_info *msblk, 37static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk,
37 void *s) 38 void *buff, int length)
38{ 39{
39 if (msblk->decompressor) 40 return msblk->decompressor->comp_opts ?
40 msblk->decompressor->free(s); 41 msblk->decompressor->comp_opts(msblk, buff, length) : NULL;
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} 42}
50 43
51#ifdef CONFIG_SQUASHFS_XZ 44#ifdef CONFIG_SQUASHFS_XZ