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/util.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/util.c')
-rw-r--r-- | src/kernel/arch/amd64/driver/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kernel/arch/amd64/driver/util.c b/src/kernel/arch/amd64/driver/util.c index f02c4e2..c55e36e 100644 --- a/src/kernel/arch/amd64/driver/util.c +++ b/src/kernel/arch/amd64/driver/util.c @@ -7,10 +7,10 @@ int req_readcopy(VfsReq *req, const void *buf, size_t len) { if (!req->caller) return -1; assert(req->type == VFSOP_READ); - fs_normslice(&req->offset, &req->output.len, len, false); + fs_normslice(&req->offset, &req->outlen, len, false); /* read errors are ignored. TODO write a spec */ - pcpy_to(req->caller, req->output.buf, buf + req->offset, req->output.len); - return req->output.len; + pcpy_to(req->caller, req->out, buf + req->offset, req->outlen); + return req->outlen; } size_t ring_to_virt(ring_t *r, Proc *proc, void __user *ubuf, size_t max) { |