mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
statvfs: handle vnodes without a vfs
This commit is contained in:
@@ -36,6 +36,11 @@ syscallret_t syscall_fstatvfs(context_t *ctx, int fd, statvfs_t *ustatvfs) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (file->vnode->vfs == NULL) {
|
||||||
|
ret.errno = ENODEV;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
fsattr_t buf;
|
fsattr_t buf;
|
||||||
ret.errno = VFS_STATFS(file->vnode->vfs, &buf);
|
ret.errno = VFS_STATFS(file->vnode->vfs, &buf);
|
||||||
if (ret.errno)
|
if (ret.errno)
|
||||||
@@ -98,6 +103,11 @@ syscallret_t syscall_fstatvfsat(context_t *ctx, int dirfd, char *upath, stat_t *
|
|||||||
// locked by vfs_lookup
|
// locked by vfs_lookup
|
||||||
VOP_UNLOCK(node);
|
VOP_UNLOCK(node);
|
||||||
|
|
||||||
|
if (node->vfs == NULL) {
|
||||||
|
ret.errno = ENODEV;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
fsattr_t buf;
|
fsattr_t buf;
|
||||||
ret.errno = VFS_STATFS(node->vfs, &buf);
|
ret.errno = VFS_STATFS(node->vfs, &buf);
|
||||||
if (ret.errno)
|
if (ret.errno)
|
||||||
|
|||||||
Reference in New Issue
Block a user