diff options
Diffstat (limited to 'src/kernel/vfs')
-rw-r--r-- | src/kernel/vfs/backend.c | 14 | ||||
-rw-r--r-- | src/kernel/vfs/backend.h | 6 |
2 files changed, 19 insertions, 1 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(); } diff --git a/src/kernel/vfs/backend.h b/src/kernel/vfs/backend.h index fe46db1..bf16ee7 100644 --- a/src/kernel/vfs/backend.h +++ b/src/kernel/vfs/backend.h @@ -6,9 +6,13 @@ enum vfs_backend_type { VFS_BACK_USER, }; -// describes something which can acts as an access function +// describes something which can act as an access function struct vfs_backend { enum vfs_backend_type type; + + // only used with VFS_BACK_USER + struct process *handler; + struct process *queue; }; // describes an in-progress vfs call |