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/syscalls.c | |
parent | beb55e5fcaa5098943352bd07eb27cf8b00e336c (diff) |
kernel: reference count mount objects, free them on process kills
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r-- | src/kernel/syscalls.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index 57286f1..7748bc5 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -109,12 +109,17 @@ int _syscall_mount(handle_t hid, const char __user *path, int len) { } // otherwise backend == NULL // append to mount list + // TODO move to kernel/vfs/mount.c mount = kmalloc(sizeof *mount); mount->prev = process_current->mount; - mount->prefix = path_buf; + mount->prefix = path_buf; // owned mount->prefix_len = len; mount->backend = backend; + mount->refs = 1; process_current->mount = mount; + + kmalloc_sanity(mount); + kmalloc_sanity(mount->prefix); return 0; fail: |