168252eb5SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 2ffae2cd7SPhillip Lougher #ifndef SQUASHFS_FS_SB 3ffae2cd7SPhillip Lougher #define SQUASHFS_FS_SB 4ffae2cd7SPhillip Lougher /* 5ffae2cd7SPhillip Lougher * Squashfs 6ffae2cd7SPhillip Lougher * 7ffae2cd7SPhillip Lougher * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 8d7f2ff67SPhillip Lougher * Phillip Lougher <phillip@squashfs.org.uk> 9ffae2cd7SPhillip Lougher * 10ffae2cd7SPhillip Lougher * squashfs_fs_sb.h 11ffae2cd7SPhillip Lougher */ 12ffae2cd7SPhillip Lougher 13ffae2cd7SPhillip Lougher #include "squashfs_fs.h" 14ffae2cd7SPhillip Lougher 15ffae2cd7SPhillip Lougher struct squashfs_cache { 16ffae2cd7SPhillip Lougher char *name; 17ffae2cd7SPhillip Lougher int entries; 18d7fbd893SAjeet Yadav int curr_blk; 19ffae2cd7SPhillip Lougher int next_blk; 20ffae2cd7SPhillip Lougher int num_waiters; 21ffae2cd7SPhillip Lougher int unused; 22ffae2cd7SPhillip Lougher int block_size; 23ffae2cd7SPhillip Lougher int pages; 24ffae2cd7SPhillip Lougher spinlock_t lock; 25ffae2cd7SPhillip Lougher wait_queue_head_t wait_queue; 26ffae2cd7SPhillip Lougher struct squashfs_cache_entry *entry; 27ffae2cd7SPhillip Lougher }; 28ffae2cd7SPhillip Lougher 29ffae2cd7SPhillip Lougher struct squashfs_cache_entry { 30ffae2cd7SPhillip Lougher u64 block; 31ffae2cd7SPhillip Lougher int length; 32ffae2cd7SPhillip Lougher int refcount; 33ffae2cd7SPhillip Lougher u64 next_index; 34ffae2cd7SPhillip Lougher int pending; 35ffae2cd7SPhillip Lougher int error; 36ffae2cd7SPhillip Lougher int num_waiters; 37ffae2cd7SPhillip Lougher wait_queue_head_t wait_queue; 38ffae2cd7SPhillip Lougher struct squashfs_cache *cache; 39ffae2cd7SPhillip Lougher void **data; 40846b730eSPhillip Lougher struct squashfs_page_actor *actor; 41ffae2cd7SPhillip Lougher }; 42ffae2cd7SPhillip Lougher 43ffae2cd7SPhillip Lougher struct squashfs_sb_info { 444c0f0bb2SPhillip Lougher const struct squashfs_decompressor *decompressor; 45ffae2cd7SPhillip Lougher int devblksize; 46ffae2cd7SPhillip Lougher int devblksize_log2; 47ffae2cd7SPhillip Lougher struct squashfs_cache *block_cache; 48ffae2cd7SPhillip Lougher struct squashfs_cache *fragment_cache; 49ffae2cd7SPhillip Lougher struct squashfs_cache *read_page; 50*e994f5b6SVincent Whitchurch struct address_space *cache_mapping; 51ffae2cd7SPhillip Lougher int next_meta_index; 52ffae2cd7SPhillip Lougher __le64 *id_table; 53ffae2cd7SPhillip Lougher __le64 *fragment_index; 544b5397dcSPhillip Lougher __le64 *xattr_id_table; 55ffae2cd7SPhillip Lougher struct mutex meta_index_mutex; 56ffae2cd7SPhillip Lougher struct meta_index *meta_index; 5780f78409SXiaoming Ni void *stream; 58ffae2cd7SPhillip Lougher __le64 *inode_lookup_table; 59ffae2cd7SPhillip Lougher u64 inode_table; 60ffae2cd7SPhillip Lougher u64 directory_table; 614b5397dcSPhillip Lougher u64 xattr_table; 62ffae2cd7SPhillip Lougher unsigned int block_size; 63ffae2cd7SPhillip Lougher unsigned short block_log; 64ffae2cd7SPhillip Lougher long long bytes_used; 65ffae2cd7SPhillip Lougher unsigned int inodes; 6671755ee5SLinus Torvalds unsigned int fragments; 67f65c4bbbSPhillip Lougher unsigned int xattr_ids; 68f37aa4c7SPhillip Lougher unsigned int ids; 6910dde05bSVincent Whitchurch bool panic_on_errors; 7080f78409SXiaoming Ni const struct squashfs_decompressor_thread_ops *thread_ops; 71fb40fe04SXiaoming Ni int max_thread_num; 72ffae2cd7SPhillip Lougher }; 73ffae2cd7SPhillip Lougher #endif 74