From badde3808a8a2ef512ae52af5d91f419585e27fd Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 12 Sep 2021 18:02:12 +0200 Subject: allow vfs_request_finish to return thanks to this, the fs provider can continue executing until the next fs_wait() call. that should speed things up a bit --- src/kernel/syscalls.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/kernel/syscalls.c') diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index b247619..18ecd25 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -87,7 +87,7 @@ handle_t _syscall_open(const char __user *path, int len) { mount = vfs_mount_resolve(process_current->mount, path_buf, len); if (!mount) goto fail; - vfs_request_create((struct vfs_request) { + return vfs_request_create((struct vfs_request) { .type = VFSOP_OPEN, .input = { .kern = true, @@ -97,7 +97,6 @@ handle_t _syscall_open(const char __user *path, int len) { .caller = process_current, .backend = mount->backend, }); - // doesn't return / fallthrough to fail fail: kfree(path_buf); @@ -145,7 +144,7 @@ int _syscall_write(handle_t handle_num, const char __user *buf, int len) { struct handle *handle = &process_current->handles[handle_num]; if (handle_num < 0 || handle_num >= HANDLE_MAX) return -1; if (handle->type != HANDLE_FILE) return -1; - vfs_request_create((struct vfs_request) { + return vfs_request_create((struct vfs_request) { .type = VFSOP_WRITE, .input = { .buf = (userptr_t) buf, @@ -155,7 +154,6 @@ int _syscall_write(handle_t handle_num, const char __user *buf, int len) { .caller = process_current, .backend = handle->file.backend, }); - return -1; } int _syscall_close(handle_t handle) { -- cgit v1.2.3