From ed8ff1ff9c4c0f847ffc2ab4624bd999539a0890 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 11 Jul 2024 21:43:50 +0200 Subject: kernel: start cleaning up VfsRequest * I'm being more strict about the linked list state to hopefully ensure I'm not leaking any references. * vfsreq_create was renamed to vfsreq_dispatchcopy as that name feels more clear. It copies its argument, and dispatches it. * Requests for user backends are now handled more like requests for kernel backends - there's an accept() function that accepts a request. --- src/kernel/vfs/request.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/kernel/vfs/request.h') diff --git a/src/kernel/vfs/request.h b/src/kernel/vfs/request.h index 2bd8c61..0b93491 100644 --- a/src/kernel/vfs/request.h +++ b/src/kernel/vfs/request.h @@ -3,7 +3,6 @@ #include #include -/* describes something which can act as an access function */ struct VfsBackend { /* amount of using references * VfsMount @@ -14,6 +13,7 @@ struct VfsBackend { /* amount of providing references * Proc * 0 - orphaned, will never increase */ + // TODO move this into .user size_t provhcnt; VfsReq *queue; @@ -64,7 +64,7 @@ struct VfsReq { }; /** Assigns the vfs_request to the caller, and dispatches the call */ -void vfsreq_create(VfsReq); +void vfsreq_dispatchcopy(VfsReq); void vfsreq_finish(VfsReq*, char __user *stored, long ret, int flags, Proc *handler); static inline void vfsreq_finish_short(VfsReq *req, long ret) { @@ -72,7 +72,7 @@ static inline void vfsreq_finish_short(VfsReq *req, long ret) { } /** Try to accept an enqueued request */ -void vfs_backend_tryaccept(VfsBackend *); +void vfsback_useraccept(VfsReq *); /** Decrements the "user" reference count. */ void vfsback_userdown(VfsBackend *); -- cgit v1.2.3