From ed8ff1ff9c4c0f847ffc2ab4624bd999539a0890 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 11 Jul 2024 21:43:50 +0200 Subject: kernel: start cleaning up VfsRequest * I'm being more strict about the linked list state to hopefully ensure I'm not leaking any references. * vfsreq_create was renamed to vfsreq_dispatchcopy as that name feels more clear. It copies its argument, and dispatches it. * Requests for user backends are now handled more like requests for kernel backends - there's an accept() function that accepts a request. --- src/kernel/handle.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/kernel/handle.c') diff --git a/src/kernel/handle.c b/src/kernel/handle.c index f216c13..06a810c 100644 --- a/src/kernel/handle.c +++ b/src/kernel/handle.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -22,7 +23,7 @@ void handle_close(Handle *h) { if (h->base) { handle_close(h->base); } else { - vfsreq_create((VfsReq) { + vfsreq_dispatchcopy((VfsReq) { .type = VFSOP_CLOSE, .id = h->file_id, .caller = NULL, @@ -36,7 +37,7 @@ void handle_close(Handle *h) { h->pipe.sister->pipe.sister = NULL; } } else if (h->type == HANDLE_FS_REQ) { - if (h->req) vfsreq_finish_short(h->req, -1); + if (h->req) vfsreq_finish_short(h->req, -EPIPE); } if (h->backend) { -- cgit v1.2.3