static const u16 max_fds = 0xffff;
int ret;
- pthread_mutex_lock(&inode->i_mutex);
-
DEBUG("Allocating fd for stream ID %u from inode %#"PRIx64" "
"(open = %u, allocated = %u)",
stream_id, inode->i_ino, inode->i_num_opened_fds,
}
}
out:
- pthread_mutex_unlock(&inode->i_mutex);
return ret;
}
inode_put_fd(struct wim_inode *inode, struct wimfs_fd *fd)
{
wimlib_assert(inode != NULL);
-
- pthread_mutex_lock(&inode->i_mutex);
-
wimlib_assert(fd->f_inode == inode);
wimlib_assert(inode->i_num_opened_fds != 0);
wimlib_assert(fd->idx < inode->i_num_allocated_fds);
inode->i_fds[fd->idx] = NULL;
FREE(fd);
- if (--inode->i_num_opened_fds == 0 && inode->i_nlink == 0) {
- pthread_mutex_unlock(&inode->i_mutex);
- free_inode(inode);
- } else {
- pthread_mutex_unlock(&inode->i_mutex);
+ if (--inode->i_num_opened_fds == 0) {
+ FREE(inode->i_fds);
+ inode->i_fds = NULL;
+ inode->i_num_allocated_fds = 0;
+ if (inode->i_nlink == 0)
+ free_inode(inode);
}
}
if (ret)
goto out;
- if ((mount_flags & WIMLIB_MOUNT_FLAG_READWRITE) && (wim->hdr.total_parts != 1)) {
- ERROR("Cannot mount a split WIM read-write");
- ret = WIMLIB_ERR_SPLIT_UNSUPPORTED;
- goto out;
- }
-
- if (num_additional_swms)
- merge_lookup_tables(wim, additional_swms, num_additional_swms);
-
if (mount_flags & WIMLIB_MOUNT_FLAG_READWRITE) {
- ret = wim_run_full_verifications(wim);
+ ret = can_delete_from_wim(wim);
if (ret)
- goto out_restore_lookup_table;
+ goto out;
}
- ret = wim_checksum_unhashed_streams(wim);
- if (ret)
- goto out_restore_lookup_table;
+ if (num_additional_swms)
+ merge_lookup_tables(wim, additional_swms, num_additional_swms);
ret = select_wim_image(wim, image);
if (ret)
goto out_free_message_queue_names;
argc = 0;
- argv[argc++] = "imagex";
+ argv[argc++] = IMAGEX_PROGNAME;
argv[argc++] = dir_copy;
- /* disable multi-threaded operation for read-write mounts */
- if (mount_flags & WIMLIB_MOUNT_FLAG_READWRITE)
- argv[argc++] = "-s";
+ /* disable multi-threaded operation */
+ argv[argc++] = "-s";
if (mount_flags & WIMLIB_MOUNT_FLAG_DEBUG)
argv[argc++] = "-d";
* assign inode numbers */
DEBUG("Resolving lookup table entries and assigning inode numbers");
ctx.next_ino = 1;
- image_for_each_inode(inode, imd) {
- inode_resolve_ltes(inode, wim->lookup_table);
+ image_for_each_inode(inode, imd)
inode->i_ino = ctx.next_ino++;
- }
DEBUG("(next_ino = %"PRIu64")", ctx.next_ino);
DEBUG("Calling fuse_main()");