From fe5a7b301f4700c806570fbea0e564a180d8a5a9 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 21 Nov 2025 13:44:40 -0500 Subject: kern: vfs: Add vnode VOP wrappers Signed-off-by: Ian Moffett --- sys/inc/kern/vnode.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'sys/inc/kern') 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 @@ -77,6 +77,31 @@ struct vnode { void *data; }; +/* + * 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 * -- cgit v1.2.3