vfs: VOP_RESIZE

This commit is contained in:
Matheus
2023-07-09 20:33:22 -03:00
parent b1ac2fb0fe
commit 7a0bd0747e
5 changed files with 25 additions and 5 deletions
+6
View File
@@ -56,6 +56,12 @@ syscallret_t syscall_openat(context_t *context, int dirfd, const char *path, int
if (ret.errno)
goto cleanup;
if (vnode->type == V_TYPE_REGULAR && (flags & O_TRUNC)) {
ret.errno = VOP_RESIZE(vnode, 0, &_cpu()->thread->proc->cred);
if (ret.errno)
goto cleanup;
}
// node refcount is already increased by open
newfile->vnode = vnode;
newfile->flags = flags;