]> wimlib.net Git - wimlib/blobdiff - src/write.c
Cleanup and add more comments
[wimlib] / src / write.c
index a3f4213fef7513ab2bd744e2adda57c319530772..4ae01c6e36abe00f710ccf00859e5d9573052e6e 100644 (file)
@@ -76,15 +76,13 @@ can_raw_copy(const struct wim_lookup_table_entry *lte,
 {
        if (lte->resource_location != RESOURCE_IN_WIM)
                return false;
-       if (out_ctype == WIMLIB_COMPRESSION_TYPE_NONE)
-               return false;
-       if (lte->rspec->ctype != out_ctype)
+       if (lte->rspec->flags & WIM_RESHDR_FLAG_PACKED_STREAMS)
                return false;
-       if (out_chunk_size != lte->rspec->cchunk_size)
+       if (out_ctype == WIMLIB_COMPRESSION_TYPE_NONE)
                return false;
-       if (lte->offset_in_res != 0)
+       if (lte->rspec->wim->compression_type != out_ctype)
                return false;
-       if (lte->size != lte->rspec->uncompressed_size)
+       if (lte->rspec->wim->chunk_size != out_chunk_size)
                return false;
        return true;
 }
@@ -268,7 +266,7 @@ write_pwm_stream_header(const struct wim_lookup_table_entry *lte,
                copy_hash(stream_hdr.hash, lte->hash);
        }
 
-       reshdr_flags = lte->flags & ~(WIM_RESHDR_FLAG_COMPRESSED | WIM_RESHDR_FLAG_CONCAT);
+       reshdr_flags = lte->flags & ~(WIM_RESHDR_FLAG_COMPRESSED | WIM_RESHDR_FLAG_PACKED_STREAMS);
        reshdr_flags |= additional_reshdr_flags;
        stream_hdr.flags = cpu_to_le32(reshdr_flags);
        ret = full_write(out_fd, &stream_hdr, sizeof(stream_hdr));
@@ -528,7 +526,7 @@ write_wim_resource(struct wim_lookup_table_entry *lte,
        write_ctx.resource_flags = resource_flags;
 try_write_again:
        if (write_ctx.out_ctype == WIMLIB_COMPRESSION_TYPE_NONE)
-               in_chunk_size = lte_cchunk_size(lte);
+               in_chunk_size = 0;
        else
                in_chunk_size = out_chunk_size;
        ret = read_stream_prefix(lte, read_size, write_resource_cb,
@@ -557,7 +555,7 @@ try_write_again:
        /* Fill in out_reshdr with information about the newly written
         * resource.  */
        out_reshdr->size_in_wim   = out_fd->offset - res_start_offset;
-       out_reshdr->flags         = lte->flags & ~WIM_RESHDR_FLAG_CONCAT;
+       out_reshdr->flags         = lte->flags & ~WIM_RESHDR_FLAG_PACKED_STREAMS;
        if (out_ctype == WIMLIB_COMPRESSION_TYPE_NONE)
                out_reshdr->flags &= ~WIM_RESHDR_FLAG_COMPRESSED;
        else