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;
+
+}
+
static void inode_update_lte_ptr(struct inode *inode,
struct lookup_table_entry *old_lte,
struct lookup_table_entry *new_lte)
lte->refcnt++;
}
- link_dentry(from_dentry, from_dentry_parent);
+ dentry_add_child(from_dentry_parent, from_dentry);
return 0;
}
newdir->d_inode->attributes |= FILE_ATTRIBUTE_DIRECTORY;
newdir->d_inode->resolved = true;
newdir->d_inode->ino = ctx->next_ino++;
- link_dentry(newdir, parent);
+ dentry_add_child(parent, newdir);
return 0;
}
return -ENOMEM;
dentry->d_inode->resolved = true;
dentry->d_inode->ino = ctx->next_ino++;
- link_dentry(dentry, parent);
+ dentry_add_child(parent, dentry);
}
return 0;
}
src->file_name_utf8_len = file_name_utf8_len;
unlink_dentry(src);
- link_dentry(src, parent_of_dst);
+ dentry_add_child(parent_of_dst, src);
return 0;
}
if (inode_set_symlink(inode, to, ctx->wim->lookup_table, NULL) != 0)
goto out_free_dentry;
- link_dentry(dentry, dentry_parent);
+ dentry_add_child(dentry_parent, dentry);
return 0;
out_free_dentry:
free_dentry(dentry);
static struct fuse_operations wimfs_operations = {
.access = wimfs_access,
+ .chmod = wimfs_chmod,
.destroy = wimfs_destroy,
#if 0
.fallocate = wimfs_fallocate,