VGET(9)
π VGET π
okay bestie, buckle up, we're talking about vget β the kernel dev manual's little icon for pulling a vnode off the free list. yes, that vget. the one in section 9. slay.
β¨ 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 π
so what it does is: it grabs a vnode off the free list and bumps its reference count up. that's it, that's the whole vibe. lowkey iconic.
vpβ the vnode we're removing from the free list. that's your girl right there.lockflagβ if this is non-zero, the vnode gets locked too. like, locked locked. π
when nobody's using them, vnodes just chill on a free list. and here's the tea: those vnodes still reference valid files, but they can be reused to point at a whole new file at literally any time. no warning, no heads up. so also, these vnodes are often held in caches around the system, like the name cache. iykyk.
when a vnode that's sitting on the free list gets used again β for example, if the vnode was found in the name cache as a result of a call to VOP_LOOKUP(9) β then the new user must call vget() to increment the reference count and remove it from the free list. not optional, bestie. it's giving mandatory. π«Ά
π SEE ALSO π
π AUTHORS π
this manual page was written by Doug Rabson. thank you king π
and that's the whole page, periodt. this gem came to you from the Debian edition, dated July 24, 1996 β yes it's older than us, and yes it still ate. mwah πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1996 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms