summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/driver/pata.c
diff options
context:
space:
mode:
authordzwdz2024-08-17 01:57:04 +0200
committerdzwdz2024-08-17 01:57:04 +0200
commit468ef8f1d57527af3fe8b67bbc73813e951a0ec5 (patch)
tree0e10641f6bc7548bdb0dbd77cd5c4737977a197b /src/kernel/arch/amd64/driver/pata.c
parent806eecd7a2fe12daccf2c7c7171ce52e3fd93799 (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/pata.c')
-rw-r--r--src/kernel/arch/amd64/driver/pata.c12
1 files changed, 6 insertions, 6 deletions
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);