summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
diff options
context:
space:
mode:
authordzwdz2022-04-16 20:04:52 +0200
committerdzwdz2022-04-16 20:04:52 +0200
commit749a079f9538c168c7a9adf03d919f00f09546fb (patch)
treeed85b3267cd921ecb02db76e61f3cb2834cd9e8d /src/kernel/syscalls.c
parente55ace0f517ede6f3635341c8adadc7b90aa75c5 (diff)
kernel/vfs: refactor `vfs_request_accept` into `vfs_backend_accept`
handling the backend queue makes more sense here than in the syscall implementation. it's also just overall cleaner
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r--src/kernel/syscalls.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index b424bf1..b21eb5b 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -209,18 +209,12 @@ int _syscall_fs_wait(char __user *buf, int max_len, struct fs_wait_response __us
assert(!backend->handler); // TODO allow multiple processes to wait on the same backend
backend->handler = process_current;
/* checking the validity of those pointers here would make
- * vfs_request_accept simpler. TODO? */
+ * vfs_backend_accept simpler. TODO? */
process_current->awaited_req.buf = buf;
process_current->awaited_req.max_len = max_len;
process_current->awaited_req.res = res;
- if (backend->queue) {
- // handle queued requests
- struct process *queued = backend->queue;
- backend->queue = queued->waits4fs.queue_next;
- return vfs_request_accept(&queued->waits4fs.req);
- }
- return -1;
+ return vfs_backend_accept(backend);
}
int _syscall_fs_respond(char __user *buf, int ret) {