Function

vflush

Reclaim the vnodes associated with a mount.

Declaration

int vflush(struct mount *mp, struct vnode *skipvp, int flags);

Parameters

mp

The mount whose vnodes to kill.

skipvp

A specific vnode to not reclaim or to let interrupt an un-forced flush

flags

Control which

Return Value

0 for success, EBUSY if vnodes were busy and FORCECLOSE was not set.

Discussion

This function is used to clear out the vnodes associated with a mount as part of the unmount process. Its parameters can determine which vnodes to skip in the process and whether in-use vnodes should be forcibly reclaimed. Filesystems should call this function from their unmount code, because VFS code will always call it with SKIPROOT | SKIPSWAP | SKIPSYSTEM; filesystems must take care of such vnodes themselves. SKIPSYSTEM skip vnodes marked VSYSTEM FORCECLOSE force file closeure WRITECLOSE only close writeable files SKIPSWAP skip vnodes marked VSWAP SKIPROOT skip root vnodes marked VROOT