diff options
Diffstat (limited to 'src/kernel/vfs/request.c')
-rw-r--r-- | src/kernel/vfs/request.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c index 8a80f04..8e6f14a 100644 --- a/src/kernel/vfs/request.c +++ b/src/kernel/vfs/request.c @@ -3,6 +3,7 @@ #include <kernel/malloc.h> #include <kernel/panic.h> #include <kernel/proc.h> +#include <kernel/queue.h> #include <kernel/vfs/request.h> #include <shared/mem.h> @@ -236,32 +237,19 @@ vfsback_provdown(VfsBackend *b) void reqqueue_init(ReqQueue *q) { - q->head = NULL; - q->slot = &q->head; + QUEUE_INIT(q); } void reqqueue_join(ReqQueue *q, VfsReq *req) { - assert(req->reqqueue_next == NULL); - assert(q->slot != NULL); - assert(*q->slot == NULL); - *q->slot = req; - q->slot = &req->reqqueue_next; + QUEUE_APPEND(q, reqqueue, req); } VfsReq * reqqueue_pop(ReqQueue *q) { - VfsReq *req = q->head; - if (req) { - q->head = req->reqqueue_next; - req->reqqueue_next = NULL; - if (q->slot == &req->reqqueue_next) { - q->slot = &q->head; - } - } - return req; + return QUEUE_POP(q, reqqueue); } void |