vfs: redo vnode locking

This commit is contained in:
Matheus
2023-06-15 19:57:56 -03:00
parent 851385fbff
commit fef149ca55
7 changed files with 69 additions and 45 deletions
-2
View File
@@ -54,9 +54,7 @@ syscallret_t syscall_openat(context_t *context, int dirfd, const char *path, int
goto cleanup;
vattr_t attr;
VOP_LOCK(vnode);
ret.errno = VOP_GETATTR(vnode, &attr, &_cpu()->thread->proc->cred);
VOP_UNLOCK(vnode);
if (ret.errno)
goto cleanup;
-2
View File
@@ -49,9 +49,7 @@ syscallret_t syscall_seek(context_t *context, int fd, off_t offset, int whence)
}
case SEEK_END: {
vattr_t attr;
VOP_LOCK(file->vnode);
ret.errno = VOP_GETATTR(file->vnode, &attr, &_cpu()->thread->proc->cred);
VOP_UNLOCK(file->vnode);
if (ret.errno)
goto cleanup;
file->offset = attr.size;
-2
View File
@@ -8,9 +8,7 @@
static int dostat(vnode_t *vnode, stat_t *stat) {
vattr_t attr;
VOP_LOCK(vnode);
int e = VOP_GETATTR(vnode, &attr, &_cpu()->thread->proc->cred);
VOP_UNLOCK(vnode);
if (e)
return e;