list: change locking discipline

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-12 14:50:47 -04:00
commit 071a5651e0
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
11 changed files with 61 additions and 15 deletions

View file

@ -128,7 +128,9 @@ int vfs_mount(const char *path, fs_t *fs, u64 flags)
list_create(&m->children);
list_lock(&parent->children);
m->child_link = list_insert(&parent->children, m);
list_unlock(&parent->children);
if (!m->child_link) {
dirent_dec_ref(mp);
kfree(m);
@ -181,7 +183,9 @@ int vfs_umount(const char *path)
return -EBUSY;
}
list_lock(target->child_link->list);
list_remove(target->child_link);
list_unlock(target->child_link->list);
dirent_dec_ref(target->mountpoint);
kfree(target);