summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-11-21 13:48:31 -0500
committerIan Moffett <ian@osmora.org>2025-11-21 13:48:31 -0500
commit794b3671ed636c4fb8a74e1cf3a636272d4fa3d9 (patch)
tree8cbfcf90cd3f680756263b91921b332050773365 /sys/kern/vfs_subr.c
parentfe5a7b301f4700c806570fbea0e564a180d8a5a9 (diff)
kern: vfs: Add vnode lookup VOP
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 2c08f36..c8e3170 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -139,3 +139,27 @@ vnode_write(struct vnode *vp, const void *buf, size_t size, off_t off)
args.offset = off;
return vops->write(&args);
}
+
+int
+vnode_lookup(struct vnode *vp, const char *name, struct vnode **res)
+{
+ struct vop_lookup_args args;
+ struct vops *vops;
+
+ if (vp == NULL || name == NULL) {
+ return -EINVAL;
+ }
+
+ if (res == NULL) {
+ return -EINVAL;
+ }
+
+ vops = &vp->vops;
+ if (vops->lookup == NULL) {
+ return -ENOTSUP;
+ }
+
+ args.component = name;
+ args.vp_res = res;
+ return vops->lookup(&args);
+}