summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/procfs.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/vfs/procfs.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/vfs/procfs.c')
-rw-r--r--src/kernel/vfs/procfs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/kernel/vfs/procfs.c b/src/kernel/vfs/procfs.c
index ab57628..b0ebbe0 100644
--- a/src/kernel/vfs/procfs.c
+++ b/src/kernel/vfs/procfs.c
@@ -99,8 +99,8 @@ procfs_accept(VfsReq *req)
assert(root->pns == root);
if (req->type == VFSOP_OPEN) {
- assert(req->input.kern);
- h = openpath(req->input.buf_kern, req->input.len, root);
+ assert(req->kin);
+ h = openpath(req->kin, req->kinlen, root);
vfsreq_finish_short(req, h ? (long)h : -ENOENT);
return;
} else if (req->type == VFSOP_CLOSE) {
@@ -143,16 +143,16 @@ procfs_accept(VfsReq *req)
return;
}
size_t res = pcpy_bi(
- req->caller, req->output.buf,
+ req->caller, req->out,
p, (__user void*)req->offset,
- req->output.len
+ req->outlen
);
vfsreq_finish_short(req, res);
} else if (req->type == VFSOP_WRITE &&
(h->type == PhIntr || h->type == PhIntrDown))
{
- 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);
if (h->type == PhIntr) {
proc_intr(p, buf, len);
} else {
@@ -160,7 +160,7 @@ procfs_accept(VfsReq *req)
proc_intr(it, buf, len);
}
}
- vfsreq_finish_short(req, req->input.len);
+ vfsreq_finish_short(req, req->uinlen);
} else {
vfsreq_finish_short(req, -ENOSYS);
}