forked from hrishikeshgoyal/ext2fs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext2fs_htree.h
76 lines (58 loc) · 1.53 KB
/
ext2fs_htree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef _FS_EXT2FS_HTREE_H_
#define _FS_EXT2FS_HTREE_H_
/* EXT3 HTree directory indexing */
#define EXT2_HTREE_LEGACY 0
#define EXT2_HTREE_HALF_MD4 1
#define EXT2_HTREE_TEA 2
#define EXT2_HTREE_LEGACY_UNSIGNED 3
#define EXT2_HTREE_HALF_MD4_UNSIGNED 4
#define EXT2_HTREE_TEA_UNSIGNED 5
#define EXT2_HTREE_EOF 0x7FFFFFFF
struct ext2fs_fake_direct {
uint32_t e2d_ino; /* inode number of entry */
uint16_t e2d_reclen; /* length of this record */
uint8_t e2d_namlen; /* length of string in d_name */
uint8_t e2d_type; /* file type */
};
struct ext2fs_htree_count {
uint16_t h_entries_max;
uint16_t h_entries_num;
};
struct ext2fs_htree_entry {
uint32_t h_hash;
uint32_t h_blk;
};
struct ext2fs_htree_root_info {
uint32_t h_reserved1;
uint8_t h_hash_version;
uint8_t h_info_len;
uint8_t h_ind_levels;
uint8_t h_reserved2;
};
struct ext2fs_htree_root {
struct ext2fs_fake_direct h_dot;
char h_dot_name[4];
struct ext2fs_fake_direct h_dotdot;
char h_dotdot_name[4];
struct ext2fs_htree_root_info h_info;
struct ext2fs_htree_entry h_entries[0];
};
struct ext2fs_htree_node {
struct ext2fs_fake_direct h_fake_dirent;
struct ext2fs_htree_entry h_entries[0];
};
struct ext2fs_htree_lookup_level {
struct buf *h_bp;
struct ext2fs_htree_entry *h_entries;
struct ext2fs_htree_entry *h_entry;
};
struct ext2fs_htree_lookup_info {
struct ext2fs_htree_lookup_level h_levels[2];
uint32_t h_levels_num;
};
struct ext2fs_htree_sort_entry {
uint16_t h_offset;
uint16_t h_size;
uint32_t h_hash;
};
#endif /* !_FS_EXT2FS_HTREE_H_ */