Skip to content
Snippets Groups Projects
Commit f1ee72ed authored by Raphael S. Carvalho's avatar Raphael S. Carvalho Committed by Pekka Enberg
Browse files

vfs: Introduce vop_eperm


vop_eperm allows more code reuse (suggested by Glauber Costa)

Signed-off-by: default avatarRaphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 3587c3f1
No related branches found
No related tags found
No related merge requests found
......@@ -187,12 +187,6 @@ devfs_readdir(struct vnode *vp, struct file *fp, struct dirent *dir)
return 0;
}
static int
devfs_link(struct vnode *tdvp, struct vnode *svp, char *name)
{
return EPERM;
}
int
devfs_init(void)
{
......@@ -216,6 +210,7 @@ devfs_init(void)
#define devfs_setattr ((vnop_setattr_t)vop_nullop)
#define devfs_inactive ((vnop_inactive_t)vop_nullop)
#define devfs_truncate ((vnop_truncate_t)vop_nullop)
#define devfs_link ((vnop_link_t)vop_eperm)
/*
* vnode operations
......
......@@ -431,12 +431,6 @@ ramfs_readdir(struct vnode *vp, struct file *fp, struct dirent *dir)
return 0;
}
static int
ramfs_link(struct vnode *tdvp, struct vnode *svp, char *name)
{
return EPERM;
}
int
ramfs_init(void)
{
......@@ -451,6 +445,7 @@ ramfs_init(void)
#define ramfs_getattr ((vnop_getattr_t)vop_nullop)
#define ramfs_setattr ((vnop_setattr_t)vop_nullop)
#define ramfs_inactive ((vnop_inactive_t)vop_nullop)
#define ramfs_link ((vnop_link_t)vop_eperm)
/*
* vnode operations
......
......@@ -481,6 +481,13 @@ vop_einval(void)
return EINVAL;
}
int
vop_eperm(void)
{
return EPERM;
}
/*
* vnode_init() is called once (from vfs_init)
* in initialization.
......
......@@ -190,6 +190,7 @@ struct vnops {
int vop_nullop(void);
int vop_einval(void);
int vop_eperm(void);
struct vnode *vn_lookup(struct mount *, char *);
void vn_lock(struct vnode *);
void vn_unlock(struct vnode *);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment