+ lte->out_refcnt = lte->refcnt;
+ memcpy(<e->output_resource_entry, <e->resource_entry,
+ sizeof(struct resource_entry));
+ if (!(lte->resource_entry.flags & WIM_RESHDR_FLAG_METADATA)) {
+ wimlib_assert(lte->resource_location != RESOURCE_NONEXISTENT);
+ if (lte->resource_location != RESOURCE_IN_WIM || lte->wim != args->wim)
+ list_add(<e->staging_list, args->stream_list);
+ }
+ return 0;
+}
+
+static int wim_find_new_streams(WIMStruct *wim, off_t end_offset,
+ struct list_head *stream_list)
+{
+ struct lte_overwrite_prepare_args args = {
+ .wim = wim,
+ .end_offset = end_offset,
+ .stream_list = stream_list,
+ };
+
+ return for_lookup_table_entry(wim->lookup_table,
+ lte_overwrite_prepare, &args);
+}
+
+static int inode_find_streams_to_write(struct inode *inode,
+ struct lookup_table *table,
+ struct list_head *stream_list)