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/arch/amd64/driver/util.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/kernel/arch') diff --git a/src/kernel/arch/amd64/driver/util.c b/src/kernel/arch/amd64/driver/util.c index 0f0ee34..2b33849 100644 --- a/src/kernel/arch/amd64/driver/util.c +++ b/src/kernel/arch/amd64/driver/util.c @@ -26,6 +26,7 @@ bool postqueue_pop(VfsReq **queue, void (*accept)(VfsReq *)) { VfsReq *req = *queue; if (req == NULL) return false; *queue = req->postqueue_next; + req->postqueue_next = NULL; accept(req); return true; } @@ -45,6 +46,7 @@ void postqueue_ringreadall(VfsReq **queue, ring_t *r) { while (*queue) { req = *queue; *queue = req->postqueue_next; + req->postqueue_next = NULL; size_t ret = min(mlen, req->output.len); assert(req->type == VFSOP_READ); -- cgit v1.2.3