Go to the documentation of this file.
26 #define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE
27 #define SQUASHFS_MAJOR 4
28 #define SQUASHFS_MINOR 0
29 #define SQUASHFS_START 0
32 #define SQUASHFS_METADATA_SIZE 8192
35 #ifdef CONFIG_SQUASHFS_4K_DEVBLK_SIZE
36 #define SQUASHFS_DEVBLK_SIZE 4096
38 #define SQUASHFS_DEVBLK_SIZE 1024
41 #define SQUASHFS_FILE_MAX_SIZE 1048576
42 #define SQUASHFS_FILE_MAX_LOG 20
45 #define SQUASHFS_NAME_LEN 256
48 #define SQUASHFS_DIR_COUNT 256
50 #define SQUASHFS_INVALID_FRAG (0xffffffffU)
51 #define SQUASHFS_INVALID_XATTR (0xffffffffU)
52 #define SQUASHFS_INVALID_BLK (-1LL)
55 #define SQUASHFS_NOI 0
56 #define SQUASHFS_NOD 1
57 #define SQUASHFS_NOF 3
58 #define SQUASHFS_NO_FRAG 4
59 #define SQUASHFS_ALWAYS_FRAG 5
60 #define SQUASHFS_DUPLICATE 6
61 #define SQUASHFS_EXPORT 7
62 #define SQUASHFS_COMP_OPT 10
64 #define SQUASHFS_BIT(flag, bit) ((flag >> bit) & 1)
66 #define SQUASHFS_UNCOMPRESSED_INODES(flags) SQUASHFS_BIT(flags, \
69 #define SQUASHFS_UNCOMPRESSED_DATA(flags) SQUASHFS_BIT(flags, \
72 #define SQUASHFS_UNCOMPRESSED_FRAGMENTS(flags) SQUASHFS_BIT(flags, \
75 #define SQUASHFS_NO_FRAGMENTS(flags) SQUASHFS_BIT(flags, \
78 #define SQUASHFS_ALWAYS_FRAGMENTS(flags) SQUASHFS_BIT(flags, \
81 #define SQUASHFS_DUPLICATES(flags) SQUASHFS_BIT(flags, \
84 #define SQUASHFS_EXPORTABLE(flags) SQUASHFS_BIT(flags, \
87 #define SQUASHFS_COMP_OPTS(flags) SQUASHFS_BIT(flags, \
91 #define SQUASHFS_DIR_TYPE 1
92 #define SQUASHFS_REG_TYPE 2
93 #define SQUASHFS_SYMLINK_TYPE 3
94 #define SQUASHFS_BLKDEV_TYPE 4
95 #define SQUASHFS_CHRDEV_TYPE 5
96 #define SQUASHFS_FIFO_TYPE 6
97 #define SQUASHFS_SOCKET_TYPE 7
98 #define SQUASHFS_LDIR_TYPE 8
99 #define SQUASHFS_LREG_TYPE 9
100 #define SQUASHFS_LSYMLINK_TYPE 10
101 #define SQUASHFS_LBLKDEV_TYPE 11
102 #define SQUASHFS_LCHRDEV_TYPE 12
103 #define SQUASHFS_LFIFO_TYPE 13
104 #define SQUASHFS_LSOCKET_TYPE 14
107 #define SQUASHFS_XATTR_USER 0
108 #define SQUASHFS_XATTR_TRUSTED 1
109 #define SQUASHFS_XATTR_SECURITY 2
110 #define SQUASHFS_XATTR_VALUE_OOL 256
111 #define SQUASHFS_XATTR_PREFIX_MASK 0xff
115 #define SQUASHFS_COMPRESSED_BIT (1 << 15)
117 #define SQUASHFS_COMPRESSED_SIZE(B) (((B) & ~SQUASHFS_COMPRESSED_BIT) ? \
118 (B) & ~SQUASHFS_COMPRESSED_BIT : SQUASHFS_COMPRESSED_BIT)
120 #define SQUASHFS_COMPRESSED(B) (!((B) & SQUASHFS_COMPRESSED_BIT))
122 #define SQUASHFS_COMPRESSED_BIT_BLOCK (1 << 24)
124 #define SQUASHFS_COMPRESSED_SIZE_BLOCK(B) ((B) & \
125 ~SQUASHFS_COMPRESSED_BIT_BLOCK)
127 #define SQUASHFS_COMPRESSED_BLOCK(B) (!((B) & SQUASHFS_COMPRESSED_BIT_BLOCK))
133 #define SQUASHFS_INODE_BLK(A) ((unsigned int) ((A) >> 16))
135 #define SQUASHFS_INODE_OFFSET(A) ((unsigned int) ((A) & 0xffff))
137 #define SQUASHFS_MKINODE(A, B) ((long long)(((long long) (A)\
141 #define SQUASHFS_FRAGMENT_BYTES(A) \
142 ((A) * sizeof(struct squashfs_fragment_entry))
144 #define SQUASHFS_FRAGMENT_INDEX(A) (SQUASHFS_FRAGMENT_BYTES(A) / \
145 SQUASHFS_METADATA_SIZE)
147 #define SQUASHFS_FRAGMENT_INDEX_OFFSET(A) (SQUASHFS_FRAGMENT_BYTES(A) % \
148 SQUASHFS_METADATA_SIZE)
150 #define SQUASHFS_FRAGMENT_INDEXES(A) ((SQUASHFS_FRAGMENT_BYTES(A) + \
151 SQUASHFS_METADATA_SIZE - 1) / \
152 SQUASHFS_METADATA_SIZE)
154 #define SQUASHFS_FRAGMENT_INDEX_BYTES(A) (SQUASHFS_FRAGMENT_INDEXES(A) *\
158 #define SQUASHFS_LOOKUP_BYTES(A) ((A) * sizeof(u64))
160 #define SQUASHFS_LOOKUP_BLOCK(A) (SQUASHFS_LOOKUP_BYTES(A) / \
161 SQUASHFS_METADATA_SIZE)
163 #define SQUASHFS_LOOKUP_BLOCK_OFFSET(A) (SQUASHFS_LOOKUP_BYTES(A) % \
164 SQUASHFS_METADATA_SIZE)
166 #define SQUASHFS_LOOKUP_BLOCKS(A) ((SQUASHFS_LOOKUP_BYTES(A) + \
167 SQUASHFS_METADATA_SIZE - 1) / \
168 SQUASHFS_METADATA_SIZE)
170 #define SQUASHFS_LOOKUP_BLOCK_BYTES(A) (SQUASHFS_LOOKUP_BLOCKS(A) *\
174 #define SQUASHFS_ID_BYTES(A) ((A) * sizeof(unsigned int))
176 #define SQUASHFS_ID_BLOCK(A) (SQUASHFS_ID_BYTES(A) / \
177 SQUASHFS_METADATA_SIZE)
179 #define SQUASHFS_ID_BLOCK_OFFSET(A) (SQUASHFS_ID_BYTES(A) % \
180 SQUASHFS_METADATA_SIZE)
182 #define SQUASHFS_ID_BLOCKS(A) ((SQUASHFS_ID_BYTES(A) + \
183 SQUASHFS_METADATA_SIZE - 1) / \
184 SQUASHFS_METADATA_SIZE)
186 #define SQUASHFS_ID_BLOCK_BYTES(A) (SQUASHFS_ID_BLOCKS(A) *\
189 #define SQUASHFS_XATTR_BYTES(A) ((A) * sizeof(struct squashfs_xattr_id))
191 #define SQUASHFS_XATTR_BLOCK(A) (SQUASHFS_XATTR_BYTES(A) / \
192 SQUASHFS_METADATA_SIZE)
194 #define SQUASHFS_XATTR_BLOCK_OFFSET(A) (SQUASHFS_XATTR_BYTES(A) % \
195 SQUASHFS_METADATA_SIZE)
197 #define SQUASHFS_XATTR_BLOCKS(A) ((SQUASHFS_XATTR_BYTES(A) + \
198 SQUASHFS_METADATA_SIZE - 1) / \
199 SQUASHFS_METADATA_SIZE)
201 #define SQUASHFS_XATTR_BLOCK_BYTES(A) (SQUASHFS_XATTR_BLOCKS(A) *\
203 #define SQUASHFS_XATTR_BLK(A) ((unsigned int) ((A) >> 16))
205 #define SQUASHFS_XATTR_OFFSET(A) ((unsigned int) ((A) & 0xffff))
208 #define SQUASHFS_CACHED_BLKS 8
211 #define SQUASHFS_META_INDEXES (SQUASHFS_METADATA_SIZE / sizeof(unsigned int))
212 #define SQUASHFS_META_ENTRIES 127
213 #define SQUASHFS_META_SLOTS 8
236 #define ZLIB_COMPRESSION 1
237 #define LZMA_COMPRESSION 2
238 #define LZO_COMPRESSION 3
239 #define XZ_COMPRESSION 4