Home | History | Annotate | Download | only in linux
      1 #ifndef SQUASHFS_FS_SB
      2 #define SQUASHFS_FS_SB
      3 /*
      4  * Squashfs
      5  *
      6  * Copyright (c) 2002, 2003, 2004, 2005, 2006
      7  * Phillip Lougher <phillip (at) 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     22  *
     23  * squashfs_fs_sb.h
     24  */
     25 
     26 #include <linux/squashfs_fs.h>
     27 #include <linux/zlib.h>
     28 
     29 struct squashfs_cache {
     30 	long long	block;
     31 	int		length;
     32 	long long	next_index;
     33 	char		*data;
     34 };
     35 
     36 struct squashfs_fragment_cache {
     37 	long long	block;
     38 	int		length;
     39 	unsigned int	locked;
     40 	char		*data;
     41 };
     42 
     43 struct squashfs_sb_info {
     44 	struct squashfs_super_block	sblk;
     45 	int			devblksize;
     46 	int			devblksize_log2;
     47 	int			swap;
     48 	struct squashfs_cache	*block_cache;
     49 	struct squashfs_fragment_cache	*fragment;
     50 	int			next_cache;
     51 	int			next_fragment;
     52 	int			next_meta_index;
     53 	unsigned int		*uid;
     54 	unsigned int		*guid;
     55 	long long		*fragment_index;
     56 	unsigned int		*fragment_index_2;
     57 	unsigned int		read_size;
     58 	char			*read_data;
     59 	char			*read_page;
     60 	struct semaphore	read_data_mutex;
     61 	struct semaphore	read_page_mutex;
     62 	struct semaphore	block_cache_mutex;
     63 	struct semaphore	fragment_mutex;
     64 	struct semaphore	meta_index_mutex;
     65 	wait_queue_head_t	waitq;
     66 	wait_queue_head_t	fragment_wait_queue;
     67 	struct meta_index	*meta_index;
     68 	z_stream		stream;
     69 	struct inode		*(*iget)(struct super_block *s,  squashfs_inode_t
     70 				inode);
     71 	long long		(*read_blocklist)(struct inode *inode, int
     72 				index, int readahead_blks, char *block_list,
     73 				unsigned short **block_p, unsigned int *bsize);
     74 	int			(*read_fragment_index_table)(struct super_block *s);
     75 };
     76 #endif
     77