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.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 9b0746a..5771b6a 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -85,7 +85,7 @@ hid_t _sys_open(const char __user *path, long len, int flags) {
memcpy(path_buf, path_buf + mount->prefix_len, len);
}
- vfsreq_create((VfsReq) {
+ vfsreq_dispatchcopy((VfsReq) {
.type = VFSOP_OPEN,
.input = {
.kern = true,
@@ -198,7 +198,7 @@ static long simple_vfsop(
req.input.buf = buf;
req.input.len = len;
}
- vfsreq_create(req);
+ vfsreq_dispatchcopy(req);
} else if (h->type == HANDLE_PIPE) {
if (vfsop == VFSOP_READ || vfsop == VFSOP_WRITE) {
/* already checked if this is the correct pipe end */
@@ -238,7 +238,7 @@ long _sys_remove(hid_t hid) {
hs_close(proc_cur->hs, hid);
SYSCALL_RETURN(-EACCES);
}
- vfsreq_create((VfsReq) {
+ vfsreq_dispatchcopy((VfsReq) {
.type = VFSOP_REMOVE,
.id = h->file_id,
.caller = proc_cur,
@@ -271,7 +271,14 @@ 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;
- vfs_backend_tryaccept(backend); // sets return value
+ // 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;
+ vfsback_useraccept(req);
+ }
+
return -1; // dummy
}