diff options
author | dzwdz | 2022-05-03 20:31:50 +0200 |
---|---|---|
committer | dzwdz | 2022-05-03 20:31:50 +0200 |
commit | 9692ed2f93777e1060837b97687509f8a22c2b60 (patch) | |
tree | 967dd6c85e7f07dbc9277bc0d2a534a49091de26 /src/kernel/vfs/mount.h | |
parent | beb55e5fcaa5098943352bd07eb27cf8b00e336c (diff) |
kernel: reference count mount objects, free them on process kills
Diffstat (limited to 'src/kernel/vfs/mount.h')
-rw-r--r-- | src/kernel/vfs/mount.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/kernel/vfs/mount.h b/src/kernel/vfs/mount.h index 5fb6d16..96a2d7b 100644 --- a/src/kernel/vfs/mount.h +++ b/src/kernel/vfs/mount.h @@ -7,9 +7,15 @@ struct vfs_mount { char *prefix; size_t prefix_len; struct vfs_backend *backend; + size_t refs; /* counts all references, atm from: + * - struct vfs_mount + * - struct proc + */ }; // prepares init's filesystem view struct vfs_mount *vfs_mount_seed(void); struct vfs_mount *vfs_mount_resolve( struct vfs_mount *top, const char *path, size_t path_len); +/** Decrements the reference count, potentially freeing the mount. */ +void vfs_mount_remref(struct vfs_mount *mnt); |