squashfs.h revision 71a512f2b0694f61a401c4147010d092a3f46fdb
1/* 2 * Squashfs - a compressed read only filesystem for Linux 3 * 4 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 5 * Phillip Lougher <phillip@lougher.demon.co.uk> 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2, 10 * or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 * 21 * squashfs.h 22 */ 23 24#ifdef SQUASHFS_TRACE 25#define TRACE(s, args...) printk(KERN_NOTICE "SQUASHFS: "s, ## args) 26#else 27#define TRACE(s, args...) {} 28#endif 29 30#define ERROR(s, args...) printk(KERN_ERR "SQUASHFS error: "s, ## args) 31 32#define SERROR(s, args...) \ 33 do { \ 34 if (!silent) \ 35 printk(KERN_ERR "SQUASHFS error: "s, ## args);\ 36 } while (0) 37 38#define WARNING(s, args...) printk(KERN_WARNING "SQUASHFS: "s, ## args) 39 40static inline struct squashfs_inode_info *SQUASHFS_I(struct inode *inode) 41{ 42 return list_entry(inode, struct squashfs_inode_info, vfs_inode); 43} 44 45/* block.c */ 46extern unsigned int squashfs_read_data(struct super_block *, void *, 47 long long, unsigned int, long long *, int); 48 49/* cache.c */ 50extern struct squashfs_cache *squashfs_cache_init(char *, int, int, int); 51extern void squashfs_cache_delete(struct squashfs_cache *); 52extern int squashfs_read_metadata(struct super_block *, void *, 53 long long, unsigned int, int, long long *, 54 unsigned int *); 55extern struct squashfs_cache_entry *get_cached_fragment(struct super_block *, 56 long long, int); 57extern void release_cached_fragment(struct squashfs_sb_info *, 58 struct squashfs_cache_entry *); 59 60/* export.c */ 61extern __le64 *read_inode_lookup_table(struct super_block *, long long, 62 unsigned int); 63 64/* fragment.c */ 65extern int get_fragment_location(struct super_block *, unsigned int, 66 long long *); 67extern __le64 *read_fragment_index_table(struct super_block *, long long, 68 unsigned int); 69 70/* id.c */ 71extern int get_id(struct super_block *, unsigned int, unsigned int *); 72extern __le64 *read_id_index_table(struct super_block *, long long, 73 unsigned short); 74 75/* inode.c */ 76extern struct inode *squashfs_iget(struct super_block *, long long, 77 unsigned int); 78extern int squashfs_read_inode(struct inode *, long long); 79 80/* 81 * Inodes and files operations 82 */ 83 84/* dir.c */ 85extern const struct file_operations squashfs_dir_ops; 86 87/* export.c */ 88extern const struct export_operations squashfs_export_ops; 89 90/* file.c */ 91extern const struct address_space_operations squashfs_aops; 92 93/* namei.c */ 94extern const struct inode_operations squashfs_dir_inode_ops; 95 96/* symlink.c */ 97extern const struct address_space_operations squashfs_symlink_aops; 98