summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
diff options
context:
space:
mode:
authordzwdz2022-05-05 19:58:49 +0200
committerdzwdz2022-05-05 19:58:49 +0200
commit3beaeaadf36de4e494d0b40ad31e3c5c503c596e (patch)
treece19bb5d1e9184e88d672e1d0d651f52dfeafa06 /src/kernel/syscalls.c
parente7d6d031e54ef1b1c7b589648a27eea84994549f (diff)
kernel/vfs: refactor vfs_backend to allow multiple kernel backends
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r--src/kernel/syscalls.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 1e33632..1ec8ed9 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -180,10 +180,10 @@ handle_t _syscall_fs_fork2(void) {
process_current->handles[front] = handle_init(HANDLE_FS_FRONT);
backend = kmalloc(sizeof *backend); // TODO never freed
- backend->type = VFS_BACK_USER;
+ backend->is_user = true;
backend->potential_handlers = 1;
backend->refcount = 2; // child + handle
- backend->handler = NULL;
+ backend->user.handler = NULL;
backend->queue = NULL;
child = process_fork(process_current, 0);
@@ -200,15 +200,15 @@ int _syscall_fs_wait(char __user *buf, int max_len, struct fs_wait_response __us
if (!backend) return -1;
process_transition(process_current, PS_WAITS4REQUEST);
- assert(!backend->handler); // TODO allow multiple processes to wait on the same backend
- backend->handler = process_current;
+ assert(!backend->user.handler); // TODO allow multiple processes to wait on the same backend
+ backend->user.handler = process_current;
/* checking the validity of those pointers here would make
* 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;
- return vfs_backend_accept(backend);
+ return vfs_backend_tryaccept(backend);
}
int _syscall_fs_respond(char __user *buf, int ret) {