168252eb5SThomas Gleixner/* SPDX-License-Identifier: GPL-2.0-or-later */
24c0f0bb2SPhillip Lougher#ifndef DECOMPRESSOR_H
34c0f0bb2SPhillip Lougher#define DECOMPRESSOR_H
44c0f0bb2SPhillip Lougher/*
54c0f0bb2SPhillip Lougher * Squashfs - a compressed read only filesystem for Linux
64c0f0bb2SPhillip Lougher *
74c0f0bb2SPhillip Lougher * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
8d7f2ff67SPhillip Lougher * Phillip Lougher <phillip@squashfs.org.uk>
94c0f0bb2SPhillip Lougher *
104c0f0bb2SPhillip Lougher * decompressor.h
114c0f0bb2SPhillip Lougher */
124c0f0bb2SPhillip Lougher
1393e72b3cSPhilippe Liard#include <linux/bio.h>
1493e72b3cSPhilippe Liard
154c0f0bb2SPhillip Lougherstruct squashfs_decompressor {
169508c6b9SPhillip Lougher	void	*(*init)(struct squashfs_sb_info *, void *);
179508c6b9SPhillip Lougher	void	*(*comp_opts)(struct squashfs_sb_info *, void *, int);
184c0f0bb2SPhillip Lougher	void	(*free)(void *);
19846b730eSPhillip Lougher	int	(*decompress)(struct squashfs_sb_info *, void *,
2093e72b3cSPhilippe Liard		struct bio *, int, int, struct squashfs_page_actor *);
214c0f0bb2SPhillip Lougher	int	id;
224c0f0bb2SPhillip Lougher	char	*name;
234c0f0bb2SPhillip Lougher	int	supported;
244c0f0bb2SPhillip Lougher};
254c0f0bb2SPhillip Lougher
269508c6b9SPhillip Lougherstatic inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk,
279508c6b9SPhillip Lougher							void *buff, int length)
284c0f0bb2SPhillip Lougher{
299508c6b9SPhillip Lougher	return msblk->decompressor->comp_opts ?
309508c6b9SPhillip Lougher		msblk->decompressor->comp_opts(msblk, buff, length) : NULL;
314c0f0bb2SPhillip Lougher}
327a43ae52SPhillip Lougher
337a43ae52SPhillip Lougher#ifdef CONFIG_SQUASHFS_XZ
347a43ae52SPhillip Lougherextern const struct squashfs_decompressor squashfs_xz_comp_ops;
357a43ae52SPhillip Lougher#endif
367a43ae52SPhillip Lougher
3762421645SPhillip Lougher#ifdef CONFIG_SQUASHFS_LZ4
3862421645SPhillip Lougherextern const struct squashfs_decompressor squashfs_lz4_comp_ops;
3962421645SPhillip Lougher#endif
4062421645SPhillip Lougher
4101a678c5SPhillip Lougher#ifdef CONFIG_SQUASHFS_LZO
4201a678c5SPhillip Lougherextern const struct squashfs_decompressor squashfs_lzo_comp_ops;
4301a678c5SPhillip Lougher#endif
4401a678c5SPhillip Lougher
45cc6d3497SPhillip Lougher#ifdef CONFIG_SQUASHFS_ZLIB
46cc6d3497SPhillip Lougherextern const struct squashfs_decompressor squashfs_zlib_comp_ops;
47cc6d3497SPhillip Lougher#endif
48cc6d3497SPhillip Lougher
4987bf54bbSSean Purcell#ifdef CONFIG_SQUASHFS_ZSTD
5087bf54bbSSean Purcellextern const struct squashfs_decompressor squashfs_zstd_comp_ops;
5187bf54bbSSean Purcell#endif
5287bf54bbSSean Purcell
534c0f0bb2SPhillip Lougher#endif
54