summaryrefslogtreecommitdiff
path: root/sys/inc
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-11-21 13:44:40 -0500
committerIan Moffett <ian@osmora.org>2025-11-21 13:44:40 -0500
commitfe5a7b301f4700c806570fbea0e564a180d8a5a9 (patch)
tree1304ae420e883891aa804340fbc7b584463e9bea /sys/inc
parentd4f54c32f593e1d34663f4e287b452c83da19ba1 (diff)
kern: vfs: Add vnode VOP wrappers
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/inc')
-rw-r--r--sys/inc/kern/vnode.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/inc/kern/vnode.h b/sys/inc/kern/vnode.h
index b50042d..37b7127 100644
--- a/sys/inc/kern/vnode.h
+++ b/sys/inc/kern/vnode.h
@@ -78,6 +78,31 @@ struct vnode {
};
/*
+ * Read the contents of a file described by a vnode into
+ * a buffer
+ *
+ * @vp: Vnode to read
+ * @buf: Buffer to read file into
+ * @size: Number of bytes to read
+ * @off: Offset to read starting at
+ *
+ * Returns the number of bytes read
+ */
+ssize_t vnode_read(struct vnode *vp, void *buf, size_t size, off_t off);
+
+/*
+ * Write data into a file described by a vnode
+ *
+ * @vp: Vnode to write
+ * @buf: Buffer to write from
+ * @size: Length of data to write
+ * @off: Offset to write at
+ *
+ * Returns the number of bytes written
+ */
+ssize_t vnode_write(struct vnode *vp, const void *buf, size_t size, off_t off);
+
+/*
* Initialize a vnode by type
*
* @vp_res: Vnode pointer result