summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r--src/kernel/syscalls.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 39115e7..1e1cd2f 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -39,11 +39,11 @@ long _sys_fork(int flags, hid_t __user *fs_front) {
}
h->backend = kzalloc(sizeof *h->backend, "user fs");
- h->backend->is_user = true;
- h->backend->provhcnt = 1; /* child */
h->backend->usehcnt = 1; /* handle */
+ h->backend->is_user = true;
+ h->backend->user.provhcnt = 1;
h->backend->user.handler = NULL;
- h->backend->queue = NULL;
+ reqqueue_init(&h->backend->user.queue);
child->controlled = h->backend;
if (fs_front) {
@@ -261,6 +261,7 @@ hid_t _sys_fs_wait(char __user *buf, long max_len, struct ufs_request __user *re
/* nothing on the other end. EPIPE seems fitting */
SYSCALL_RETURN(-EPIPE);
}
+ assert(backend->is_user);
proc_setstate(proc_cur, PS_WAITS4REQUEST);
if (backend->user.handler)
@@ -270,11 +271,8 @@ hid_t _sys_fs_wait(char __user *buf, long max_len, struct ufs_request __user *re
proc_cur->awaited_req.max_len = max_len;
proc_cur->awaited_req.res = res;
- // TODO maybe i should use the postqueue stuff here
- if (backend->queue) {
- VfsReq *req = backend->queue;
- backend->queue = req->queue_next;
- req->queue_next = NULL;
+ VfsReq *req = reqqueue_pop(&backend->user.queue);
+ if (req) {
vfsback_useraccept(req);
}