diff options
author | dzwdz | 2024-08-17 01:57:04 +0200 |
---|---|---|
committer | dzwdz | 2024-08-17 01:57:04 +0200 |
commit | 468ef8f1d57527af3fe8b67bbc73813e951a0ec5 (patch) | |
tree | 0e10641f6bc7548bdb0dbd77cd5c4737977a197b /src/kernel/arch/amd64/driver/serial.c | |
parent | 806eecd7a2fe12daccf2c7c7171ce52e3fd93799 (diff) |
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.
Diffstat (limited to 'src/kernel/arch/amd64/driver/serial.c')
-rw-r--r-- | src/kernel/arch/amd64/driver/serial.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kernel/arch/amd64/driver/serial.c b/src/kernel/arch/amd64/driver/serial.c index 76ec33b..bd3966d 100644 --- a/src/kernel/arch/amd64/driver/serial.c +++ b/src/kernel/arch/amd64/driver/serial.c @@ -77,7 +77,7 @@ static void accept(VfsReq *req) { bool valid; switch (req->type) { case VFSOP_OPEN: - valid = req->input.len == 0; + valid = req->kinlen == 0; vfsreq_finish_short(req, valid ? 0 : -1); break; case VFSOP_READ: @@ -87,8 +87,8 @@ static void accept(VfsReq *req) { case VFSOP_WRITE: if (req->caller && !req->flags) { char buf[4096]; - size_t len = min(sizeof buf, req->input.len); - len = pcpy_from(req->caller, buf, req->input.buf, len); + size_t len = min(sizeof buf, req->uinlen); + len = pcpy_from(req->caller, buf, req->uin, len); serial_write(buf, len); ret = len; } else { |