squashfs.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Squashfs - a compressed read only filesystem for Linux
  4. *
  5. * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
  6. * Phillip Lougher <phillip@squashfs.org.uk>
  7. *
  8. * squashfs.h
  9. */
  10. #define TRACE(s, args...) pr_debug("SQUASHFS: "s, ## args)
  11. #define ERROR(s, args...) pr_err("SQUASHFS error: "s, ## args)
  12. #define WARNING(s, args...) pr_warn("SQUASHFS: "s, ## args)
  13. /* block.c */
  14. extern int squashfs_read_data(struct super_block *, u64, int, u64 *,
  15. struct squashfs_page_actor *);
  16. /* cache.c */
  17. extern struct squashfs_cache *squashfs_cache_init(char *, int, int);
  18. extern void squashfs_cache_delete(struct squashfs_cache *);
  19. extern struct squashfs_cache_entry *squashfs_cache_get(struct super_block *,
  20. struct squashfs_cache *, u64, int);
  21. extern void squashfs_cache_put(struct squashfs_cache_entry *);
  22. extern int squashfs_copy_data(void *, struct squashfs_cache_entry *, int, int);
  23. extern int squashfs_read_metadata(struct super_block *, void *, u64 *,
  24. int *, int);
  25. extern struct squashfs_cache_entry *squashfs_get_fragment(struct super_block *,
  26. u64, int);
  27. extern struct squashfs_cache_entry *squashfs_get_datablock(struct super_block *,
  28. u64, int);
  29. extern void *squashfs_read_table(struct super_block *, u64, int);
  30. /* decompressor.c */
  31. extern const struct squashfs_decompressor *squashfs_lookup_decompressor(int);
  32. extern void *squashfs_decompressor_setup(struct super_block *, unsigned short);
  33. /* decompressor_xxx.c */
  34. struct squashfs_decompressor_thread_ops {
  35. void * (*create)(struct squashfs_sb_info *msblk, void *comp_opts);
  36. void (*destroy)(struct squashfs_sb_info *msblk);
  37. int (*decompress)(struct squashfs_sb_info *msblk, struct bio *bio,
  38. int offset, int length, struct squashfs_page_actor *output);
  39. int (*max_decompressors)(void);
  40. };
  41. #ifdef CONFIG_SQUASHFS_DECOMP_SINGLE
  42. extern const struct squashfs_decompressor_thread_ops squashfs_decompressor_single;
  43. #endif
  44. #ifdef CONFIG_SQUASHFS_DECOMP_MULTI
  45. extern const struct squashfs_decompressor_thread_ops squashfs_decompressor_multi;
  46. #endif
  47. #ifdef CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU
  48. extern const struct squashfs_decompressor_thread_ops squashfs_decompressor_percpu;
  49. #endif
  50. /* export.c */
  51. extern __le64 *squashfs_read_inode_lookup_table(struct super_block *, u64, u64,
  52. unsigned int);
  53. /* fragment.c */
  54. extern int squashfs_frag_lookup(struct super_block *, unsigned int, u64 *);
  55. extern __le64 *squashfs_read_fragment_index_table(struct super_block *,
  56. u64, u64, unsigned int);
  57. /* file.c */
  58. void squashfs_fill_page(struct page *, struct squashfs_cache_entry *, int, int);
  59. void squashfs_copy_cache(struct page *, struct squashfs_cache_entry *, int,
  60. int);
  61. /* file_xxx.c */
  62. extern int squashfs_readpage_block(struct page *, u64, int, int);
  63. /* id.c */
  64. extern int squashfs_get_id(struct super_block *, unsigned int, unsigned int *);
  65. extern __le64 *squashfs_read_id_index_table(struct super_block *, u64, u64,
  66. unsigned short);
  67. /* inode.c */
  68. extern struct inode *squashfs_iget(struct super_block *, long long,
  69. unsigned int);
  70. extern int squashfs_read_inode(struct inode *, long long);
  71. /* xattr.c */
  72. extern ssize_t squashfs_listxattr(struct dentry *, char *, size_t);
  73. /*
  74. * Inodes, files, decompressor and xattr operations
  75. */
  76. /* dir.c */
  77. extern const struct file_operations squashfs_dir_ops;
  78. /* export.c */
  79. extern const struct export_operations squashfs_export_ops;
  80. /* file.c */
  81. extern const struct address_space_operations squashfs_aops;
  82. /* inode.c */
  83. extern const struct inode_operations squashfs_inode_ops;
  84. /* namei.c */
  85. extern const struct inode_operations squashfs_dir_inode_ops;
  86. /* symlink.c */
  87. extern const struct address_space_operations squashfs_symlink_aops;
  88. extern const struct inode_operations squashfs_symlink_inode_ops;
  89. /* xattr.c */
  90. extern const struct xattr_handler * const squashfs_xattr_handlers[];