Added vfs_create() to create files and directories.

Moved mkdir to mknod so that mknod is the common handler for all node creation.
This commit is contained in:
Bahadir Balban
2008-02-16 15:22:08 +00:00
parent 08b1e0e42c
commit 0fdc64ba2d
5 changed files with 74 additions and 37 deletions

View File

@@ -204,7 +204,11 @@ int memfs_write_vnode(struct superblock *sb, struct vnode *v)
return 0;
}
int memfs_vnode_mkdir(struct vnode *v, char *dirname)
/*
* Creates ordinary files and directories at the moment. In the future,
* other file types will be added.
*/
int memfs_vnode_mknod(struct vnode *v, char *dirname, unsigned int mode)
{
struct dentry *d, *parent = list_entry(v->dentries.next,
struct dentry, vref);
@@ -368,7 +372,7 @@ int memfs_vnode_readdir(struct vnode *v)
struct vnode_ops memfs_vnode_operations = {
.readdir = memfs_vnode_readdir,
.mkdir = memfs_vnode_mkdir,
.mknod = memfs_vnode_mknod,
};
struct superblock_ops memfs_superblock_operations = {