summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/request.h
diff options
context:
space:
mode:
authordzwdz2023-01-11 19:35:44 +0100
committerdzwdz2023-01-11 19:37:46 +0100
commitec81fa16d837f430add92b4d2ee4bd3727ca6c6d (patch)
tree43c91abe8d6a76fcec006fe67c1b585573d3662f /src/kernel/vfs/request.h
parentc178ab5d5ca328d5b0072d54e3dc66d1b198df7b (diff)
kernel: return EPIPE when fs_waiting on a dead filesystem
Diffstat (limited to 'src/kernel/vfs/request.h')
-rw-r--r--src/kernel/vfs/request.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/kernel/vfs/request.h b/src/kernel/vfs/request.h
index ef7c83a..4d7fa01 100644
--- a/src/kernel/vfs/request.h
+++ b/src/kernel/vfs/request.h
@@ -5,15 +5,17 @@
// describes something which can act as an access function
struct vfs_backend {
- /* references:
- * struct vfs_mount
- * struct vfs_request
- * struct process
- * struct handle
- */
- size_t refcount;
+ /* amount of using references
+ * struct vfs_mount
+ * struct vfs_request
+ * struct handle
+ * once it reaches 0, it'll never increase */
+ size_t usehcnt; /* struct vfs_mount */
+ /* amount of providing references
+ * struct process
+ * 0 - orphaned, will never increase */
+ size_t provhcnt;
- size_t potential_handlers; // 0 - orphaned
struct vfs_request *queue;
bool is_user;
union {
@@ -72,4 +74,6 @@ static inline void vfsreq_finish_short(struct vfs_request *req, long ret) {
/** Try to accept an enqueued request */
void vfs_backend_tryaccept(struct vfs_backend *);
-void vfs_backend_refdown(struct vfs_backend *);
+// TODO the bool arg is confusing. maybe this should just be a function
+// that verified the refcount and potentially frees the backend
+void vfs_backend_refdown(struct vfs_backend *, bool use);