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
58 #define BEFS_BYTEORDER_NATIVE_LE (__force fs32)cpu_to_le32(BEFS_BYTEORDER_NATIVE)
59 #define BEFS_BYTEORDER_NATIVE_BE (__force fs32)cpu_to_be32(BEFS_BYTEORDER_NATIVE)
61 #define BEFS_SUPER_MAGIC BEFS_SUPER_MAGIC1
62 #define BEFS_SUPER_MAGIC1_LE (__force fs32)cpu_to_le32(BEFS_SUPER_MAGIC1)
63 #define BEFS_SUPER_MAGIC1_BE (__force fs32)cpu_to_be32(BEFS_SUPER_MAGIC1)
69 #define BEFS_INODE_MAGIC1 0x3bbe0ad9
72 BEFS_INODE_IN_USE = 0x00000001,
73 BEFS_ATTR_INODE = 0x00000004,
74 BEFS_INODE_LOGGED = 0x00000008,
75 BEFS_INODE_DELETED = 0x00000010,
76 BEFS_LONG_SYMLINK = 0x00000040,
77 BEFS_PERMANENT_FLAG = 0x0000ffff,
78 BEFS_INODE_NO_CREATE = 0x00010000,
79 BEFS_INODE_WAS_WRITTEN = 0x00020000,
80 BEFS_NO_TRANSACTION = 0x00040000,
83 * On-Disk datastructures of BeFS
86 typedef u64 __bitwise fs64;
87 typedef u32 __bitwise fs32;
88 typedef u16 __bitwise fs16;
90 typedef u64 befs_off_t;
91 typedef fs64 befs_time_t;
95 fs32 allocation_group;
98 } PACKED befs_disk_block_run;
101 u32 allocation_group;
104 } PACKED befs_block_run;
106 typedef befs_disk_block_run befs_disk_inode_addr;
107 typedef befs_block_run befs_inode_addr;
110 * The Superblock Structure
113 char name[B_OS_NAME_LENGTH];
132 befs_disk_block_run log_blocks;
137 befs_disk_inode_addr root_dir;
138 befs_disk_inode_addr indices;
140 } PACKED befs_super_block;
143 * Note: the indirect and dbl_indir block_runs may
144 * be longer than one block!
147 befs_disk_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
148 fs64 max_direct_range;
149 befs_disk_block_run indirect;
150 fs64 max_indirect_range;
151 befs_disk_block_run double_indirect;
152 fs64 max_double_indirect_range;
154 } PACKED befs_disk_data_stream;
157 befs_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
158 befs_off_t max_direct_range;
159 befs_block_run indirect;
160 befs_off_t max_indirect_range;
161 befs_block_run double_indirect;
162 befs_off_t max_double_indirect_range;
164 } PACKED befs_data_stream;
172 } PACKED befs_small_data;
174 /* Inode structure */
177 befs_disk_inode_addr inode_num;
182 befs_time_t create_time;
183 befs_time_t last_modified_time;
184 befs_disk_inode_addr parent;
185 befs_disk_inode_addr attributes;
189 fs32 etc; /* not use */
192 befs_disk_data_stream datastream;
193 char symlink[BEFS_SYMLINK_LEN];
196 fs32 pad[4]; /* not use */
197 befs_small_data small_data[1];
204 #define BEFS_BTREE_MAGIC 0x69f6c2e8
207 BTREE_STRING_TYPE = 0,
208 BTREE_INT32_TYPE = 1,
209 BTREE_UINT32_TYPE = 2,
210 BTREE_INT64_TYPE = 3,
211 BTREE_UINT64_TYPE = 4,
212 BTREE_FLOAT_TYPE = 5,
213 BTREE_DOUBLE_TYPE = 6
224 } PACKED befs_disk_btree_super;
231 befs_off_t root_node_ptr;
232 befs_off_t free_node_ptr;
234 } PACKED befs_btree_super;
237 * Header stucture of each btree node
245 } PACKED befs_btree_nodehead;
253 } PACKED befs_host_btree_nodehead;
255 #endif /* _LINUX_BEFS_FS_TYPES */