| VINVALBUF(9) | Kernel Developer's Manual | VINVALBUF(9) |
vinvalbuf — flush
and invalidate all buffers associated with a vnode
#include
<sys/param.h>
#include <sys/vnode.h>
int
vinvalbuf(struct
vnode *vp, int
flags, struct ucred
*cred, struct proc
*p, int slpflag,
uint64_t slptimeo);
The
vinvalbuf()
function invalidates all of the buffers associated with the given vnode.
This includes buffers on the clean list and the dirty list. If the
V_SAVE flag is specified then the buffers on the
dirty list are synced prior to being released. If the
V_SAVEMETA flag is set, indirect blocks will not be
flushed.
Its arguments are:
V_SAVE and
V_SAVEMETA. V_SAVE
indicates that dirty buffers should be synced with the disk.
V_SAVEMETA indicates that indirect blocks should
not be flushed.V_SAVE is set.The vnode is assumed to be locked prior to the call and remains locked upon return.
A value of 0 is returned on success.
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0); VOP_UNLOCK(devvp); if (error) return (error);
ENOSPC]V_SAVE)EDQUOT]V_SAVE)EWOULDBLOCK]ERESTART]PCATCH set in
slpflag)EINTR]PCATCH set in slpflag)This man page was originally written by Chad David <davidc@acns.ab.ca> for FreeBSD.
| November 14, 2020 | openbsd |