summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/backend.c
diff options
context:
space:
mode:
authordzwdz2021-09-08 19:40:58 +0200
committerdzwdz2021-09-08 19:40:58 +0200
commit67c847f8660ed73db1017f2ca8b01bfe4eb9ba1b (patch)
tree8750f5ff8d20975b420cd8593e05ff288b1ed150 /src/kernel/vfs/backend.c
parent2f48f3c88c11c802a1dfc9d803b1d9715cb95b33 (diff)
scaffolding for user fs dispatch
Diffstat (limited to 'src/kernel/vfs/backend.c')
-rw-r--r--src/kernel/vfs/backend.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kernel/vfs/backend.c b/src/kernel/vfs/backend.c
index 9a2b777..0f684a0 100644
--- a/src/kernel/vfs/backend.c
+++ b/src/kernel/vfs/backend.c
@@ -14,6 +14,20 @@ _Noreturn void vfs_backend_dispatch(struct vfs_backend *backend, struct vfs_op o
case VFS_BACK_ROOT:
int ret = vfs_root_handler(&req);
vfs_backend_finish(&req, ret);
+ case VFS_BACK_USER:
+ process_current->state = PS_WAITS4FS;
+ if (backend->handler == NULL) { // backend not ready yet
+ if (backend->queue == NULL) {
+ backend->queue = process_current;
+ process_switch_any();
+ } else {
+ panic(); // TODO implement a proper queue
+ }
+ } else {
+ if (backend->handler->state != PS_WAITS4REQUEST)
+ panic(); // invalid state
+ panic(); // TODO
+ }
default:
panic();
}