+ /* A hash of the file's contents, or a pointer to the lookup table entry
+ * for this dentry if the lookup table entries have been resolved.
+ *
+ * More specifically, this is for the un-named default file stream, as
+ * opposed to the alternate (named) file streams, which may have their
+ * own lookup table entries. */
+ union {
+ u8 hash[SHA1_HASH_SIZE];
+ struct lookup_table_entry *lte;
+ };
+
+ /* Identity of a reparse point. See
+ * http://msdn.microsoft.com/en-us/library/windows/desktop/aa365503(v=vs.85).aspx
+ * for what a reparse point is. */
+ u32 reparse_tag;
+
+ /* Number of dentries that reference this inode */
+ u32 link_count;
+
+ /* Alternate data stream entries. */
+ struct ads_entry *ads_entries;
+
+ /* Inode number */
+ u64 ino;
+
+ /* List of dentries that reference this inode (there should be
+ * link_count of them) */
+ struct list_head dentry_list;
+ struct hlist_node hlist;
+ char *extracted_file;
+
+ /* If non-NULL, the children of this inode (implies the inode is a
+ * directory) */
+ struct dentry *children;
+
+#ifdef WITH_FUSE
+ /* wimfs file descriptors table for the inode */
+ u16 num_opened_fds;
+ u16 num_allocated_fds;
+ struct wimlib_fd **fds;
+
+ /* Next alternate data stream ID to be assigned */
+ u32 next_stream_id;
+#endif
+};
+
+#define inode_for_each_dentry(dentry, inode) \
+ list_for_each_entry((dentry), &(inode)->dentry_list, inode_dentry_list)
+
+#define inode_add_dentry(dentry, inode) \
+ ({ \
+ wimlib_assert((inode)->dentry_list.next != NULL); \
+ list_add(&(dentry)->inode_dentry_list, &(inode)->dentry_list); \
+ })
+
+static inline bool dentry_is_extracted(const struct dentry *dentry)
+{
+ return dentry->is_extracted;
+}
+
+static inline bool dentry_is_first_in_inode(const struct dentry *dentry)
+{
+ return container_of(dentry->d_inode->dentry_list.next,
+ struct dentry,
+ inode_dentry_list) == dentry;
+}
+
+extern u64 dentry_correct_total_length(const struct dentry *dentry);
+
+extern void stbuf_to_inode(const struct stat *stbuf, struct inode *inode);
+extern int inode_to_stbuf(const struct inode *inode,
+ struct lookup_table_entry *lte, struct stat *stbuf);