lock: merge spinlock and mtx locks into one
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
3e5abada9b
commit
2076f1dae1
32 changed files with 158 additions and 169 deletions
|
|
@ -58,20 +58,20 @@ static int next_level(const char *path, dirent_t *dent, dirent_t **out_dirent)
|
|||
if (res < 0)
|
||||
return -ENOENT;
|
||||
|
||||
spinlock_acquire(&dirent->lock);
|
||||
spin_lock(&dirent->lock);
|
||||
|
||||
if (!dirent->inode) {
|
||||
fs_t *fs = dent->fs;
|
||||
u64 inum = dirent->ino_num;
|
||||
res = fs->fs_ops.open_inode(fs, inum, dirent, &dirent->inode);
|
||||
if (res < 0) {
|
||||
spinlock_release(&dirent->lock);
|
||||
spin_unlock(&dirent->lock);
|
||||
dirent_dec_ref(dirent);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
spinlock_release(&dirent->lock);
|
||||
spin_unlock(&dirent->lock);
|
||||
|
||||
*out_dirent = dirent;
|
||||
return i;
|
||||
|
|
|
|||
Loading…
Reference in a new issue