if (w->current_image != WIMLIB_NO_IMAGE) {
imd = wim_get_current_image_metadata(w);
if (!imd->modified) {
+ wimlib_assert(list_empty(&imd->unhashed_streams));
DEBUG("Freeing image %u", w->current_image);
destroy_image_metadata(imd, NULL, false);
}
free_lookup_table_entry(imd->metadata_lte);
imd->metadata_lte = NULL;
}
+ if (!table) {
+ struct wim_lookup_table_entry *lte, *tmp;
+ list_for_each_entry_safe(lte, tmp, &imd->unhashed_streams, unhashed_list)
+ free_lookup_table_entry(lte);
+ }
INIT_LIST_HEAD(&imd->unhashed_streams);
- INIT_HLIST_HEAD(&imd->inode_list);
+ INIT_LIST_HEAD(&imd->inode_list);
}
void
imd = CALLOC(1, sizeof(*imd));
if (imd) {
imd->refcnt = 1;
- INIT_HLIST_HEAD(&imd->inode_list);
+ INIT_LIST_HEAD(&imd->inode_list);
INIT_LIST_HEAD(&imd->unhashed_streams);
DEBUG("Created new image metadata (refcnt=1)");
} else {
return imd_array;
}
+int
+wim_checksum_unhashed_streams(WIMStruct *w)
+{
+ int ret;
+ for (int i = 0; i < w->hdr.image_count; i++) {
+ struct wim_lookup_table_entry *lte, *tmp;
+ list_for_each_entry_safe(lte, tmp,
+ &w->image_metadata[i]->unhashed_streams,
+ unhashed_list)
+ {
+ ret = hash_unhashed_stream(lte, w->lookup_table, NULL);
+ if (ret)
+ return ret;
+ }
+ }
+ return 0;
+}
+
/* Frees the memory for the WIMStruct, including all internal memory; also
* closes all files associated with the WIMStruct. */
WIMLIBAPI void