inode->i_not_rpfixed = 1;
INIT_LIST_HEAD(&inode->i_list);
INIT_LIST_HEAD(&inode->i_dentry);
+ inode->i_streams = inode->i_embedded_streams;
if (set_timestamps) {
u64 now = now_as_wim_timestamp();
inode->i_creation_time = now;
*
* If @force is %false:
* If any of the needed blobs do not exist in @table, return
- * WIMLIB_ERR_RESOURCE_NOT_FOUND and leave the inode unmodified.
+ * WIMLIB_ERR_RESOURCE_NOT_FOUND.
* If @force is %true:
* If any of the needed blobs do not exist in @table, allocate new blob
* descriptors for them and insert them into @table. This does not, of
inode_resolve_streams(struct wim_inode *inode, struct blob_table *table,
bool force)
{
- struct blob_descriptor *blobs[inode->i_num_streams];
-
for (unsigned i = 0; i < inode->i_num_streams; i++) {
+ struct wim_inode_stream *strm = &inode->i_streams[i];
- if (inode->i_streams[i].stream_resolved)
+ if (strm->stream_resolved)
continue;
- const u8 *hash = stream_hash(&inode->i_streams[i]);
+ const u8 *hash = stream_hash(strm);
struct blob_descriptor *blob = NULL;
if (!is_zero_hash(hash)) {
blob_table_insert(table, blob);
}
}
- blobs[i] = blob;
- }
-
- for (unsigned i = 0; i < inode->i_num_streams; i++) {
- if (!inode->i_streams[i].stream_resolved) {
- inode->i_streams[i]._stream_blob = blobs[i];
- inode->i_streams[i].stream_resolved = 1;
- }
+ strm->_stream_blob = blob;
+ strm->stream_resolved = 1;
}
return 0;
}