summaryrefslogtreecommitdiff
path: root/src/sys/os/vfs_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/os/vfs_subr.c')
-rw-r--r--src/sys/os/vfs_subr.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/sys/os/vfs_subr.c b/src/sys/os/vfs_subr.c
index 6cb7767..0e8c605 100644
--- a/src/sys/os/vfs_subr.c
+++ b/src/sys/os/vfs_subr.c
@@ -224,3 +224,46 @@ vop_reclaim(struct vnode *vp, int flags)
return vops->reclaim(vp, flags);
}
+
+int
+vop_create(struct vnode *vp, struct nameidata *ndp, vtype_t type)
+{
+ struct vop *vops;
+ struct vop_create_args args;
+
+ if (vp == NULL || ndp == NULL) {
+ return -EINVAL;
+ }
+
+ if ((vops = vp->vops) == NULL) {
+ return -EIO;
+ }
+
+ if (vops->create == NULL) {
+ return -EIO;
+ }
+
+ 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);
+}