summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/request.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/vfs/request.h')
-rw-r--r--src/kernel/vfs/request.h34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/kernel/vfs/request.h b/src/kernel/vfs/request.h
index 616c044..6786e72 100644
--- a/src/kernel/vfs/request.h
+++ b/src/kernel/vfs/request.h
@@ -4,6 +4,10 @@
#include <stdbool.h>
#include <stddef.h>
+struct ReqQueue {
+ VfsReq *head;
+};
+
struct VfsBackend {
/* amount of using references
* VfsMount
@@ -11,17 +15,15 @@ struct VfsBackend {
* Handle
* once it reaches 0, it'll never increase */
size_t usehcnt; /* VfsMount */
- /* amount of providing references
- * Proc
- * 0 - orphaned, will never increase */
- // TODO move this into .user
- size_t provhcnt;
- VfsReq *queue;
bool is_user;
union {
struct {
Proc *handler;
+ ReqQueue queue; /* kernel backends keep their own queues */
+ /* amount of processes that control this backend
+ * won't ever increase if it becomes 0 */
+ size_t provhcnt;
} user;
struct {
void (*accept)(VfsReq *);
@@ -56,10 +58,7 @@ struct VfsReq {
Proc *caller;
VfsBackend *backend;
- VfsReq *queue_next;
- VfsReq *postqueue_next; /* used by kernel backends */
- /* only one of these queues is in use at a given moment, they could
- * be merged into a single field */
+ VfsReq *reqqueue_next;
};
/** Assigns the vfs_request to the caller, and dispatches the call */
@@ -79,13 +78,10 @@ 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);
+void reqqueue_init(ReqQueue *q);
+void reqqueue_join(ReqQueue *q, VfsReq *req);
+VfsReq *reqqueue_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);
+/** If there are any pending read requests, and the ring buffer isn't empty,
+ * fulfill them all with a single read. */
+void reqqueue_ringreadall(ReqQueue *q, ring_t *r);