blob: ec8617523e56c1fb771576602048e40a6865e186 [file] [log] [blame]
Thomas Gleixner68252eb2019-05-20 19:08:00 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +01002#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
Phillip Lougherd7f2ff62011-05-26 10:39:56 +01008 * Phillip Lougher <phillip@squashfs.org.uk>
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +01009 *
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010010 * decompressor.h
11 */
12
13struct squashfs_decompressor {
Phillip Lougher9508c6b2013-11-13 02:56:26 +000014 void *(*init)(struct squashfs_sb_info *, void *);
15 void *(*comp_opts)(struct squashfs_sb_info *, void *, int);
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010016 void (*free)(void *);
Phillip Lougher846b7302013-11-18 02:59:12 +000017 int (*decompress)(struct squashfs_sb_info *, void *,
18 struct buffer_head **, int, int, int,
19 struct squashfs_page_actor *);
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010020 int id;
21 char *name;
22 int supported;
23};
24
Phillip Lougher9508c6b2013-11-13 02:56:26 +000025static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk,
26 void *buff, int length)
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010027{
Phillip Lougher9508c6b2013-11-13 02:56:26 +000028 return msblk->decompressor->comp_opts ?
29 msblk->decompressor->comp_opts(msblk, buff, length) : NULL;
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010030}
Phillip Lougher7a43ae52010-12-09 02:08:31 +000031
32#ifdef CONFIG_SQUASHFS_XZ
33extern const struct squashfs_decompressor squashfs_xz_comp_ops;
34#endif
35
Phillip Lougher62421642014-11-27 18:48:44 +000036#ifdef CONFIG_SQUASHFS_LZ4
37extern const struct squashfs_decompressor squashfs_lz4_comp_ops;
38#endif
39
Phillip Lougher01a678c2011-01-05 18:23:53 +000040#ifdef CONFIG_SQUASHFS_LZO
41extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
42#endif
43
Phillip Loughercc6d3492011-07-22 03:01:28 +010044#ifdef CONFIG_SQUASHFS_ZLIB
45extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
46#endif
47
Sean Purcell87bf54b2017-08-09 19:42:36 -070048#ifdef CONFIG_SQUASHFS_ZSTD
49extern const struct squashfs_decompressor squashfs_zstd_comp_ops;
50#endif
51
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010052#endif