mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
vfs: redo vnode locking
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user