X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwim.c;h=342281d382fed08bf7ed461bcf2c611fb90a912c;hp=128bddac428e50f9260d4d8f9b8d0ce7fd7419b8;hb=2af95e7dc313e9abaf571034c3e86f32503bf232;hpb=bdc18020a46938f142bf39f10f9e0f1c9126cb0b diff --git a/src/wim.c b/src/wim.c index 128bddac..342281d3 100644 --- a/src/wim.c +++ b/src/wim.c @@ -65,7 +65,7 @@ static WIMStruct * new_wim_struct() { WIMStruct *w = CALLOC(1, sizeof(WIMStruct)); -#ifdef WITH_FUSE +#if defined(WITH_FUSE) || defined(ENABLE_MULTITHREADED_COMPRESSION) if (pthread_mutex_init(&w->fp_tab_mutex, NULL) != 0) { ERROR_WITH_ERRNO("Failed to initialize mutex"); FREE(w); @@ -617,16 +617,18 @@ new_image_metadata_array(unsigned num_images) return imd_array; } +/* Checksum all streams that are unhashed (other than the metadata streams), + * merging them into the lookup table as needed. This is a no-op unless the + * library has previously used to add or mount an image using the same + * WIMStruct. */ 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) - { + struct wim_image_metadata *imd = w->image_metadata[i]; + image_for_each_unhashed_stream_safe(lte, tmp, imd) { ret = hash_unhashed_stream(lte, w->lookup_table, NULL); if (ret) return ret;