From 67be54fb64cfcd63dfe3638c507aa7f29bd86ec5 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 15 Oct 2025 13:43:39 -0400 Subject: kern: vfs: Make vnode r/w operations offset aware Adds offset handling to the vnode read and write callbacks. Signed-off-by: Ian Moffett --- src/sys/include/os/vnode.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/sys/include/os/vnode.h') diff --git a/src/sys/include/os/vnode.h b/src/sys/include/os/vnode.h index 868e137..9054a55 100644 --- a/src/sys/include/os/vnode.h +++ b/src/sys/include/os/vnode.h @@ -72,11 +72,13 @@ struct vop_lookup_args { * * @data: Buffer containing I/O data * @len: Length of buffer + * @off: Offset of operation * @vp: Current vnode */ struct vop_rw_data { void *data; size_t len; + off_t off; struct vnode *vp; }; @@ -141,23 +143,25 @@ int vfs_vrel(struct vnode *vp, int flags); * * @vp: Vnode to write to * @data: Data to write + * @off: Offset to write at * @len: Length of bytes to write * * Returns the number of bytes written on success, otherwise * a less than zero value on failure. */ -ssize_t vop_write(struct vnode *vp, char *data, size_t len); +ssize_t vop_write(struct vnode *vp, char *data, off_t off, size_t len); /* * Wrapper for the read write callback * * @vp: Vnode to read from * @data: Read data written here + * @off: Offset to read at * @len: Length of bytes to read * * Returns the number of bytes read on success, otherwise * a less than zero value on failure. */ -ssize_t vop_read(struct vnode *vp, char *data, size_t len); +ssize_t vop_read(struct vnode *vp, char *data, off_t off, size_t len); #endif /* !_OS_VNODE_H_ */ -- cgit v1.2.3