irqs: make irq_timer_state to use dyn_array
[deliverable/linux.git] / fs / befs / befs_fs_types.h
CommitLineData
1da177e4 1/*
f30c2269 2 * fs/befs/befs_fs_types.h
1da177e4
LT
3 *
4 * Copyright (C) 2001 Will Dyson (will@cs.earlham.edu)
5 *
6 *
7 *
8 * from linux/include/linux/befs_fs.h
9 *
10 * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
11 *
12 */
13
14#ifndef _LINUX_BEFS_FS_TYPES
15#define _LINUX_BEFS_FS_TYPES
16
17#ifdef __KERNEL__
18#include <linux/types.h>
19#endif /*__KERNEL__*/
20
21#define PACKED __attribute__ ((__packed__))
22
23/*
24 * Max name lengths of BFS
25 */
26
27#define BEFS_NAME_LEN 255
28
29#define BEFS_SYMLINK_LEN 144
30#define BEFS_NUM_DIRECT_BLOCKS 12
31#define B_OS_NAME_LENGTH 32
32
33/* The datastream blocks mapped by the double-indirect
34 * block are always 4 fs blocks long.
35 * This eliminates the need for linear searches among
36 * the potentially huge number of indirect blocks
37 *
38 * Err. Should that be 4 fs blocks or 4k???
39 * It matters on large blocksize volumes
40 */
41#define BEFS_DBLINDIR_BRUN_LEN 4
42
43/*
44 * Flags of superblock
45 */
46
47enum super_flags {
48 BEFS_BYTESEX_BE,
49 BEFS_BYTESEX_LE,
50 BEFS_CLEAN = 0x434c454e,
51 BEFS_DIRTY = 0x44495254,
52 BEFS_SUPER_MAGIC1 = 0x42465331, /* BFS1 */
53 BEFS_SUPER_MAGIC2 = 0xdd121031,
54 BEFS_SUPER_MAGIC3 = 0x15b6830e,
55};
56
57#define BEFS_BYTEORDER_NATIVE 0x42494745
58
59#define BEFS_SUPER_MAGIC BEFS_SUPER_MAGIC1
60
61/*
62 * Flags of inode
63 */
64
65#define BEFS_INODE_MAGIC1 0x3bbe0ad9
66
67enum inode_flags {
68 BEFS_INODE_IN_USE = 0x00000001,
69 BEFS_ATTR_INODE = 0x00000004,
70 BEFS_INODE_LOGGED = 0x00000008,
71 BEFS_INODE_DELETED = 0x00000010,
72 BEFS_LONG_SYMLINK = 0x00000040,
73 BEFS_PERMANENT_FLAG = 0x0000ffff,
74 BEFS_INODE_NO_CREATE = 0x00010000,
75 BEFS_INODE_WAS_WRITTEN = 0x00020000,
76 BEFS_NO_TRANSACTION = 0x00040000,
77};
78/*
79 * On-Disk datastructures of BeFS
80 */
81
1151895f
AV
82typedef u64 __bitwise fs64;
83typedef u32 __bitwise fs32;
84typedef u16 __bitwise fs16;
85
1da177e4 86typedef u64 befs_off_t;
a9721f31 87typedef fs64 befs_time_t;
1da177e4
LT
88
89/* Block runs */
a9721f31
AV
90typedef struct {
91 fs32 allocation_group;
92 fs16 start;
93 fs16 len;
94} PACKED befs_disk_block_run;
95
1da177e4
LT
96typedef struct {
97 u32 allocation_group;
98 u16 start;
99 u16 len;
100} PACKED befs_block_run;
101
a9721f31 102typedef befs_disk_block_run befs_disk_inode_addr;
1da177e4
LT
103typedef befs_block_run befs_inode_addr;
104
105/*
106 * The Superblock Structure
107 */
108typedef struct {
109 char name[B_OS_NAME_LENGTH];
a9721f31
AV
110 fs32 magic1;
111 fs32 fs_byte_order;
1da177e4 112
a9721f31
AV
113 fs32 block_size;
114 fs32 block_shift;
1da177e4 115
a9721f31
AV
116 fs64 num_blocks;
117 fs64 used_blocks;
1da177e4 118
a9721f31 119 fs32 inode_size;
1da177e4 120
a9721f31
AV
121 fs32 magic2;
122 fs32 blocks_per_ag;
123 fs32 ag_shift;
124 fs32 num_ags;
1da177e4 125
a9721f31 126 fs32 flags;
1da177e4 127
a9721f31
AV
128 befs_disk_block_run log_blocks;
129 fs64 log_start;
130 fs64 log_end;
1da177e4 131
a9721f31
AV
132 fs32 magic3;
133 befs_disk_inode_addr root_dir;
134 befs_disk_inode_addr indices;
1da177e4
LT
135
136} PACKED befs_super_block;
137
138/*
139 * Note: the indirect and dbl_indir block_runs may
140 * be longer than one block!
141 */
a9721f31
AV
142typedef struct {
143 befs_disk_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
144 fs64 max_direct_range;
145 befs_disk_block_run indirect;
146 fs64 max_indirect_range;
147 befs_disk_block_run double_indirect;
148 fs64 max_double_indirect_range;
149 fs64 size;
150} PACKED befs_disk_data_stream;
151
1da177e4
LT
152typedef struct {
153 befs_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
154 befs_off_t max_direct_range;
155 befs_block_run indirect;
156 befs_off_t max_indirect_range;
157 befs_block_run double_indirect;
158 befs_off_t max_double_indirect_range;
159 befs_off_t size;
160} PACKED befs_data_stream;
161
162/* Attribute */
163typedef struct {
a9721f31
AV
164 fs32 type;
165 fs16 name_size;
166 fs16 data_size;
1da177e4
LT
167 char name[1];
168} PACKED befs_small_data;
169
170/* Inode structure */
171typedef struct {
a9721f31
AV
172 fs32 magic1;
173 befs_disk_inode_addr inode_num;
174 fs32 uid;
175 fs32 gid;
176 fs32 mode;
177 fs32 flags;
1da177e4
LT
178 befs_time_t create_time;
179 befs_time_t last_modified_time;
a9721f31
AV
180 befs_disk_inode_addr parent;
181 befs_disk_inode_addr attributes;
182 fs32 type;
1da177e4 183
a9721f31
AV
184 fs32 inode_size;
185 fs32 etc; /* not use */
1da177e4
LT
186
187 union {
a9721f31 188 befs_disk_data_stream datastream;
1da177e4
LT
189 char symlink[BEFS_SYMLINK_LEN];
190 } data;
191
a9721f31 192 fs32 pad[4]; /* not use */
1da177e4
LT
193 befs_small_data small_data[1];
194} PACKED befs_inode;
195
196/*
197 * B+tree superblock
198 */
199
200#define BEFS_BTREE_MAGIC 0x69f6c2e8
201
202enum btree_types {
203 BTREE_STRING_TYPE = 0,
204 BTREE_INT32_TYPE = 1,
205 BTREE_UINT32_TYPE = 2,
206 BTREE_INT64_TYPE = 3,
207 BTREE_UINT64_TYPE = 4,
208 BTREE_FLOAT_TYPE = 5,
209 BTREE_DOUBLE_TYPE = 6
210};
211
a9721f31
AV
212typedef struct {
213 fs32 magic;
214 fs32 node_size;
215 fs32 max_depth;
216 fs32 data_type;
217 fs64 root_node_ptr;
218 fs64 free_node_ptr;
219 fs64 max_size;
220} PACKED befs_disk_btree_super;
221
1da177e4
LT
222typedef struct {
223 u32 magic;
224 u32 node_size;
225 u32 max_depth;
226 u32 data_type;
227 befs_off_t root_node_ptr;
228 befs_off_t free_node_ptr;
229 befs_off_t max_size;
230} PACKED befs_btree_super;
231
232/*
233 * Header stucture of each btree node
234 */
a9721f31
AV
235typedef struct {
236 fs64 left;
237 fs64 right;
238 fs64 overflow;
239 fs16 all_key_count;
240 fs16 all_key_length;
241} PACKED befs_btree_nodehead;
242
1da177e4
LT
243typedef struct {
244 befs_off_t left;
245 befs_off_t right;
246 befs_off_t overflow;
247 u16 all_key_count;
248 u16 all_key_length;
a9721f31 249} PACKED befs_host_btree_nodehead;
1da177e4
LT
250
251#endif /* _LINUX_BEFS_FS_TYPES */
This page took 0.306426 seconds and 5 git commands to generate.