From d68537c1ca22d58f1c219d970d5aa462df9e0c6b Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 22 Feb 2025 02:18:33 -0500 Subject: kernel: vfs: Add support for write() Signed-off-by: Ian Moffett --- sys/kern/vfs_subr.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sys/kern/vfs_subr.c') diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index f67bcfe..da0a4f9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -166,6 +166,19 @@ vfs_vop_read(struct vnode *vp, struct sio_txn *sio) return vops->read(vp, sio); } +int +vfs_vop_write(struct vnode *vp, struct sio_txn *sio) +{ + const struct vops *vops = vp->vops; + + if (vops == NULL) + return -EIO; + if (vops->write == NULL) + return -EIO; + + return vops->write(vp, sio); +} + int vfs_vop_getattr(struct vnode *vp, struct vop_getattr_args *args) { -- cgit v1.2.3