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/pata.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/kernel/arch/amd64/driver/pata.c') diff --git a/src/kernel/arch/amd64/driver/pata.c b/src/kernel/arch/amd64/driver/pata.c index cc6645d..59a43c3 100644 --- a/src/kernel/arch/amd64/driver/pata.c +++ b/src/kernel/arch/amd64/driver/pata.c @@ -47,10 +47,10 @@ static void accept(VfsReq *req) { vfsreq_finish_short(req, req_readcopy(req, list, len)); break; } - fs_normslice(&req->offset, &req->output.len, ata_size(id), false); - len = min(req->output.len, sizeof wbuf); + fs_normslice(&req->offset, &req->outlen, ata_size(id), false); + len = min(req->outlen, sizeof wbuf); ata_read(id, wbuf, len, req->offset); - pcpy_to(req->caller, req->output.buf, wbuf, len); + pcpy_to(req->caller, req->out, wbuf, len); vfsreq_finish_short(req, len); break; @@ -59,10 +59,10 @@ static void accept(VfsReq *req) { vfsreq_finish_short(req, -EACCES); break; } - fs_normslice(&req->offset, &req->input.len, ata_size(id), false); - len = min(req->input.len, sizeof wbuf); + fs_normslice(&req->offset, &req->uinlen, ata_size(id), false); + len = min(req->uinlen, sizeof wbuf); if (len != 0) { - len = pcpy_from(req->caller, wbuf, req->input.buf, len); + len = pcpy_from(req->caller, wbuf, req->uin, len); ata_write(id, wbuf, len, req->offset); } vfsreq_finish_short(req, len); -- cgit v1.2.3