list: change locking discipline
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
2cf76fd225
commit
071a5651e0
11 changed files with 61 additions and 15 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue