DragonFly On-Line Manual Pages


VHOLD(9)	      DragonFly Kernel Developer's Manual	      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 incre- menting 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 recy- cled), 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. Auxil- iary references are also used to access a vnode via an auxiliary struc- ture without having to hold a deep stack of locks that might create dead- lock 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>. DragonFly 3.9 May 5, 2007 DragonFly 3.9