summaryrefslogtreecommitdiff
path: root/src/sys/include/os
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-18 18:25:34 -0400
committerIan Moffett <ian@osmora.org>2025-09-18 18:25:34 -0400
commitac93c35a842936a4f722b85ea3b4d3ff872123f9 (patch)
treeb61d0283296deafd69035177f0cbd619761942e8 /src/sys/include/os
parent999e089f48cabb94a2911744bc5f5d500f4a6bd0 (diff)
kern: vfs: Add vnode allocation / release routines
Introduce routines to allocate (create) and deallocate (destroy) virtual file nodes. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include/os')
-rw-r--r--src/sys/include/os/vnode.h27
1 files changed, 25 insertions, 2 deletions
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_ */