DragonFly On-Line Manual Pages
VGET(9) DragonFly Kernel Developer's Manual VGET(9)
vget -- Acquire a primary reference, lock, and reactivate a vnode
vget(struct vnode *vp, int lockflag);
Acquire a primary reference to vnode and lock it, reactivating the vnode
from the cache or free list if necessary. This kernel function must be
used if the vnode in hand is not already known to be actively referenced,
such as when obtaining the vnode pointer from a namecache or VM object
vp The vnode being acquired, typically obtained from some other
lockflag Must be LK_SHARED or LK_EXCLUSIVE. Passing 0 is illegal.
LK_NOWAIT may be logically ORd in if you do not wish to block
and can handle the additional error codes that might be
When not in use, vnodes are kept on a free list or marked as being
cached. The vnodes still reference valid files but may be reused to
refer to a new file at any time. Often, references to these vnodes are
present in auxiliary structures related to the vnode, such as namecache
entries and VM objects.
When acquiring a vnode pointer from these auxiliary structures the vget
function must be used to both reference and, if necessary, reactivate the
vnode. The vnode will also be locked accordingly.
0 is returned on success, ENOENT is returned if the vnode becomes unus-
able while vget is blocked trying to lock it, and other errors may be
returned as well. ENOENT is not typically considered to be a fatal error
but simply an indication that the caller needs to relookup the vnode as
related structures may be in the midst of being destroyed.
vdrop(9), vhold(9), vnode(9), vn_lock(9), vn_unlock(9), vput(9), vref(9),
This manual page was written by Doug Rabson.
DragonFly 5.3 May 5, 2007 DragonFly 5.3