source: src/linux/universal/linux-4.9/fs/squashfs-dd/squashfs.h @ 31630

Last change on this file since 31630 was 31630, checked in by brainslayer, 5 months ago

new fs is compatible with standard squashfs, just smaller

File size: 2.9 KB
Line 
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#ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY
28#undef CONFIG_SQUASHFS_2_0_COMPATIBILITY
29#endif
30
31#ifdef SQUASHFS_TRACE
32#define TRACE(s, args...)       pr_debug("SQUASHFS: "s, ## args)
33#else
34#define TRACE(s, args...)       {}
35#endif
36
37#define ERROR(s, args...)       pr_err("SQUASHFS error: "s, ## args)
38
39#define SERROR(s, args...)      do { \
40                                if (!silent) \
41                                printk(KERN_ERR "SQUASHFS error: "s, ## args);\
42                                } while(0)
43
44#define WARNING(s, args...)     pr_warn("SQUASHFS: "s, ## args)
45
46static inline struct squashfs_inode_info *SQUASHFS_I(struct inode *inode)
47{
48        return list_entry(inode, struct squashfs_inode_info, vfs_inode);
49}
50
51#if defined(CONFIG_SQUASHFS_1_0_COMPATIBILITY ) || defined(CONFIG_SQUASHFS_2_0_COMPATIBILITY)
52#define SQSH_EXTERN
53extern unsigned int squashfs_read_data(struct super_block *s, char *buffer,
54                                long long index, unsigned int length,
55                                long long *next_index);
56extern int squashfs_get_cached_block(struct super_block *s, char *buffer,
57                                long long block, unsigned int offset,
58                                int length, long long *next_block,
59                                unsigned int *next_offset);
60extern void release_cached_fragment(struct squashfs_sb_info *msblk, struct
61                                        squashfs_fragment_cache *fragment);
62extern struct squashfs_fragment_cache *get_cached_fragment(struct super_block
63                                        *s, long long start_block,
64                                        int length);
65extern struct address_space_operations squashfs_symlink_aops;
66extern struct address_space_operations squashfs_aops;
67extern struct address_space_operations squashfs_aops_4K;
68extern struct inode_operations squashfs_dir_inode_ops;
69#else
70#define SQSH_EXTERN static
71#endif
72
73#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY
74extern int squashfs_1_0_supported(struct squashfs_sb_info *msblk);
75#else
76static inline int squashfs_1_0_supported(struct squashfs_sb_info *msblk)
77{
78        return 0;
79}
80#endif
81
82#ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY
83extern int squashfs_2_0_supported(struct squashfs_sb_info *msblk);
84#else
85static inline int squashfs_2_0_supported(struct squashfs_sb_info *msblk)
86{
87        return 0;
88}
89#endif
Note: See TracBrowser for help on using the repository browser.