---
name: "vget"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/vget"
---

# vget(9)

get a vnode from the free list

## NAME

**vget** – get a vnode from the free list

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/vnode.h\>**

*int*\

**vget**(*struct vnode \*vp*, *int lockflag*, *struct thread \*td*);

## DESCRIPTION

Get a vnode from the free list and increment its reference count.

- *vp*

  The vnode to remove from the free list.

- *lockflag*

  If non-zero, the vnode will also be locked.

When not in use, vnodes are kept on a free list. The vnodes still reference valid files but may be reused to refer to a new file at any time. Often, these vnodes are also held in caches in the system, such as the name cache.

When a vnode which is on the free list is used again, for instance if the vnode was found in the name cache as a result of a call to [VOP\_LOOKUP(9)](/VOP_LOOKUP/9.md) then the new user must call **vget**() to increment the reference count and remove it from the free list.

## SEE ALSO

[vnode(9)](/vnode/9.md), [vput(9)](/vput/9.md), [vref(9)](/vref/9.md), [vrele(9)](/vrele/9.md)

## AUTHORS

This manual page was written by Doug Rabson.
