- struct dentry *owner, *user, *tmp;
-
- /* Find a dentry with non-zero hash to use as a possible link group
- * owner (see comments above the share_dentry_ads() function */
- owner = container_of(group->dentry_list, struct dentry,
- link_group_list);
- do {
- /* imagex.exe may move the un-named data stream from the dentry
- * itself to the first alternate data stream, if there are
- * other alternate data streams */
- if (!is_zero_hash(owner->hash) ||
- (owner->num_ads && !is_zero_hash(owner->ads_entries[0].hash)))
- goto found_owner;
- owner = container_of(owner->link_group_list.next,
- struct dentry,
- link_group_list);
- } while (&owner->link_group_list != group->dentry_list);
-
- ERROR("Could not find owner of data streams in hard link group");
- return WIMLIB_ERR_INVALID_DENTRY;
-found_owner:
- owner->ads_entries_status = ADS_ENTRIES_OWNER;
- list_for_each_entry_safe(user, tmp, &owner->link_group_list,
- link_group_list)
- {
- /* I would like it to be an error if two dentries are in the
- * same hard link group but have irreconcilable differences such
- * as different file permissions, but unfortunately some of M$'s
- * WIMs contain many instances of this error. This problem is
- * worked around here by splitting each offending dentry off
- * into its own hard link group. */
- if (share_dentry_ads(owner, user) != 0) {
- struct link_group *single;
- single = MALLOC(sizeof(struct link_group));
- if (!single)
- return WIMLIB_ERR_NOMEM;
- list_del(&user->link_group_list);
- INIT_LIST_HEAD(&user->link_group_list);
- single->link_group_id = 0;
- single->next = *bad_links;
- single->dentry_list = &user->link_group_list;
- *bad_links = single;
- user->ads_entries_status = ADS_ENTRIES_OWNER;
+ struct wim_inode *inode;
+ struct hlist_node *cur, *tmp;
+ int ret;
+ INIT_LIST_HEAD(inode_list);
+ for (u64 i = 0; i < table->capacity; i++) {
+ hlist_for_each_entry_safe(inode, cur, tmp, &table->array[i], i_hlist) {
+ ret = fix_nominal_inode(inode, inode_list, ino_changes_needed);
+ if (ret)
+ return ret;