diff options
author | dzwdz | 2022-05-04 13:49:38 +0200 |
---|---|---|
committer | dzwdz | 2022-05-04 13:49:38 +0200 |
commit | 3bf07641ee5ba1c6ec56b81a7f34abe1267d3ac1 (patch) | |
tree | 2eee4442a5aba9fe3a29078a2e8187d999af83a3 /src/kernel/vfs/mount.c | |
parent | 9692ed2f93777e1060837b97687509f8a22c2b60 (diff) |
kernel: refcount vfs_backend
what a mess
Diffstat (limited to 'src/kernel/vfs/mount.c')
-rw-r--r-- | src/kernel/vfs/mount.c | 3 |
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); |