#include "wimlib/assert.h"
#include "wimlib/list.h"
#include "wimlib/lookup_table.h"
-#include "wimlib/rbtree.h"
#include "wimlib/sha1.h"
#include "wimlib/unix_data.h"
struct wim_security_data;
struct wim_lookup_table;
struct wimfs_fd;
+struct avl_tree_node;
/*
* WIM inode.
* this inode. */
u32 i_attributes;
- /* Root of a red-black tree storing the child dentries of this inode, if
- * any. Keyed by wim_dentry->file_name, case sensitively. */
- struct rb_root i_children;
+ /* Root of a balanced binary search tree storing the child directory
+ * entries of this inode, if any. Keyed by wim_dentry->file_name, case
+ * sensitively. If this inode is not a directory or if it has no
+ * children then this will be an empty tree (NULL). */
+ struct avl_tree_node *i_children;
- /* Root of a red-black tree storing the children of this inode, if any.
- * Keyed by wim_dentry->file_name, case insensitively. */
- struct rb_root i_children_case_insensitive;
+ /* Root of a balanced binary search tree storing the child directory
+ * entries of this inode, if any. Keyed by wim_dentry->file_name, case
+ * insensitively. If this inode is not a directory or if it has no
+ * children then this will be an empty tree (NULL). */
+ struct avl_tree_node *i_children_ci;
/* List of dentries that are aliases for this inode. There will be
* i_nlink dentries in this list. */
/* Does the inode have children?
* Currently (based on read_dentry_tree()), this can only return true for inodes
- * for which inode_is_directory() returns true. However, if a directory is
- * empty, this returns false. */
+ * for which inode_is_directory() returns true. (This also returns false on
+ * empty directories.) */
static inline bool
inode_has_children(const struct wim_inode *inode)
{
- return !rb_empty_root(&inode->i_children);
+ return inode->i_children != NULL;
}
extern int
extern void
inode_ref_streams(struct wim_inode *inode);
+extern void
+inode_unref_streams(struct wim_inode *inode,
+ struct wim_lookup_table *lookup_table);
+
/* inode_fixup.c */
extern int
dentry_tree_fix_inodes(struct wim_dentry *root, struct list_head *inode_list);