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