2 * fs/befs/befs_fs_types.h
4 * Copyright (C) 2001 Will Dyson (will@cs.earlham.edu)
8 * from linux/include/linux/befs_fs.h
10 * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
14 #ifndef _LINUX_BEFS_FS_TYPES
15 #define _LINUX_BEFS_FS_TYPES
18 #include <linux/types.h>
21 #define PACKED __attribute__ ((__packed__))
24 * Max name lengths of BFS
27 #define BEFS_NAME_LEN 255
29 #define BEFS_SYMLINK_LEN 144
30 #define BEFS_NUM_DIRECT_BLOCKS 12
31 #define B_OS_NAME_LENGTH 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
38 * Err. Should that be 4 fs blocks or 4k???
39 * It matters on large blocksize volumes
41 #define BEFS_DBLINDIR_BRUN_LEN 4
50 BEFS_CLEAN = 0x434c454e,
51 BEFS_DIRTY = 0x44495254,
52 BEFS_SUPER_MAGIC1 = 0x42465331, /* BFS1 */
53 BEFS_SUPER_MAGIC2 = 0xdd121031,
54 BEFS_SUPER_MAGIC3 = 0x15b6830e,
57 #define BEFS_BYTEORDER_NATIVE 0x42494745
59 #define BEFS_SUPER_MAGIC BEFS_SUPER_MAGIC1
65 #define BEFS_INODE_MAGIC1 0x3bbe0ad9
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,
79 * On-Disk datastructures of BeFS
82 typedef u64 __bitwise fs64;
83 typedef u32 __bitwise fs32;
84 typedef u16 __bitwise fs16;
86 typedef u64 befs_off_t;
87 typedef u64 befs_time_t;
94 } PACKED befs_block_run;
96 typedef befs_block_run befs_inode_addr;
99 * The Superblock Structure
102 char name[B_OS_NAME_LENGTH];
109 befs_off_t num_blocks;
110 befs_off_t used_blocks;
121 befs_block_run log_blocks;
122 befs_off_t log_start;
126 befs_inode_addr root_dir;
127 befs_inode_addr indices;
129 } PACKED befs_super_block;
132 * Note: the indirect and dbl_indir block_runs may
133 * be longer than one block!
136 befs_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
137 befs_off_t max_direct_range;
138 befs_block_run indirect;
139 befs_off_t max_indirect_range;
140 befs_block_run double_indirect;
141 befs_off_t max_double_indirect_range;
143 } PACKED befs_data_stream;
151 } PACKED befs_small_data;
153 /* Inode structure */
156 befs_inode_addr inode_num;
161 befs_time_t create_time;
162 befs_time_t last_modified_time;
163 befs_inode_addr parent;
164 befs_inode_addr attributes;
168 u32 etc; /* not use */
171 befs_data_stream datastream;
172 char symlink[BEFS_SYMLINK_LEN];
175 u32 pad[4]; /* not use */
176 befs_small_data small_data[1];
183 #define BEFS_BTREE_MAGIC 0x69f6c2e8
186 BTREE_STRING_TYPE = 0,
187 BTREE_INT32_TYPE = 1,
188 BTREE_UINT32_TYPE = 2,
189 BTREE_INT64_TYPE = 3,
190 BTREE_UINT64_TYPE = 4,
191 BTREE_FLOAT_TYPE = 5,
192 BTREE_DOUBLE_TYPE = 6
200 befs_off_t root_node_ptr;
201 befs_off_t free_node_ptr;
203 } PACKED befs_btree_super;
206 * Header stucture of each btree node
214 } PACKED befs_btree_nodehead;
216 #endif /* _LINUX_BEFS_FS_TYPES */