summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/mount.c
diff options
context:
space:
mode:
authordzwdz2022-05-04 13:49:38 +0200
committerdzwdz2022-05-04 13:49:38 +0200
commit3bf07641ee5ba1c6ec56b81a7f34abe1267d3ac1 (patch)
tree2eee4442a5aba9fe3a29078a2e8187d999af83a3 /src/kernel/vfs/mount.c
parent9692ed2f93777e1060837b97687509f8a22c2b60 (diff)
kernel: refcount vfs_backend
what a mess
Diffstat (limited to 'src/kernel/vfs/mount.c')
-rw-r--r--src/kernel/vfs/mount.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/kernel/vfs/mount.c b/src/kernel/vfs/mount.c
index 3fe192d..d13c3d6 100644
--- a/src/kernel/vfs/mount.c
+++ b/src/kernel/vfs/mount.c
@@ -8,6 +8,7 @@ struct vfs_mount *vfs_mount_seed(void) {
struct vfs_backend *backend = kmalloc(sizeof *backend);
backend->type = VFS_BACK_ROOT;
backend->potential_handlers = 1;
+ backend->refcount = 1;
*mount = (struct vfs_mount){
.prev = NULL,
.prefix = NULL,
@@ -45,6 +46,8 @@ void vfs_mount_remref(struct vfs_mount *mnt) {
if (--(mnt->refs) > 0) return;
struct vfs_mount *prev = mnt->prev;
+ if (mnt->backend)
+ vfs_backend_refdown(mnt->backend);
kfree(mnt->prefix);
kfree(mnt);