168252eb5SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 2ffae2cd7SPhillip Lougher /* 3ffae2cd7SPhillip Lougher * Squashfs - a compressed read only filesystem for Linux 4ffae2cd7SPhillip Lougher * 5ffae2cd7SPhillip Lougher * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 6d7f2ff67SPhillip Lougher * Phillip Lougher <phillip@squashfs.org.uk> 7ffae2cd7SPhillip Lougher * 8ffae2cd7SPhillip Lougher * squashfs.h 9ffae2cd7SPhillip Lougher */ 10ffae2cd7SPhillip Lougher 11ffae2cd7SPhillip Lougher #define TRACE(s, args...) pr_debug("SQUASHFS: "s, ## args) 12ffae2cd7SPhillip Lougher 13ffae2cd7SPhillip Lougher #define ERROR(s, args...) pr_err("SQUASHFS error: "s, ## args) 14ffae2cd7SPhillip Lougher 1522010836SFabian Frederick #define WARNING(s, args...) pr_warn("SQUASHFS: "s, ## args) 16ffae2cd7SPhillip Lougher 17ffae2cd7SPhillip Lougher /* block.c */ 18846b730eSPhillip Lougher extern int squashfs_read_data(struct super_block *, u64, int, u64 *, 19846b730eSPhillip Lougher struct squashfs_page_actor *); 20ffae2cd7SPhillip Lougher 21ffae2cd7SPhillip Lougher /* cache.c */ 22ffae2cd7SPhillip Lougher extern struct squashfs_cache *squashfs_cache_init(char *, int, int); 23ffae2cd7SPhillip Lougher extern void squashfs_cache_delete(struct squashfs_cache *); 24ffae2cd7SPhillip Lougher extern struct squashfs_cache_entry *squashfs_cache_get(struct super_block *, 25ffae2cd7SPhillip Lougher struct squashfs_cache *, u64, int); 26ffae2cd7SPhillip Lougher extern void squashfs_cache_put(struct squashfs_cache_entry *); 27ffae2cd7SPhillip Lougher extern int squashfs_copy_data(void *, struct squashfs_cache_entry *, int, int); 28ffae2cd7SPhillip Lougher extern int squashfs_read_metadata(struct super_block *, void *, u64 *, 29ffae2cd7SPhillip Lougher int *, int); 30ffae2cd7SPhillip Lougher extern struct squashfs_cache_entry *squashfs_get_fragment(struct super_block *, 31ffae2cd7SPhillip Lougher u64, int); 32ffae2cd7SPhillip Lougher extern struct squashfs_cache_entry *squashfs_get_datablock(struct super_block *, 33ffae2cd7SPhillip Lougher u64, int); 3482de647eSPhillip Lougher extern void *squashfs_read_table(struct super_block *, u64, int); 35ffae2cd7SPhillip Lougher 364c0f0bb2SPhillip Lougher /* decompressor.c */ 374c0f0bb2SPhillip Lougher extern const struct squashfs_decompressor *squashfs_lookup_decompressor(int); 389508c6b9SPhillip Lougher extern void *squashfs_decompressor_setup(struct super_block *, unsigned short); 399508c6b9SPhillip Lougher 409508c6b9SPhillip Lougher /* decompressor_xxx.c */ 41*80f78409SXiaoming Ni 42*80f78409SXiaoming Ni struct squashfs_decompressor_thread_ops { 43*80f78409SXiaoming Ni void * (*create)(struct squashfs_sb_info *msblk, void *comp_opts); 44*80f78409SXiaoming Ni void (*destroy)(struct squashfs_sb_info *msblk); 45*80f78409SXiaoming Ni int (*decompress)(struct squashfs_sb_info *msblk, struct bio *bio, 46*80f78409SXiaoming Ni int offset, int length, struct squashfs_page_actor *output); 47*80f78409SXiaoming Ni int (*max_decompressors)(void); 48*80f78409SXiaoming Ni }; 49*80f78409SXiaoming Ni 50*80f78409SXiaoming Ni #ifdef CONFIG_SQUASHFS_DECOMP_SINGLE 51*80f78409SXiaoming Ni extern const struct squashfs_decompressor_thread_ops squashfs_decompressor_single; 52*80f78409SXiaoming Ni #endif 53*80f78409SXiaoming Ni #ifdef CONFIG_SQUASHFS_DECOMP_MULTI 54*80f78409SXiaoming Ni extern const struct squashfs_decompressor_thread_ops squashfs_decompressor_multi; 55*80f78409SXiaoming Ni #endif 56*80f78409SXiaoming Ni #ifdef CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU 57*80f78409SXiaoming Ni extern const struct squashfs_decompressor_thread_ops squashfs_decompressor_percpu; 58*80f78409SXiaoming Ni #endif 594c0f0bb2SPhillip Lougher 60ffae2cd7SPhillip Lougher /* export.c */ 61ac51a0a7SPhillip Lougher extern __le64 *squashfs_read_inode_lookup_table(struct super_block *, u64, u64, 62ffae2cd7SPhillip Lougher unsigned int); 63ffae2cd7SPhillip Lougher 64ffae2cd7SPhillip Lougher /* fragment.c */ 65ffae2cd7SPhillip Lougher extern int squashfs_frag_lookup(struct super_block *, unsigned int, u64 *); 66ffae2cd7SPhillip Lougher extern __le64 *squashfs_read_fragment_index_table(struct super_block *, 671cac63ccSPhillip Lougher u64, u64, unsigned int); 68ffae2cd7SPhillip Lougher 695f55dbc0SPhillip Lougher /* file.c */ 70cdbb65c4SLinus Torvalds void squashfs_fill_page(struct page *, struct squashfs_cache_entry *, int, int); 715f55dbc0SPhillip Lougher void squashfs_copy_cache(struct page *, struct squashfs_cache_entry *, int, 725f55dbc0SPhillip Lougher int); 735f55dbc0SPhillip Lougher 745f55dbc0SPhillip Lougher /* file_xxx.c */ 75a3f94cb9SPhillip Lougher extern int squashfs_readpage_block(struct page *, u64, int, int); 765f55dbc0SPhillip Lougher 77ffae2cd7SPhillip Lougher /* id.c */ 78ffae2cd7SPhillip Lougher extern int squashfs_get_id(struct super_block *, unsigned int, unsigned int *); 7937986f63SPhillip Lougher extern __le64 *squashfs_read_id_index_table(struct super_block *, u64, u64, 80ffae2cd7SPhillip Lougher unsigned short); 81ffae2cd7SPhillip Lougher 82ffae2cd7SPhillip Lougher /* inode.c */ 83ffae2cd7SPhillip Lougher extern struct inode *squashfs_iget(struct super_block *, long long, 84ffae2cd7SPhillip Lougher unsigned int); 85ffae2cd7SPhillip Lougher extern int squashfs_read_inode(struct inode *, long long); 86ffae2cd7SPhillip Lougher 8767f66cc6SPhillip Lougher /* xattr.c */ 8867f66cc6SPhillip Lougher extern ssize_t squashfs_listxattr(struct dentry *, char *, size_t); 8967f66cc6SPhillip Lougher 90ffae2cd7SPhillip Lougher /* 9167f66cc6SPhillip Lougher * Inodes, files, decompressor and xattr operations 92ffae2cd7SPhillip Lougher */ 93ffae2cd7SPhillip Lougher 94ffae2cd7SPhillip Lougher /* dir.c */ 95ffae2cd7SPhillip Lougher extern const struct file_operations squashfs_dir_ops; 96ffae2cd7SPhillip Lougher 97ffae2cd7SPhillip Lougher /* export.c */ 98ffae2cd7SPhillip Lougher extern const struct export_operations squashfs_export_ops; 99ffae2cd7SPhillip Lougher 100ffae2cd7SPhillip Lougher /* file.c */ 101ffae2cd7SPhillip Lougher extern const struct address_space_operations squashfs_aops; 102ffae2cd7SPhillip Lougher 10367f66cc6SPhillip Lougher /* inode.c */ 10467f66cc6SPhillip Lougher extern const struct inode_operations squashfs_inode_ops; 10567f66cc6SPhillip Lougher 106ffae2cd7SPhillip Lougher /* namei.c */ 107ffae2cd7SPhillip Lougher extern const struct inode_operations squashfs_dir_inode_ops; 108ffae2cd7SPhillip Lougher 109ffae2cd7SPhillip Lougher /* symlink.c */ 110ffae2cd7SPhillip Lougher extern const struct address_space_operations squashfs_symlink_aops; 11167f66cc6SPhillip Lougher extern const struct inode_operations squashfs_symlink_inode_ops; 11267f66cc6SPhillip Lougher 11367f66cc6SPhillip Lougher /* xattr.c */ 114f6db25a8SPhillip Lougher extern const struct xattr_handler *squashfs_xattr_handlers[]; 115