X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fmount_image.c;h=02a863c9b6ac55b47e09e01080bad6f085eaaefc;hb=92502e53658f09310d67118a0bbc18fa83a1b6f0;hp=b1a3f1c7ca7bcf9e72e82d3a81ed75b0aa2603af;hpb=f24f8409b041727329e980fdc81e84a7c9b00e5b;p=wimlib diff --git a/src/mount_image.c b/src/mount_image.c index b1a3f1c7..02a863c9 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -329,7 +329,7 @@ create_dentry(struct fuse_context *fuse_ctx, const char *path, struct wimfs_context *wimfs_ctx = WIMFS_CTX(fuse_ctx); int ret; - parent = get_parent_dentry(wimfs_ctx->wim, path); + parent = get_parent_dentry(wimfs_ctx->wim, path, WIMLIB_CASE_SENSITIVE); if (!parent) return -errno; @@ -337,7 +337,7 @@ create_dentry(struct fuse_context *fuse_ctx, const char *path, return -ENOTDIR; basename = path_basename(path); - if (get_dentry_child_with_name(parent, basename)) + if (get_dentry_child_with_name(parent, basename, WIMLIB_CASE_SENSITIVE)) return -EEXIST; ret = new_dentry_with_inode(basename, &new); @@ -367,6 +367,17 @@ create_dentry(struct fuse_context *fuse_ctx, const char *path, return 0; } +static struct wim_inode * +wim_pathname_to_inode(WIMStruct *wim, const tchar *path) +{ + struct wim_dentry *dentry; + dentry = get_dentry(wim, path, WIMLIB_CASE_SENSITIVE); + if (dentry) + return dentry->d_inode; + else + return NULL; +} + /* Remove a dentry from a mounted WIM image; i.e. remove an alias for the * corresponding inode. * @@ -569,8 +580,7 @@ extract_resource_to_staging_dir(struct wim_inode *inode, struct filedes wimlib_fd; filedes_init(&wimlib_fd, fd); extract_size = min(old_lte->size, size); - ret = extract_wim_resource_to_fd(old_lte, &wimlib_fd, - extract_size); + ret = extract_stream_to_fd(old_lte, &wimlib_fd, extract_size); } else { ret = 0; extract_size = 0; @@ -1667,7 +1677,7 @@ wimfs_getxattr(const char *path, const char *name, char *value, if (stream_size > size) return -ERANGE; - ret = read_full_resource_into_buf(lte, value); + ret = read_full_stream_into_buf(lte, value); if (ret) { if (errno) return -errno; @@ -1696,14 +1706,15 @@ wimfs_link(const char *to, const char *from) FILE_ATTRIBUTE_REPARSE_POINT)) return -EPERM; - from_dentry_parent = get_parent_dentry(wim, from); + from_dentry_parent = get_parent_dentry(wim, from, WIMLIB_CASE_SENSITIVE); if (!from_dentry_parent) return -errno; if (!dentry_is_directory(from_dentry_parent)) return -ENOTDIR; link_name = path_basename(from); - if (get_dentry_child_with_name(from_dentry_parent, link_name)) + if (get_dentry_child_with_name(from_dentry_parent, link_name, + WIMLIB_CASE_SENSITIVE)) return -EEXIST; ret = new_dentry(link_name, &from_dentry); @@ -1942,9 +1953,9 @@ wimfs_read(const char *path, char *buf, size_t size, ret = -errno; break; case RESOURCE_IN_WIM: - if (read_partial_wim_resource_into_buf(fd->f_lte, size, - offset, buf)) - ret = -errno; + if (read_partial_wim_stream_into_buf(fd->f_lte, size, + offset, buf)) + ret = errno ? -errno : -EIO; else ret = size; break; @@ -2085,7 +2096,8 @@ wimfs_removexattr(const char *path, const char *name) static int wimfs_rename(const char *from, const char *to) { - return rename_wim_path(wimfs_get_WIMStruct(), from, to); + return rename_wim_path(wimfs_get_WIMStruct(), from, to, + WIMLIB_CASE_SENSITIVE); } /* Remove a directory */ @@ -2095,7 +2107,7 @@ wimfs_rmdir(const char *path) struct wim_dentry *dentry; WIMStruct *wim = wimfs_get_WIMStruct(); - dentry = get_dentry(wim, path); + dentry = get_dentry(wim, path, WIMLIB_CASE_SENSITIVE); if (!dentry) return -errno; @@ -2263,7 +2275,7 @@ wimfs_utimens(const char *path, const struct timespec tv[2]) struct wim_inode *inode; WIMStruct *wim = wimfs_get_WIMStruct(); - dentry = get_dentry(wim, path); + dentry = get_dentry(wim, path, WIMLIB_CASE_SENSITIVE); if (!dentry) return -errno; inode = dentry->d_inode; @@ -2290,7 +2302,7 @@ wimfs_utime(const char *path, struct utimbuf *times) struct wim_inode *inode; WIMStruct *wim = wimfs_get_WIMStruct(); - dentry = get_dentry(wim, path); + dentry = get_dentry(wim, path, WIMLIB_CASE_SENSITIVE); if (!dentry) return -errno; inode = dentry->d_inode;