decompressor.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  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
  8. * Phillip Lougher <phillip@squashfs.org.uk>
  9. *
  10. * decompressor.h
  11. */
  12. #include <linux/bio.h>
  13. struct squashfs_decompressor {
  14. void *(*init)(struct squashfs_sb_info *, void *);
  15. void *(*comp_opts)(struct squashfs_sb_info *, void *, int);
  16. void (*free)(void *);
  17. int (*decompress)(struct squashfs_sb_info *, void *,
  18. struct bio *, int, int, struct squashfs_page_actor *);
  19. int id;
  20. char *name;
  21. int supported;
  22. };
  23. static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk,
  24. void *buff, int length)
  25. {
  26. return msblk->decompressor->comp_opts ?
  27. msblk->decompressor->comp_opts(msblk, buff, length) : NULL;
  28. }
  29. #ifdef CONFIG_SQUASHFS_XZ
  30. extern const struct squashfs_decompressor squashfs_xz_comp_ops;
  31. #endif
  32. #ifdef CONFIG_SQUASHFS_LZ4
  33. extern const struct squashfs_decompressor squashfs_lz4_comp_ops;
  34. #endif
  35. #ifdef CONFIG_SQUASHFS_LZO
  36. extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
  37. #endif
  38. #ifdef CONFIG_SQUASHFS_ZLIB
  39. extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
  40. #endif
  41. #ifdef CONFIG_SQUASHFS_ZSTD
  42. extern const struct squashfs_decompressor squashfs_zstd_comp_ops;
  43. #endif
  44. #endif