diff options
Diffstat (limited to 'src/sys/os/vfs_subr.c')
-rw-r--r-- | src/sys/os/vfs_subr.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/sys/os/vfs_subr.c b/src/sys/os/vfs_subr.c index adfcffb..0e8c605 100644 --- a/src/sys/os/vfs_subr.c +++ b/src/sys/os/vfs_subr.c @@ -226,7 +226,7 @@ vop_reclaim(struct vnode *vp, int flags) } int -vop_create(struct vnode *vp, struct nameidata *ndp) +vop_create(struct vnode *vp, struct nameidata *ndp, vtype_t type) { struct vop *vops; struct vop_create_args args; @@ -244,5 +244,26 @@ vop_create(struct vnode *vp, struct nameidata *ndp) } args.ndp = ndp; + args.vtype = type; return vops->create(&args); } + +int +vop_getattr(struct vnode *vp, struct vattr *res) +{ + struct vop *vops; + + if (vp == NULL || res == NULL) { + return -EINVAL; + } + + if ((vops = vp->vops) == NULL) { + return -EIO; + } + + if (vops->getattr == NULL) { + return -EIO; + } + + return vops->getattr(vp, res); +} |