2 * Squashfs - a compressed read only filesystem for Linux
4 * Copyright (c) 2002, 2003, 2004, 2005, 2006
5 * Phillip Lougher <phillip@lougher.demon.co.uk>
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.
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.
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.
24 #ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY
25 #undef CONFIG_SQUASHFS_1_0_COMPATIBILITY
28 #define TRACE(s, args...) printk(KERN_NOTICE "SQUASHFS: "s, ## args)
30 #define TRACE(s, args...) {}
33 #define ERROR(s, args...) printk(KERN_ERR "SQUASHFS error: "s, ## args)
35 #define SERROR(s, args...) do { \
37 printk(KERN_ERR "SQUASHFS error: "s, ## args);\
40 #define WARNING(s, args...) printk(KERN_WARNING "SQUASHFS: "s, ## args)
42 #define SQUASHFS_I(INO) (&INO->u.squashfs_i)
44 #define i_size_read(INO) (INO->i_size)
46 #if defined(CONFIG_SQUASHFS_1_0_COMPATIBILITY ) || defined(CONFIG_SQUASHFS_2_0_COMPATIBILITY)
48 extern unsigned int squashfs_read_data(struct super_block
*s
, char *buffer
,
49 long long index
, unsigned int length
,
50 long long *next_index
);
51 extern int squashfs_get_cached_block(struct super_block
*s
, char *buffer
,
52 long long block
, unsigned int offset
,
53 int length
, long long *next_block
,
54 unsigned int *next_offset
);
55 extern void release_cached_fragment(struct squashfs_sb_info
*msblk
, struct
56 squashfs_fragment_cache
*fragment
);
57 extern struct squashfs_fragment_cache
*get_cached_fragment(struct super_block
58 *s
, long long start_block
,
60 extern struct address_space_operations squashfs_symlink_aops
;
61 extern struct address_space_operations squashfs_aops
;
62 extern struct address_space_operations squashfs_aops_4K
;
63 extern struct file_operations squashfs_dir_ops
;
64 extern struct inode_operations squashfs_dir_inode_ops
;
66 #define SQSH_EXTERN static
69 #ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY
70 extern int squashfs_1_0_supported(struct squashfs_sb_info
*msblk
);
72 static inline int squashfs_1_0_supported(struct squashfs_sb_info
*msblk
)
78 #ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY
79 extern int squashfs_2_0_supported(struct squashfs_sb_info
*msblk
);
81 static inline int squashfs_2_0_supported(struct squashfs_sb_info
*msblk
)