diff options
author | dzwdz | 2024-05-11 20:24:17 +0200 |
---|---|---|
committer | dzwdz | 2024-05-11 20:24:17 +0200 |
commit | 9047f1e3f502658de12808015179ab3881a4b03f (patch) | |
tree | 4b7f19f3152ab1ed19bc83e2213c679f41110e86 /src/kernel/vfs/request.c | |
parent | 1e9887d904280c43c5a92570a07627689c89b48f (diff) |
kernel: refactor handle management out of proc.c
Diffstat (limited to 'src/kernel/vfs/request.c')
-rw-r--r-- | src/kernel/vfs/request.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c index 21eecb8..0c763b3 100644 --- a/src/kernel/vfs/request.c +++ b/src/kernel/vfs/request.c @@ -59,7 +59,8 @@ void vfsreq_finish(VfsReq *req, char __user *stored, long ret, } else { /* delegating - moving a handle to the caller */ assert(handler); - h = proc_hid_take(handler, ret); + h = hs_take(handler->hs, ret); + // TODO!!! no null check h->readable = h->readable && OPEN_READABLE(req->flags); h->writeable = h->writeable && OPEN_WRITEABLE(req->flags); } @@ -67,7 +68,7 @@ void vfsreq_finish(VfsReq *req, char __user *stored, long ret, if (h) { // TODO write tests for caller getting killed while opening a file if (!req->caller) panic_unimplemented(); - ret = proc_handle_put(req->caller, h); + ret = hs_put(req->caller->hs, h); if (ret < 0) ret = -EMFILE; } else { ret = -1; @@ -148,7 +149,7 @@ static void vfs_backend_user_accept(VfsReq *req) { } Handle *h; - hid_t hid = proc_handle_init(handler, HANDLE_FS_REQ, &h); + hid_t hid = hs_hinit(handler->hs, HANDLE_FS_REQ, &h); if (hid < 0) panic_unimplemented(); h->req = req; proc_setstate(handler, PS_RUNNING); |