man.bsd.lv manual page server

Manual Page Search Parameters

VHOLD(9) Kernel Developer's Manual VHOLD(9)

vhold, vdropAcquire/release an auxiliary reference on a vnode

#include <sys/param.h>
#include <sys/vnode.h>

void
vhold(struct vnode *vp);

void
vdrop(struct vnode *vp);

The () 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 () 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.

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

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

May 5, 2007 DragonFly-5.6.1