NAME
VOP_FSYNC
—
flush filesystem buffers for a
file
SYNOPSIS
#include
<sys/param.h>
#include <sys/vnode.h>
int
VOP_FSYNC
(struct
vnode *vp, int
waitfor, int
flags);
DESCRIPTION
This call flushes any dirty filesystem buffers for the file. It is used to implement the sync(2) and fsync(2) system calls.Its arguments are:
- vp
- the vnode of the file.
- waitfor
- whether the function should do data, meta-data updates or be full-synchronous.
- flags
- are additional flags to be passed to the filesystem specific fsync(2) function.
The argument waitfor can use the following flags:
MNT_NOWAIT
- is for an asynchronous data pass and a meta-data pass as well.
MNT_LAZY
- means a limited amount of data from dirty buffers and a full meta-data synchronization pass.
MNT_WAIT
- will make syncer(4) try to do a full synchronization pass. That is, a meta-data pass and multiple data passes.
The argument flags is to specify additional
flags passed to the filesystem specific
fsync(2) call. The only supported flag at the moment is
VOP_FSYNC_SYSCALL
which indicates the file
synchronization was requested from userland.
RETURN VALUES
Zero is returned if the call is successful, otherwise an appropriate error code is returned.
ERRORS
- [
ENOSPC
] - The filesystem is full.
- [
EDQUOT
] - Quota exceeded.
SEE ALSO
AUTHORS
This man page was written by Doug Rabson.