From b99d66ce12b4a1a0dd452d8a38006eede0c05cf2 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 8 Aug 2022 00:45:46 +0200 Subject: kernel/backend: remove the kern.ready() method --- src/kernel/vfs/request.c | 10 +--------- src/kernel/vfs/request.h | 5 ++--- 2 files changed, 3 insertions(+), 12 deletions(-) (limited to 'src/kernel/vfs') diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c index 6883faa..82f4731 100644 --- a/src/kernel/vfs/request.c +++ b/src/kernel/vfs/request.c @@ -86,17 +86,9 @@ void vfsreq_finish(struct vfs_request *req, char __user *stored, long ret, void vfs_backend_tryaccept(struct vfs_backend *backend) { struct vfs_request *req = backend->queue; if (!req) return; - - /* ensure backend is ready to accept request */ - if (backend->is_user) { - if (!backend->user.handler) return; - } else { - assert(backend->kern.ready); - if (!backend->kern.ready(backend)) return; - } + if (backend->is_user && !backend->user.handler) return; backend->queue = req->queue_next; - if (backend->is_user) { vfs_backend_user_accept(req); } else { diff --git a/src/kernel/vfs/request.h b/src/kernel/vfs/request.h index ee33623..7c991f4 100644 --- a/src/kernel/vfs/request.h +++ b/src/kernel/vfs/request.h @@ -25,7 +25,6 @@ struct vfs_backend { struct process *handler; } user; struct { - bool (*ready)(struct vfs_backend *); void (*accept)(struct vfs_request *); } kern; }; @@ -77,9 +76,9 @@ void vfs_backend_user_accept(struct vfs_request *req); void vfs_backend_refdown(struct vfs_backend *); -#define BACKEND_KERN(ready, accept) ((struct vfs_backend){\ +#define BACKEND_KERN(accept) ((struct vfs_backend){\ .is_user = false, \ .heap = false, \ .potential_handlers = 1, \ .refcount = 1, \ - .kern = {ready, accept}}) + .kern.accept = accept}) -- cgit v1.2.3