From 468ef8f1d57527af3fe8b67bbc73813e951a0ec5 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 17 Aug 2024 01:57:04 +0200 Subject: kernel: split the kernel/user inputs in VfsReq I think I've done this refactor in the opposite direction a few years ago. This is mostly meant to prepare me for setxattr, which requires two inputs - coincidentally, one is already going to be a kernel input, and the other will be an user input, so it works out. I also just didn't like the previous way it worked, this feels cleaner. --- src/kernel/arch/amd64/driver/time.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/kernel/arch/amd64/driver/time.c') diff --git a/src/kernel/arch/amd64/driver/time.c b/src/kernel/arch/amd64/driver/time.c index f47cb74..5ec28b9 100644 --- a/src/kernel/arch/amd64/driver/time.c +++ b/src/kernel/arch/amd64/driver/time.c @@ -52,9 +52,8 @@ handle(VfsReq *req) case VFSOP_GETSIZE: return 8; case VFSOP_WRITE: - if (req->input.len == 8) { - assert(!req->input.kern); - if (pcpy_from(req->caller, u.buf, req->input.buf, sizeof u.buf) != sizeof(u.buf)) { + if (req->uinlen == 8) { + if (pcpy_from(req->caller, u.buf, req->uin, sizeof u.buf) != sizeof(u.buf)) { return -EGENERIC; } h->base = now - u.t; -- cgit v1.2.3