diff options
author | dzwdz | 2022-08-19 19:44:36 +0200 |
---|---|---|
committer | dzwdz | 2022-08-19 19:44:36 +0200 |
commit | 390aec5ca22e62d128e71d1dee312a2f0a82ab68 (patch) | |
tree | 2a79bb1ee35dab3006a947f595891fbcfefa4bfb /src/kernel/vfs/request.c | |
parent | 6bea8cd391125734339dfb83db498a8651c9f7f7 (diff) |
syscall/fs_wait: return a handle for each request
Diffstat (limited to 'src/kernel/vfs/request.c')
-rw-r--r-- | src/kernel/vfs/request.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c index a3be057..959b051 100644 --- a/src/kernel/vfs/request.c +++ b/src/kernel/vfs/request.c @@ -99,8 +99,6 @@ void vfs_backend_user_accept(struct vfs_request *req) { assert(req && req->backend && req->backend->user.handler); handler = req->backend->user.handler; assert(handler->state == PS_WAITS4REQUEST); - if (handler->handled_req) - panic_unimplemented(); // the virt_cpy calls aren't present in all kernel backends // it's a way to tell apart kernel and user backends apart @@ -134,10 +132,13 @@ void vfs_backend_user_accept(struct vfs_request *req) { panic_unimplemented(); } + struct handle *h; + handle_t hid = process_handle_init(handler, HANDLE_FS_REQ, &h); + if (hid < 0) panic_unimplemented(); + h->req = req; process_transition(handler, PS_RUNNING); - handler->handled_req = req; + regs_savereturn(&handler->regs, hid); req->backend->user.handler = NULL; - regs_savereturn(&handler->regs, 0); return; } |