Merge to Fedora kernel-2.6.18-1.2257_FC5 patched with stable patch-2.6.18.5-vs2.0...
[linux-2.6.git] / fs / squashfs / squashfs.h
1 /*
2  * Squashfs - a compressed read only filesystem for Linux
3  *
4  * Copyright (c) 2002, 2003, 2004, 2005, 2006
5  * Phillip Lougher <phillip@lougher.org.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 CONFIG_SQUASHFS_1_0_COMPATIBILITY
25 #undef CONFIG_SQUASHFS_1_0_COMPATIBILITY
26 #endif
27
28 #ifdef SQUASHFS_TRACE
29 #define TRACE(s, args...)       printk(KERN_NOTICE "SQUASHFS: "s, ## args)
30 #else
31 #define TRACE(s, args...)       {}
32 #endif
33
34 #define ERROR(s, args...)       printk(KERN_NOTICE "SQUASHFS error: "s, ## args)
35
36 #define SERROR(s, args...)      do { \
37                                 if (!silent) \
38                                 printk(KERN_ERR "SQUASHFS error: "s, ## args);\
39                                 } while(0)
40
41 #define WARNING(s, args...)     printk(KERN_WARNING "SQUASHFS: "s, ## args)
42
43 static inline struct squashfs_inode_info *SQUASHFS_I(struct inode *inode)
44 {
45         return list_entry(inode, struct squashfs_inode_info, vfs_inode);
46 }
47
48 #if defined(CONFIG_SQUASHFS_1_0_COMPATIBILITY ) || defined(CONFIG_SQUASHFS_2_0_COMPATIBILITY)
49 #define SQSH_EXTERN
50 extern unsigned int squashfs_read_data(struct super_block *s, char *buffer,
51                                 long long index, unsigned int length,
52                                 long long *next_index, int srclength);
53 extern int squashfs_get_cached_block(struct super_block *s, char *buffer,
54                                 long long block, unsigned int offset,
55                                 int length, long long *next_block,
56                                 unsigned int *next_offset);
57 extern void release_cached_fragment(struct squashfs_sb_info *msblk, struct
58                                         squashfs_fragment_cache *fragment);
59 extern struct squashfs_fragment_cache *get_cached_fragment(struct super_block
60                                         *s, long long start_block,
61                                         int length);
62 extern struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode, unsigned int inode_number);
63 extern struct address_space_operations squashfs_symlink_aops;
64 extern struct address_space_operations squashfs_aops;
65 extern struct address_space_operations squashfs_aops_4K;
66 extern struct inode_operations squashfs_dir_inode_ops;
67 #else
68 #define SQSH_EXTERN static
69 #endif
70
71 #ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY
72 extern int squashfs_1_0_supported(struct squashfs_sb_info *msblk);
73 #else
74 static inline int squashfs_1_0_supported(struct squashfs_sb_info *msblk)
75 {
76         return 0;
77 }
78 #endif
79
80 #ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY
81 extern int squashfs_2_0_supported(struct squashfs_sb_info *msblk);
82 #else
83 static inline int squashfs_2_0_supported(struct squashfs_sb_info *msblk)
84 {
85         return 0;
86 }
87 #endif