162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Squashfs - a compressed read only filesystem for Linux 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 662306a36Sopenharmony_ci * Phillip Lougher <phillip@squashfs.org.uk> 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * squashfs.h 962306a36Sopenharmony_ci */ 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#define TRACE(s, args...) pr_debug("SQUASHFS: "s, ## args) 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#define ERROR(s, args...) pr_err("SQUASHFS error: "s, ## args) 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci#define WARNING(s, args...) pr_warn("SQUASHFS: "s, ## args) 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci/* block.c */ 1862306a36Sopenharmony_ciextern int squashfs_read_data(struct super_block *, u64, int, u64 *, 1962306a36Sopenharmony_ci struct squashfs_page_actor *); 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci/* cache.c */ 2262306a36Sopenharmony_ciextern struct squashfs_cache *squashfs_cache_init(char *, int, int); 2362306a36Sopenharmony_ciextern void squashfs_cache_delete(struct squashfs_cache *); 2462306a36Sopenharmony_ciextern struct squashfs_cache_entry *squashfs_cache_get(struct super_block *, 2562306a36Sopenharmony_ci struct squashfs_cache *, u64, int); 2662306a36Sopenharmony_ciextern void squashfs_cache_put(struct squashfs_cache_entry *); 2762306a36Sopenharmony_ciextern int squashfs_copy_data(void *, struct squashfs_cache_entry *, int, int); 2862306a36Sopenharmony_ciextern int squashfs_read_metadata(struct super_block *, void *, u64 *, 2962306a36Sopenharmony_ci int *, int); 3062306a36Sopenharmony_ciextern struct squashfs_cache_entry *squashfs_get_fragment(struct super_block *, 3162306a36Sopenharmony_ci u64, int); 3262306a36Sopenharmony_ciextern struct squashfs_cache_entry *squashfs_get_datablock(struct super_block *, 3362306a36Sopenharmony_ci u64, int); 3462306a36Sopenharmony_ciextern void *squashfs_read_table(struct super_block *, u64, int); 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci/* decompressor.c */ 3762306a36Sopenharmony_ciextern const struct squashfs_decompressor *squashfs_lookup_decompressor(int); 3862306a36Sopenharmony_ciextern void *squashfs_decompressor_setup(struct super_block *, unsigned short); 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci/* decompressor_xxx.c */ 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_cistruct squashfs_decompressor_thread_ops { 4362306a36Sopenharmony_ci void * (*create)(struct squashfs_sb_info *msblk, void *comp_opts); 4462306a36Sopenharmony_ci void (*destroy)(struct squashfs_sb_info *msblk); 4562306a36Sopenharmony_ci int (*decompress)(struct squashfs_sb_info *msblk, struct bio *bio, 4662306a36Sopenharmony_ci int offset, int length, struct squashfs_page_actor *output); 4762306a36Sopenharmony_ci int (*max_decompressors)(void); 4862306a36Sopenharmony_ci}; 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci#ifdef CONFIG_SQUASHFS_DECOMP_SINGLE 5162306a36Sopenharmony_ciextern const struct squashfs_decompressor_thread_ops squashfs_decompressor_single; 5262306a36Sopenharmony_ci#endif 5362306a36Sopenharmony_ci#ifdef CONFIG_SQUASHFS_DECOMP_MULTI 5462306a36Sopenharmony_ciextern const struct squashfs_decompressor_thread_ops squashfs_decompressor_multi; 5562306a36Sopenharmony_ci#endif 5662306a36Sopenharmony_ci#ifdef CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU 5762306a36Sopenharmony_ciextern const struct squashfs_decompressor_thread_ops squashfs_decompressor_percpu; 5862306a36Sopenharmony_ci#endif 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci/* export.c */ 6162306a36Sopenharmony_ciextern __le64 *squashfs_read_inode_lookup_table(struct super_block *, u64, u64, 6262306a36Sopenharmony_ci unsigned int); 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci/* fragment.c */ 6562306a36Sopenharmony_ciextern int squashfs_frag_lookup(struct super_block *, unsigned int, u64 *); 6662306a36Sopenharmony_ciextern __le64 *squashfs_read_fragment_index_table(struct super_block *, 6762306a36Sopenharmony_ci u64, u64, unsigned int); 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci/* file.c */ 7062306a36Sopenharmony_civoid squashfs_fill_page(struct page *, struct squashfs_cache_entry *, int, int); 7162306a36Sopenharmony_civoid squashfs_copy_cache(struct page *, struct squashfs_cache_entry *, int, 7262306a36Sopenharmony_ci int); 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci/* file_xxx.c */ 7562306a36Sopenharmony_ciextern int squashfs_readpage_block(struct page *, u64, int, int); 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ci/* id.c */ 7862306a36Sopenharmony_ciextern int squashfs_get_id(struct super_block *, unsigned int, unsigned int *); 7962306a36Sopenharmony_ciextern __le64 *squashfs_read_id_index_table(struct super_block *, u64, u64, 8062306a36Sopenharmony_ci unsigned short); 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci/* inode.c */ 8362306a36Sopenharmony_ciextern struct inode *squashfs_iget(struct super_block *, long long, 8462306a36Sopenharmony_ci unsigned int); 8562306a36Sopenharmony_ciextern int squashfs_read_inode(struct inode *, long long); 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci/* xattr.c */ 8862306a36Sopenharmony_ciextern ssize_t squashfs_listxattr(struct dentry *, char *, size_t); 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci/* 9162306a36Sopenharmony_ci * Inodes, files, decompressor and xattr operations 9262306a36Sopenharmony_ci */ 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci/* dir.c */ 9562306a36Sopenharmony_ciextern const struct file_operations squashfs_dir_ops; 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci/* export.c */ 9862306a36Sopenharmony_ciextern const struct export_operations squashfs_export_ops; 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ci/* file.c */ 10162306a36Sopenharmony_ciextern const struct address_space_operations squashfs_aops; 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci/* inode.c */ 10462306a36Sopenharmony_ciextern const struct inode_operations squashfs_inode_ops; 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci/* namei.c */ 10762306a36Sopenharmony_ciextern const struct inode_operations squashfs_dir_inode_ops; 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci/* symlink.c */ 11062306a36Sopenharmony_ciextern const struct address_space_operations squashfs_symlink_aops; 11162306a36Sopenharmony_ciextern const struct inode_operations squashfs_symlink_inode_ops; 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci/* xattr.c */ 11462306a36Sopenharmony_ciextern const struct xattr_handler *squashfs_xattr_handlers[]; 115