VHOLD(9)

NAME
vhold, vdrop - Acquire/release an auxiliary reference on a vnode

SYNOPSIS
#include <sys/param.h>
#include <sys/vnode.h>
void
vhold(struct vnode *vp);
void
vdrop(struct vnode *vp);

DESCRIPTION
The vhold() function acquires an auxiliary reference on a vnode by incrementing the v_auxrefs field. Auxiliary references do not reactivate a vnode or move it to the cache if it resides on the free list, but they will prevent the vnode from being recycled (if not already being recycled), or reused. Auxiliary references are used to associate auxiliary structures such as namecache records with the vnode for those cases where the intent is to not allow the vnode to be immediately recycled. Auxiliary references are also used to access a vnode via an auxiliary structure without having to hold a deep stack of locks that might create deadlock issues for the caller.

The vdrop() function decrements the v_auxrefs field. If the vnode has been deactivated and resides in the cache, it will be moved to the free list when v_auxrefs drops to 0.

SEE ALSO
vget(9), vnode(9), vn_lock(9), vn_unlock(9), vput(9), vref(9), vrele(9)

AUTHORS
This manual page was written by Chad David <davidc@acns.ab.ca>.