]> wimlib.net Git - wimlib/blob - include/wimlib/inode_table.h
inode/blob cleanups
[wimlib] / include / wimlib / inode_table.h
1 #ifndef _WIMLIB_INODE_TABLE_H
2 #define _WIMLIB_INODE_TABLE_H
3
4 #include "wimlib/list.h"
5 #include "wimlib/types.h"
6
7 struct wim_dentry;
8
9 /* Hash table to find inodes, given an inode number (in the case of reading
10  * a WIM images), or both an inode number and a device number (in the case of
11  * capturing a WIM image). */
12 struct wim_inode_table {
13         /* Fields for the hash table */
14         struct hlist_head *array;
15         size_t num_entries;
16         size_t capacity;
17
18         /*
19          * Linked list of "extra" inodes.  These may be:
20          *
21          * - inodes with link count 1, which are all allowed to have 0 for their
22          *   inode number, meaning we cannot insert them into the hash table.
23          *
24          * - Groups we create ourselves by splitting a nominal inode due to
25          *   inconsistencies in the dentries.  These inodes will share an inode
26          *   number with some other inode until assign_inode_numbers() is
27          *   called.
28          */
29         struct list_head extra_inodes;
30 };
31
32
33 extern int
34 init_inode_table(struct wim_inode_table *table, size_t capacity);
35
36 extern int
37 inode_table_new_dentry(struct wim_inode_table *table, const tchar *name,
38                        u64 ino, u64 devno, bool noshare,
39                        struct wim_dentry **dentry_ret);
40
41 extern void
42 inode_table_prepare_inode_list(struct wim_inode_table *table,
43                                struct list_head *head);
44
45 extern void
46 destroy_inode_table(struct wim_inode_table *table);
47
48 #endif /* _WIMLIB_INODE_TABLE_H  */