1 Index: squashfs-tools-4.3/squashfs-tools/mksquashfs.c
2 ===================================================================
3 --- squashfs-tools-4.3.orig/squashfs-tools/mksquashfs.c
4 +++ squashfs-tools-4.3/squashfs-tools/mksquashfs.c
5 @@ -2426,16 +2426,21 @@ void *deflator(void *arg)
6 void frag_deflator(struct file_buffer *file_buffer)
9 + int c_byte, compressed_size;
10 + struct file_buffer *write_buffer;
12 - res = compressor_init(comp, &stream, block_size, 1);
14 - BAD_ERROR("frag_deflator:: compressor_init failed\n");
15 + static int frag_deflator_comp_init = FALSE;
16 + static void *frag_stream = NULL;
18 - int c_byte, compressed_size;
19 - struct file_buffer *write_buffer =
20 - cache_get(fwriter_buffer, file_buffer->block);
21 + if (frag_deflator_comp_init == FALSE) {
22 + frag_deflator_comp_init = TRUE;
23 + res = compressor_init(comp, &frag_stream, block_size, 1);
25 + BAD_ERROR("frag_deflator:: compressor_init failed\n");
28 - c_byte = mangle2(stream, write_buffer->data, file_buffer->data,
29 + write_buffer = cache_get(fwriter_buffer, file_buffer->block);
30 + c_byte = mangle2(frag_stream, write_buffer->data, file_buffer->data,
31 file_buffer->size, block_size, noF, 1);
32 compressed_size = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte);
33 write_buffer->size = compressed_size;