Thomas Gleixner | 68252eb | 2019-05-20 19:08:00 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Phillip Lougher | ffae2cd | 2009-01-05 08:46:27 +0000 | [diff] [blame] | 2 | #ifndef SQUASHFS_FS_SB |
| 3 | #define SQUASHFS_FS_SB |
| 4 | /* |
| 5 | * Squashfs |
| 6 | * |
| 7 | * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 |
Phillip Lougher | d7f2ff6 | 2011-05-26 10:39:56 +0100 | [diff] [blame] | 8 | * Phillip Lougher <phillip@squashfs.org.uk> |
Phillip Lougher | ffae2cd | 2009-01-05 08:46:27 +0000 | [diff] [blame] | 9 | * |
Phillip Lougher | ffae2cd | 2009-01-05 08:46:27 +0000 | [diff] [blame] | 10 | * squashfs_fs_sb.h |
| 11 | */ |
| 12 | |
| 13 | #include "squashfs_fs.h" |
| 14 | |
| 15 | struct squashfs_cache { |
| 16 | char *name; |
| 17 | int entries; |
Ajeet Yadav | d7fbd89 | 2011-12-27 15:10:04 +0530 | [diff] [blame] | 18 | int curr_blk; |
Phillip Lougher | ffae2cd | 2009-01-05 08:46:27 +0000 | [diff] [blame] | 19 | int next_blk; |
| 20 | int num_waiters; |
| 21 | int unused; |
| 22 | int block_size; |
| 23 | int pages; |
| 24 | spinlock_t lock; |
| 25 | wait_queue_head_t wait_queue; |
| 26 | struct squashfs_cache_entry *entry; |
| 27 | }; |
| 28 | |
| 29 | struct squashfs_cache_entry { |
| 30 | u64 block; |
| 31 | int length; |
| 32 | int refcount; |
| 33 | u64 next_index; |
| 34 | int pending; |
| 35 | int error; |
| 36 | int num_waiters; |
| 37 | wait_queue_head_t wait_queue; |
| 38 | struct squashfs_cache *cache; |
| 39 | void **data; |
Phillip Lougher | 846b730 | 2013-11-18 02:59:12 +0000 | [diff] [blame] | 40 | struct squashfs_page_actor *actor; |
Phillip Lougher | ffae2cd | 2009-01-05 08:46:27 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | struct squashfs_sb_info { |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 44 | const struct squashfs_decompressor *decompressor; |
| 45 | int devblksize; |
| 46 | int devblksize_log2; |
| 47 | struct squashfs_cache *block_cache; |
| 48 | struct squashfs_cache *fragment_cache; |
| 49 | struct squashfs_cache *read_page; |
| 50 | int next_meta_index; |
| 51 | __le64 *id_table; |
| 52 | __le64 *fragment_index; |
Phillip Lougher | 4b5397d | 2010-05-14 20:48:47 +0100 | [diff] [blame] | 53 | __le64 *xattr_id_table; |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 54 | struct mutex meta_index_mutex; |
| 55 | struct meta_index *meta_index; |
Phillip Lougher | 9508c6b | 2013-11-13 02:56:26 +0000 | [diff] [blame] | 56 | struct squashfs_stream *stream; |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 57 | __le64 *inode_lookup_table; |
| 58 | u64 inode_table; |
| 59 | u64 directory_table; |
Phillip Lougher | 4b5397d | 2010-05-14 20:48:47 +0100 | [diff] [blame] | 60 | u64 xattr_table; |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 61 | unsigned int block_size; |
| 62 | unsigned short block_log; |
| 63 | long long bytes_used; |
| 64 | unsigned int inodes; |
Linus Torvalds | 71755ee | 2018-08-02 08:43:35 -0700 | [diff] [blame] | 65 | unsigned int fragments; |
Phillip Lougher | 4b5397d | 2010-05-14 20:48:47 +0100 | [diff] [blame] | 66 | int xattr_ids; |
Phillip Lougher | f37aa4c | 2021-02-09 13:41:53 -0800 | [diff] [blame] | 67 | unsigned int ids; |
Vincent Whitchurch | 10dde05 | 2021-06-28 19:33:55 -0700 | [diff] [blame] | 68 | bool panic_on_errors; |
Phillip Lougher | ffae2cd | 2009-01-05 08:46:27 +0000 | [diff] [blame] | 69 | }; |
| 70 | #endif |