- next = lte_list_head->next;
- list_del(next);
- dest_lte = container_of(next, struct lookup_table_entry,
- staging_list);
- dest_lte->part_number = 1;
- dest_lte->refcnt = 1;
- wimlib_assert(hashes_equal(dest_lte->hash, src_lte->hash));
-
- lookup_table_insert(dest_wim->lookup_table, dest_lte);
+ for (i = 0; i <= inode->num_ads; i++) {
+ src_lte = inode_stream_lte_unresolved(inode, i, src_lookup_table);
+ if (src_lte) {
+ dest_lte = inode_stream_lte_unresolved(inode, i,
+ dest_lookup_table);
+ if (!dest_lte) {
+ struct list_head *next;
+
+ wimlib_assert(!list_empty(lte_list_head));
+ next = lte_list_head->next;
+ list_del(next);
+ dest_lte = container_of(next,
+ struct lookup_table_entry,
+ staging_list);
+ dest_lte->part_number = 1;
+ dest_lte->refcnt = 0;
+ wimlib_assert(hashes_equal(dest_lte->hash, src_lte->hash));
+ lookup_table_insert(dest_lookup_table, dest_lte);
+ }
+ dest_lte->refcnt += inode->link_count;