if (!root)
return WIMLIB_ERR_NOMEM;
- stbuf_to_dentry(&root_stbuf, root);
+ stbuf_to_inode(&root_stbuf, root->inode);
add_flags &= ~WIMLIB_ADD_IMAGE_FLAG_ROOT;
root->inode->resolved = true;
static int add_lte_to_dest_wim(struct dentry *dentry, void *arg)
{
WIMStruct *src_wim, *dest_wim;
+ struct inode *inode;
src_wim = ((struct wim_pair*)arg)->src_wim;
dest_wim = ((struct wim_pair*)arg)->dest_wim;
+ inode = dentry->inode;
- wimlib_assert(!dentry->inode->resolved);
+ wimlib_assert(!inode->resolved);
- for (unsigned i = 0; i < (unsigned)dentry->inode->num_ads + 1; i++) {
+ for (unsigned i = 0; i <= inode->num_ads; i++) {
struct lookup_table_entry *src_lte, *dest_lte;
- src_lte = inode_stream_lte_unresolved(dentry->inode, i,
+ src_lte = inode_stream_lte_unresolved(inode, i,
src_wim->lookup_table);
if (!src_lte)
continue;
- dest_lte = inode_stream_lte_unresolved(dentry->inode, i,
+ dest_lte = inode_stream_lte_unresolved(inode, i,
dest_wim->lookup_table);
if (dest_lte) {
dest_lte->refcnt++;
struct dentry *root_dentry = NULL;
struct wim_security_data *sd;
struct capture_config config;
- struct inode_table *inode_tab;
+ struct inode_table inode_tab;
struct hlist_head inode_list;
int ret;
goto out_free_dentry_tree;
DEBUG("Inserting dentries into inode table");
- for_dentry_in_tree(root_dentry, inode_table_insert, inode_tab);
+ ret = init_inode_table(&inode_tab, 9001);
+ if (ret != 0)
+ goto out_destroy_imd;
+
+ for_dentry_in_tree(root_dentry, inode_table_insert, &inode_tab);
- DEBUG("Cleanup up the hard link groups");
- ret = fix_inodes(inode_tab, &inode_list);
- free_inode_table(inode_tab);
+ DEBUG("Cleaning up the hard link groups");
+ ret = fix_inodes(&inode_tab, &inode_list);
+ destroy_inode_table(&inode_tab);
if (ret != 0)
goto out_destroy_imd;