- return 0;
-}
-
-static int wimfs_access(const char *path, int mask)
-{
- /* Permissions not implemented */
- return 0;
-}
-
-static int wimfs_chmod(const char *path, mode_t mask)
-{
- struct dentry *dentry;
- struct wimfs_context *ctx = wimfs_get_context();
- struct inode *inode;
- struct stat stbuf;
- int ret;
-
- ret = lookup_resource(ctx->wim, path,
- get_lookup_flags(ctx) | LOOKUP_FLAG_DIRECTORY_OK,
- &dentry, NULL, NULL);
- if (ret != 0)
- return ret;
- inode = dentry->d_inode;
- inode_to_stbuf(inode, NULL, &stbuf);
- if (mask == stbuf.st_mode)
- return 0;
- else
- return -EPERM;
-}
-
-/* Called when the filesystem is unmounted. */
-static void wimfs_destroy(void *p)
-{
- struct wimfs_context *wimfs_ctx = wimfs_get_context();
- if (open_message_queues(wimfs_ctx, true) == 0) {
- struct msg_handler_context handler_ctx = {
- .timeout_seconds = 5,
- .daemon = {
- .wimfs_ctx = wimfs_ctx,
- },
- };
- message_loop(wimfs_ctx->unmount_to_daemon_mq,
- &daemon_msg_handler_callbacks,
- &handler_ctx);
- close_message_queues(wimfs_ctx);
- }
-}
-
-#if 0
-static int wimfs_fallocate(const char *path, int mode,
- off_t offset, off_t len, struct fuse_file_info *fi)
-{
- struct wimlib_fd *fd = (struct wimlib_fd*)(uintptr_t)fi->fh;
- wimlib_assert(fd->staging_fd != -1);
- return fallocate(fd->staging_fd, mode, offset, len);
-}
-
-#endif
-
-static int wimfs_fgetattr(const char *path, struct stat *stbuf,
- struct fuse_file_info *fi)
-{
- struct wimlib_fd *fd = (struct wimlib_fd*)(uintptr_t)fi->fh;
- return inode_to_stbuf(fd->f_inode, fd->f_lte, stbuf);
-}
-
-static int wimfs_ftruncate(const char *path, off_t size,
- struct fuse_file_info *fi)
-{
- struct wimlib_fd *fd = (struct wimlib_fd*)(uintptr_t)fi->fh;
- int ret = ftruncate(fd->staging_fd, size);
- if (ret != 0)
- return -errno;
- if (fd->f_lte && size < fd->f_lte->resource_entry.original_size)
- fd->f_lte->resource_entry.original_size = size;
- return 0;
-}
-
-/*
- * Fills in a `struct stat' that corresponds to a file or directory in the WIM.
- */
-static int wimfs_getattr(const char *path, struct stat *stbuf)
-{
- struct dentry *dentry;
- struct lookup_table_entry *lte;
- int ret;
- struct wimfs_context *ctx = wimfs_get_context();
-
- ret = lookup_resource(ctx->wim, path,
- get_lookup_flags(ctx) | LOOKUP_FLAG_DIRECTORY_OK,
- &dentry, <e, NULL);
- if (ret != 0)
- return ret;
- return inode_to_stbuf(dentry->d_inode, lte, stbuf);
-}
-
-#ifdef ENABLE_XATTR
-/* Read an alternate data stream through the XATTR interface, or get its size */
-static int wimfs_getxattr(const char *path, const char *name, char *value,
- size_t size)
-{
- int ret;
- struct inode *inode;
- struct ads_entry *ads_entry;
- size_t res_size;
- struct lookup_table_entry *lte;
- struct wimfs_context *ctx = wimfs_get_context();