/src/barebox/fs/squashfs/squashfs.h
Line | Count | Source |
1 | | /* |
2 | | * Squashfs - a compressed read only filesystem for Linux |
3 | | * |
4 | | * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 |
5 | | * Phillip Lougher <phillip@squashfs.org.uk> |
6 | | * |
7 | | * This program is free software; you can redistribute it and/or |
8 | | * modify it under the terms of the GNU General Public License |
9 | | * as published by the Free Software Foundation; either version 2, |
10 | | * or (at your option) any later version. |
11 | | * |
12 | | * This program is distributed in the hope that it will be useful, |
13 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | | * GNU General Public License for more details. |
16 | | * |
17 | | * squashfs.h |
18 | | */ |
19 | | |
20 | | #include <linux/printk.h> |
21 | | #include <fs.h> |
22 | | #include <linux/fs.h> |
23 | | #include <linux/kernel.h> |
24 | | |
25 | | #define DEBUG |
26 | | #define pgoff_t unsigned long |
27 | | |
28 | | /* |
29 | | * We "simulate" the Linux page struct much simpler here |
30 | | */ |
31 | | struct page { |
32 | | pgoff_t index; |
33 | | void *addr; |
34 | | struct inode *inode; |
35 | | }; |
36 | | |
37 | | |
38 | | struct squashfs_page { |
39 | | struct page real_page; |
40 | | char **buf; |
41 | | int idx; |
42 | | int data_block; |
43 | | }; |
44 | | |
45 | | static inline struct squashfs_page *squashfs_page(struct page *page) |
46 | 0 | { |
47 | 0 | return container_of(page, struct squashfs_page, real_page); |
48 | 0 | } Unexecuted instantiation: squashfs.c:squashfs_page Unexecuted instantiation: block.c:squashfs_page Unexecuted instantiation: cache.c:squashfs_page Unexecuted instantiation: decompressor.c:squashfs_page Unexecuted instantiation: decompressor_single.c:squashfs_page Unexecuted instantiation: file.c:squashfs_page Unexecuted instantiation: file_cache.c:squashfs_page Unexecuted instantiation: fragment.c:squashfs_page Unexecuted instantiation: id.c:squashfs_page Unexecuted instantiation: inode.c:squashfs_page Unexecuted instantiation: namei.c:squashfs_page Unexecuted instantiation: super.c:squashfs_page Unexecuted instantiation: symlink.c:squashfs_page Unexecuted instantiation: dir.c:squashfs_page Unexecuted instantiation: xz_wrapper.c:squashfs_page Unexecuted instantiation: lzo_wrapper.c:squashfs_page Unexecuted instantiation: lz4_wrapper.c:squashfs_page Unexecuted instantiation: zlib_wrapper.c:squashfs_page Unexecuted instantiation: zstd_wrapper.c:squashfs_page |
49 | 0 | #define TRACE(s, args...) pr_debug("SQUASHFS: "s, ## args) |
50 | | |
51 | 0 | #define ERROR(s, args...) pr_err("SQUASHFS error: "s, ## args) |
52 | | |
53 | | #define WARNING(s, args...) pr_warn("SQUASHFS: "s, ## args) |
54 | | |
55 | | char *squashfs_devread(struct squashfs_sb_info *fs, int byte_offset, |
56 | | int byte_len); |
57 | | extern int squashfs_mount(struct fs_device *fsdev, |
58 | | int silent); |
59 | | extern void squashfs_put_super(struct super_block *sb); |
60 | | |
61 | | /* squashfs.c */ |
62 | | extern const struct file_operations squashfs_file_operations; |
63 | | |
64 | | /* block.c */ |
65 | | extern int squashfs_read_data(struct super_block *, u64, int, u64 *, |
66 | | struct squashfs_page_actor *); |
67 | | |
68 | | /* cache.c */ |
69 | | extern struct squashfs_cache *squashfs_cache_init(char *, int, int); |
70 | | extern void squashfs_cache_delete(struct squashfs_cache *); |
71 | | extern struct squashfs_cache_entry *squashfs_cache_get(struct super_block *, |
72 | | struct squashfs_cache *, u64, int); |
73 | | extern void squashfs_cache_put(struct squashfs_cache_entry *); |
74 | | extern int squashfs_copy_data(void *, struct squashfs_cache_entry *, int, int); |
75 | | extern int squashfs_read_metadata(struct super_block *, void *, u64 *, |
76 | | int *, int); |
77 | | extern struct squashfs_cache_entry *squashfs_get_fragment(struct super_block *, |
78 | | u64, int); |
79 | | extern struct squashfs_cache_entry *squashfs_get_datablock(struct super_block *, |
80 | | u64, int); |
81 | | extern void *squashfs_read_table(struct super_block *, u64, int); |
82 | | |
83 | | /* decompressor.c */ |
84 | | extern const struct squashfs_decompressor *squashfs_lookup_decompressor(int); |
85 | | extern void *squashfs_decompressor_setup(struct super_block *, unsigned short); |
86 | | |
87 | | /* decompressor_xxx.c */ |
88 | | extern void *squashfs_decompressor_create(struct squashfs_sb_info *, void *); |
89 | | extern void squashfs_decompressor_destroy(struct squashfs_sb_info *); |
90 | | extern int squashfs_decompress(struct squashfs_sb_info *, char **, |
91 | | int, int, int, struct squashfs_page_actor *); |
92 | | extern int squashfs_max_decompressors(void); |
93 | | |
94 | | /* fragment.c */ |
95 | | extern int squashfs_frag_lookup(struct super_block *, unsigned int, u64 *); |
96 | | extern __le64 *squashfs_read_fragment_index_table(struct super_block *, |
97 | | u64, u64, unsigned int); |
98 | | /* file.c */ |
99 | | int squashfs_copy_cache(struct page *, struct squashfs_cache_entry *, int, |
100 | | int); |
101 | | extern int squashfs_readpage(struct file *file, struct page *page); |
102 | | |
103 | | /* file_xxx.c */ |
104 | | extern int squashfs_readpage_block(struct page *, u64, int, int); |
105 | | |
106 | | /* id.c */ |
107 | | extern int squashfs_get_id(struct super_block *, unsigned int, unsigned int *); |
108 | | extern __le64 *squashfs_read_id_index_table(struct super_block *, u64, u64, |
109 | | unsigned short); |
110 | | |
111 | | /* inode.c */ |
112 | | extern struct inode *squashfs_iget(struct super_block *, long long, |
113 | | unsigned int); |
114 | | extern int squashfs_read_inode(struct inode *, long long); |
115 | | |
116 | | /* |
117 | | * Inodes, files, decompressor and xattr operations |
118 | | */ |
119 | | |
120 | | /* dir.c */ |
121 | | extern const struct file_operations squashfs_dir_ops; |
122 | | |
123 | | /* export.c */ |
124 | | extern const struct export_operations squashfs_export_ops; |
125 | | |
126 | | /* file.c */ |
127 | | extern const struct address_space_operations squashfs_aops; |
128 | | |
129 | | /* inode.c */ |
130 | | extern const struct inode_operations squashfs_inode_ops; |
131 | | |
132 | | /* namei.c */ |
133 | | extern const struct inode_operations squashfs_dir_inode_ops; |
134 | | |
135 | | /* symlink.c */ |
136 | | extern const struct address_space_operations squashfs_symlink_aops; |
137 | | extern const struct inode_operations squashfs_symlink_inode_ops; |