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/inc/kern/vnode.h | |
| parent | fe5a7b301f4700c806570fbea0e564a180d8a5a9 (diff) | |
kern: vfs: Add vnode lookup VOP
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/inc/kern/vnode.h')
| -rw-r--r-- | sys/inc/kern/vnode.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/inc/kern/vnode.h b/sys/inc/kern/vnode.h index 37b7127..407811a 100644 --- a/sys/inc/kern/vnode.h +++ b/sys/inc/kern/vnode.h @@ -54,11 +54,23 @@ struct vop_buf_args { }; /* + * Arguments for lookup() vop + * + * @component: Path component to lookup + * @vp_res: Resulting vnode pointer + */ +struct vop_lookup_args { + const char *component; + struct vnode **vp_res; +}; + +/* * Operations that can be performed on a vnode */ struct vops { ssize_t(*read)(struct vop_buf_args *args); ssize_t(*write)(struct vop_buf_args *args); + int(*lookup)(struct vop_lookup_args *args); void(*reclaim)(struct vnode *vp); }; @@ -91,6 +103,17 @@ struct vnode { ssize_t vnode_read(struct vnode *vp, void *buf, size_t size, off_t off); /* + * Lookup a sub-node within a vnode by name + * + * @vp: Vnode to scan within + * @name: Name to lookup + * @res: Result pointer is written here + * + * Returns zero on success + */ +int vnode_lookup(struct vnode *vp, const char *name, struct vnode **res); + +/* * Write data into a file described by a vnode * * @vp: Vnode to write |
