From 6fe8073de975ad7722043f9173fec068178e2eac Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 14 Jul 2024 19:19:35 +0200 Subject: kernel: rework postqueue Keeping its old name for now to make things easier for myself. This might just be replaced by sys/queue.h soon. --- src/kernel/vfs/request.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/kernel/vfs/request.h') diff --git a/src/kernel/vfs/request.h b/src/kernel/vfs/request.h index 06c46e7..616c044 100644 --- a/src/kernel/vfs/request.h +++ b/src/kernel/vfs/request.h @@ -1,5 +1,6 @@ #pragma once #include +#include #include #include @@ -77,3 +78,14 @@ void vfsback_userdown(VfsBackend *); /** Decrements the "provider" reference count. */ void vfsback_provdown(VfsBackend *); + +struct ReqQueue { + VfsReq *head; +}; +void postqueue_init(ReqQueue *q); +void postqueue_join(ReqQueue *q, VfsReq *req); +VfsReq *postqueue_pop(ReqQueue *q); + +/** If there are any pending read requests, and the ring buffer isn't empty, fulfill them + * all with a single read. */ +void postqueue_ringreadall(ReqQueue *q, ring_t *r); -- cgit v1.2.3