From 794b3671ed636c4fb8a74e1cf3a636272d4fa3d9 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 21 Nov 2025 13:48:31 -0500 Subject: kern: vfs: Add vnode lookup VOP Signed-off-by: Ian Moffett --- sys/kern/vfs_subr.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'sys/kern') 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); +} -- cgit v1.2.3