Lines Matching refs:msblk
89 struct squashfs_sb_info *msblk; in squashfs_fill_super() local
113 sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL); in squashfs_fill_super()
118 msblk = sb->s_fs_info; in squashfs_fill_super()
120 msblk->devblksize = sb_min_blocksize(sb, SQUASHFS_DEVBLK_SIZE); in squashfs_fill_super()
121 msblk->devblksize_log2 = ffz(~msblk->devblksize); in squashfs_fill_super()
123 mutex_init(&msblk->meta_index_mutex); in squashfs_fill_super()
131 msblk->bytes_used = sizeof(*sblk); in squashfs_fill_super()
153 msblk->decompressor = supported_squashfs_filesystem( in squashfs_fill_super()
158 if (msblk->decompressor == NULL) in squashfs_fill_super()
163 msblk->bytes_used = le64_to_cpu(sblk->bytes_used); in squashfs_fill_super()
164 if (msblk->bytes_used < 0 || msblk->bytes_used > in squashfs_fill_super()
169 msblk->block_size = le32_to_cpu(sblk->block_size); in squashfs_fill_super()
170 if (msblk->block_size > SQUASHFS_FILE_MAX_SIZE) in squashfs_fill_super()
177 if (PAGE_SIZE > msblk->block_size) { in squashfs_fill_super()
179 "currently not supported!", msblk->block_size); in squashfs_fill_super()
184 msblk->block_log = le16_to_cpu(sblk->block_log); in squashfs_fill_super()
185 if (msblk->block_log > SQUASHFS_FILE_MAX_LOG) in squashfs_fill_super()
189 if (msblk->block_size != (1 << msblk->block_log)) in squashfs_fill_super()
197 msblk->inode_table = le64_to_cpu(sblk->inode_table_start); in squashfs_fill_super()
198 msblk->directory_table = le64_to_cpu(sblk->directory_table_start); in squashfs_fill_super()
199 msblk->inodes = le32_to_cpu(sblk->inodes); in squashfs_fill_super()
200 msblk->fragments = le32_to_cpu(sblk->fragments); in squashfs_fill_super()
201 msblk->ids = le16_to_cpu(sblk->no_ids); in squashfs_fill_super()
209 TRACE("Filesystem size %lld bytes\n", msblk->bytes_used); in squashfs_fill_super()
210 TRACE("Block size %d\n", msblk->block_size); in squashfs_fill_super()
211 TRACE("Number of inodes %d\n", msblk->inodes); in squashfs_fill_super()
212 TRACE("Number of fragments %d\n", msblk->fragments); in squashfs_fill_super()
213 TRACE("Number of ids %d\n", msblk->ids); in squashfs_fill_super()
214 TRACE("sblk->inode_table_start %llx\n", msblk->inode_table); in squashfs_fill_super()
215 TRACE("sblk->directory_table_start %llx\n", msblk->directory_table); in squashfs_fill_super()
229 msblk->block_cache = squashfs_cache_init("metadata", in squashfs_fill_super()
231 if (msblk->block_cache == NULL) in squashfs_fill_super()
235 msblk->read_page = squashfs_cache_init("data", in squashfs_fill_super()
236 squashfs_max_decompressors(), msblk->block_size); in squashfs_fill_super()
237 if (msblk->read_page == NULL) { in squashfs_fill_super()
242 msblk->stream = squashfs_decompressor_setup(sb, flags); in squashfs_fill_super()
243 if (IS_ERR(msblk->stream)) { in squashfs_fill_super()
244 err = PTR_ERR(msblk->stream); in squashfs_fill_super()
245 msblk->stream = NULL; in squashfs_fill_super()
253 next_table = msblk->bytes_used; in squashfs_fill_super()
258 msblk->xattr_id_table = squashfs_read_xattr_id_table(sb, in squashfs_fill_super()
259 xattr_id_table_start, &msblk->xattr_table, &msblk->xattr_ids); in squashfs_fill_super()
260 if (IS_ERR(msblk->xattr_id_table)) { in squashfs_fill_super()
262 err = PTR_ERR(msblk->xattr_id_table); in squashfs_fill_super()
263 msblk->xattr_id_table = NULL; in squashfs_fill_super()
267 next_table = msblk->xattr_table; in squashfs_fill_super()
271 msblk->id_table = squashfs_read_id_index_table(sb, in squashfs_fill_super()
272 le64_to_cpu(sblk->id_table_start), next_table, msblk->ids); in squashfs_fill_super()
273 if (IS_ERR(msblk->id_table)) { in squashfs_fill_super()
275 err = PTR_ERR(msblk->id_table); in squashfs_fill_super()
276 msblk->id_table = NULL; in squashfs_fill_super()
279 next_table = le64_to_cpu(msblk->id_table[0]); in squashfs_fill_super()
287 msblk->inode_lookup_table = squashfs_read_inode_lookup_table(sb, in squashfs_fill_super()
288 lookup_table_start, next_table, msblk->inodes); in squashfs_fill_super()
289 if (IS_ERR(msblk->inode_lookup_table)) { in squashfs_fill_super()
291 err = PTR_ERR(msblk->inode_lookup_table); in squashfs_fill_super()
292 msblk->inode_lookup_table = NULL; in squashfs_fill_super()
295 next_table = le64_to_cpu(msblk->inode_lookup_table[0]); in squashfs_fill_super()
300 fragments = msblk->fragments; in squashfs_fill_super()
304 msblk->fragment_cache = squashfs_cache_init("fragment", in squashfs_fill_super()
305 SQUASHFS_CACHED_FRAGMENTS, msblk->block_size); in squashfs_fill_super()
306 if (msblk->fragment_cache == NULL) { in squashfs_fill_super()
312 msblk->fragment_index = squashfs_read_fragment_index_table(sb, in squashfs_fill_super()
314 if (IS_ERR(msblk->fragment_index)) { in squashfs_fill_super()
316 err = PTR_ERR(msblk->fragment_index); in squashfs_fill_super()
317 msblk->fragment_index = NULL; in squashfs_fill_super()
320 next_table = le64_to_cpu(msblk->fragment_index[0]); in squashfs_fill_super()
324 if (msblk->directory_table > next_table) { in squashfs_fill_super()
330 if (msblk->inode_table >= msblk->directory_table) { in squashfs_fill_super()
364 squashfs_cache_delete(msblk->block_cache); in squashfs_fill_super()
365 squashfs_cache_delete(msblk->fragment_cache); in squashfs_fill_super()
366 squashfs_cache_delete(msblk->read_page); in squashfs_fill_super()
367 squashfs_decompressor_destroy(msblk); in squashfs_fill_super()
368 kfree(msblk->inode_lookup_table); in squashfs_fill_super()
369 kfree(msblk->fragment_index); in squashfs_fill_super()
370 kfree(msblk->id_table); in squashfs_fill_super()
371 kfree(msblk->xattr_id_table); in squashfs_fill_super()
403 struct squashfs_sb_info *msblk = dentry->d_sb->s_fs_info; in squashfs_statfs() local
409 buf->f_bsize = msblk->block_size; in squashfs_statfs()
410 buf->f_blocks = ((msblk->bytes_used - 1) >> msblk->block_log) + 1; in squashfs_statfs()
412 buf->f_files = msblk->inodes; in squashfs_statfs()