- }
- ref_inode->i_creation_time = last_ctime;
- ref_inode->i_last_write_time = last_mtime;
- ref_inode->i_last_access_time = last_atime;
- wimlib_assert(inode_link_count(ref_inode) == ref_inode->i_nlink);
- return 0;
-}
-
-/*
- * Fixes up a nominal inode.
- *
- * By a nominal inode we mean a group of two or more dentries that share the
- * same hard link group ID.
- *
- * If dentries in the inode are found to be inconsistent, we may split the inode
- * into several "true" inodes.
- *
- * After splitting up each nominal inode into the "true" inodes we will
- * canonicalize the link group by getting rid of all the unnecessary `struct
- * wim_inode's. There will be just one `struct wim_inode' for each hard link
- * group remaining.
- */
-static int
-fix_nominal_inode(struct wim_inode *inode, struct list_head *inode_list,
- bool *ino_changes_needed)
-{
- struct wim_dentry *dentry;
- struct hlist_node *cur, *tmp;
- int ret;
- size_t num_true_inodes;
-
- LIST_HEAD(dentries_with_data_streams);
- LIST_HEAD(dentries_with_no_data_streams);
- HLIST_HEAD(true_inodes);
-
- /* Create a list of dentries in the nominal inode that have at
- * least one data stream with a non-zero hash, and another list that
- * contains the dentries that have a zero hash for all data streams. */
- inode_for_each_dentry(dentry, inode) {
- if (dentry_has_data_streams(dentry))
- list_add(&dentry->tmp_list, &dentries_with_data_streams);
- else
- list_add(&dentry->tmp_list, &dentries_with_no_data_streams);
- }
-
- /* If there are no dentries with data streams, we require the nominal
- * inode to be a true inode */
- if (list_empty(&dentries_with_data_streams)) {
- #ifdef ENABLE_DEBUG
- unsigned nominal_group_size = inode_link_count(inode);
- if (nominal_group_size > 1) {
- DEBUG("Found link group of size %u without "
- "any data streams:", nominal_group_size);
- print_inode_dentries(inode);
- DEBUG("We are going to interpret it as true "
- "link group, provided that the dentries "
- "are consistent.");