#endif
};
-/* A "blob target" is a stream, and the inode to which that stream belongs, to
- * which a blob needs to be extracted as part of an extraction operation. Since
- * blobs are single-instanced, a blob may have multiple targets. */
+/* A "blob extraction target" is a stream, and the inode to which that stream
+ * belongs, to which a blob needs to be extracted as part of an extraction
+ * operation. Since blobs are single-instanced, a blob may have multiple
+ * extraction targets. */
struct blob_extraction_target {
struct wim_inode *inode;
struct wim_inode_stream *stream;
};
/*
- * Descriptor for a blob, which is a known length sequence of binary data.
+ * Descriptor for a "blob", which is a known length sequence of binary data.
*
* Within a WIM file, blobs are single instanced and are identified by SHA-1
* message digest.
return blob->blob_extraction_targets;
}
+/*
+ * Declare that the specified blob is located in the specified WIM resource at
+ * the specified offset. The caller is expected to set blob->size if required.
+ */
static inline void
blob_set_is_located_in_wim_resource(struct blob_descriptor *blob,
- struct wim_resource_descriptor *rdesc)
+ struct wim_resource_descriptor *rdesc,
+ u64 offset_in_res)
{
blob->blob_location = BLOB_IN_WIM;
blob->rdesc = rdesc;
list_add_tail(&blob->rdesc_node, &rdesc->blob_list);
+ blob->offset_in_res = offset_in_res;
+}
+
+/*
+ * Declare that the specified blob is located in the specified non-solid WIM
+ * resource. In this case, the blob data is the entire uncompressed resource.
+ */
+static inline void
+blob_set_is_located_in_nonsolid_wim_resource(struct blob_descriptor *blob,
+ struct wim_resource_descriptor *rdesc)
+{
+ blob_set_is_located_in_wim_resource(blob, rdesc, 0);
+ blob->size = rdesc->uncompressed_size;
}
static inline void
blob->blob_location = BLOB_NONEXISTENT;
}
+static inline void
+blob_set_is_located_in_attached_buffer(struct blob_descriptor *blob,
+ void *buffer, size_t size)
+{
+ blob->blob_location = BLOB_IN_ATTACHED_BUFFER;
+ blob->attached_buffer = buffer;
+ blob->size = size;
+}
+
extern struct blob_descriptor *
new_blob_from_data_buffer(const void *buffer, size_t size,
struct blob_table *blob_table);