diff options
| author | Ian Moffett <ian@osmora.org> | 2025-11-21 13:48:31 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-11-21 13:48:31 -0500 |
| commit | 794b3671ed636c4fb8a74e1cf3a636272d4fa3d9 (patch) | |
| tree | 8cbfcf90cd3f680756263b91921b332050773365 /sys/kern/vfs_subr.c | |
| parent | fe5a7b301f4700c806570fbea0e564a180d8a5a9 (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.c | 24 |
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); +} |
