diff options
author | Ian Moffett <ian@osmora.org> | 2024-03-26 21:49:29 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-03-26 21:49:29 -0400 |
commit | ea0630ef550a3ed7bc38d54c8acab6c7ed075aba (patch) | |
tree | a0993841e927901033d23b9f024620343e4e5290 /sys/fs/initramfs.c | |
parent | e9f8c899812264dbca35efd4d2373b597e3c0a27 (diff) |
kernel: Use 'sio_txn' for file I/O
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/fs/initramfs.c')
-rw-r--r-- | sys/fs/initramfs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/fs/initramfs.c b/sys/fs/initramfs.c index 5b31bf9..897a3d4 100644 --- a/sys/fs/initramfs.c +++ b/sys/fs/initramfs.c @@ -121,11 +121,12 @@ vop_vget(struct vnode *parent, const char *name, struct vnode **vp) } static int -vop_read(struct vnode *vp, char *buf, size_t count) +vop_read(struct vnode *vp, struct sio_txn *sio) { struct tar_hdr *hdr; size_t size; char *contents; + char *buf = sio->buf; if (vp->data == NULL) { return -EIO; @@ -135,14 +136,14 @@ vop_read(struct vnode *vp, char *buf, size_t count) size = getsize(hdr->size); contents = hdr_to_contents(hdr); - for (size_t i = 0; i < count; ++i) { + for (size_t i = sio->offset; i < sio->len; ++i) { if (i >= size) { return i + 1; } buf[i] = contents[i]; } - return count; + return sio->len; } static char * |