open or close a file
, struct file
() entry point is called before a
file is accessed by a process and the
() entry point is called after a
file is finished with by the process.
The arguments are:
- The vnode of the file.
- The access mode required by the calling process.
- The caller's credentials.
- The thread which is accessing the file.
- The file being opened.
Pointer to the file fp
is useful for file
systems which require such information, e.g.,
() for in-kernel opens.
The access mode is a set of flags, including
to be locked on entry and will leave it
locked on return.
() expects at least a reference to
be associated with the vnode and does not care whether the vnode is locked or
not. The lock and reference state is left unchanged on return. Note that
expects an unlocked, referenced
vnode and will dereference the vnode prior to returning.
Zero is returned on success, otherwise an error code is returned.
This manual page was written by Doug