1 #ifndef SQUASHFS_FS_SB
2 #define SQUASHFS_FS_SB
3 /*
4  * Squashfs
5  *
6  * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
7  * Phillip Lougher <phillip@lougher.demon.co.uk>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2,
12  * or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  *
23  * squashfs_fs_sb.h
24  */
25 
26 #include "squashfs_fs.h"
27 
28 struct squashfs_cache_entry {
29 	long long		block;
30 	int			length;
31 	int			locked;
32 	long long		next_index;
33 	char			pending;
34 	char			error;
35 	int			waiting;
36 	wait_queue_head_t	wait_queue;
37 	char			*data;
38 };
39 
40 struct squashfs_cache {
41 	char			*name;
42 	int			entries;
43 	int			block_size;
44 	int			next_blk;
45 	int			waiting;
46 	int			unused;
47 	int			use_vmalloc;
48 	spinlock_t		lock;
49 	wait_queue_head_t	wait_queue;
50 	struct squashfs_cache_entry entry[0];
51 };
52 
53 struct squashfs_sb_info {
54 	int			devblksize;
55 	int			devblksize_log2;
56 	struct squashfs_cache	*block_cache;
57 	struct squashfs_cache	*fragment_cache;
58 	int			next_meta_index;
59 	__le64			*id_table;
60 	__le64			*fragment_index;
61 	unsigned int		*fragment_index_2;
62 	char			*read_page;
63 	struct mutex		read_data_mutex;
64 	struct mutex		read_page_mutex;
65 	struct mutex		meta_index_mutex;
66 	struct meta_index	*meta_index;
67 	z_stream		stream;
68 	__le64			*inode_lookup_table;
69 	long long		inode_table;
70 	long long		directory_table;
71 	unsigned int		block_size;
72 	unsigned short		block_log;
73 	long long		bytes_used;
74 	unsigned int		inodes;
75 };
76 #endif
77