diff options
Diffstat (limited to 'src/kernel/vfs')
-rw-r--r-- | src/kernel/vfs/backend.c | 12 | ||||
-rw-r--r-- | src/kernel/vfs/backend.h | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/kernel/vfs/backend.c b/src/kernel/vfs/backend.c index 7e53e51..4b22104 100644 --- a/src/kernel/vfs/backend.c +++ b/src/kernel/vfs/backend.c @@ -27,14 +27,22 @@ _Noreturn void vfs_backend_dispatch(struct vfs_backend *backend, struct vfs_op o process_current->pending_req = req; process_switch_any(); } else { - assert(backend->handler->state == PS_WAITS4REQUEST); - panic(); // TODO + vfs_request_pass2handler(req); } default: panic(); } } +_Noreturn void vfs_request_pass2handler(struct vfs_op_request *req) { + assert(req->backend->handler); + assert(req->backend->handler->state == PS_WAITS4REQUEST); + + req->backend->handler->state = PS_RUNNING; + // TODO pass the request to the process + process_switch(req->backend->handler); +} + // returns from a VFS operation to the calling process _Noreturn void vfs_backend_finish(struct vfs_op_request *req, int ret) { struct process *caller = req->caller; diff --git a/src/kernel/vfs/backend.h b/src/kernel/vfs/backend.h index bf16ee7..bc0dc45 100644 --- a/src/kernel/vfs/backend.h +++ b/src/kernel/vfs/backend.h @@ -25,4 +25,5 @@ struct vfs_op_request { // these can switch processes _Noreturn void vfs_backend_dispatch(struct vfs_backend *backend, struct vfs_op op); +_Noreturn void vfs_request_pass2handler(struct vfs_op_request *); _Noreturn void vfs_backend_finish(struct vfs_op_request *, int ret); |