From ac93c35a842936a4f722b85ea3b4d3ff872123f9 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 18 Sep 2025 18:25:34 -0400 Subject: kern: vfs: Add vnode allocation / release routines Introduce routines to allocate (create) and deallocate (destroy) virtual file nodes. Signed-off-by: Ian Moffett --- src/sys/include/os/vnode.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/sys/include') diff --git a/src/sys/include/os/vnode.h b/src/sys/include/os/vnode.h index 9549730..0c89702 100644 --- a/src/sys/include/os/vnode.h +++ b/src/sys/include/os/vnode.h @@ -82,12 +82,35 @@ struct vop { * [V] Set up by VFS * [D/V]: Both D and V * - * @vtype: Vnode type [D/V] + * @type: Vnode type [D/V] * @vops: Vnode operations hooks [D] */ struct vnode { - vtype_t vtype; + vtype_t type; struct vop *vops; }; +/* + * Allocate a new vnode + * + * @resp: Result pointer is written here + * @type: Vnode type + * @flags: Optional flags + * + * Return zero on success, otherwise a less than zero + * on failure. + */ +int vfs_valloc(struct vnode **resp, vtype_t type, int flags); + +/* + * Deallocate / release a vnode + * + * @vp: Vnode to release + * @flags: Optional flags + * + * Returns zero on success, otherwise less than zero + * on failure. + */ +int vfs_vrel(struct vnode *vp, int flags); + #endif /* !_OS_VNODE_H_ */ -- cgit v1.2.3