AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
close.c File Reference

Closing a vnode: dropping a reference to it. More...

#include <core/system.h>
#include <core/panic.h>
#include <fs/vfs.h>

Go to the source code of this file.

Functions

int vfs_close (struct vnode *vnode)
 Drops a reference to a vnode.

Detailed Description

Closing a vnode: dropping a reference to it.

Definition in file close.c.

Function Documentation

◆ vfs_close()

int vfs_close ( struct vnode * vnode)

Drops a reference to a vnode.

When the last one goes, the filesystem's close operation releases it. Closing a vnode that has no references left is a bug, and panics.

Parameters
vnodethe vnode
Returns
0, -EINVAL if vnode isn't a valid vnode, or what the filesystem's close operation returns

Definition at line 18 of file close.c.

References vops::close, vnode::fs, LOG_DEBUG, panic, vnode::ref, vfs_close(), and fs::vops.

Referenced by binfmt_load(), creat_path(), cross_down(), ctty_open(), cwd_set(), do_faccessat(), do_fchmodat(), do_fchownat(), do_fstatat(), do_openat(), entry_remove(), exec_script(), ext2_vunlink(), pipefs_close(), pipefs_fifo_open(), posix_file_close(), proc_fork(), proc_kill(), ptmx_open(), pty_free(), socket_unix_bind(), socket_unix_connect(), socket_unix_shutdown(), sys_chdir(), sys_fchdir(), sys_utimensat(), vfs_close(), vfs_link(), vfs_lookup(), vfs_lookup_dir(), vfs_lookup_parent(), vfs_mknod(), vfs_mount(), vfs_mount_root_of(), vfs_parent(), vfs_readlink(), vfs_remove(), vfs_rename(), vfs_symlink(), vfs_under(), vfs_vnode_path(), vm_object_decref(), and walk().