VOP_INACTIVE(9)
VOP_INACTIVE π (section 9 of the Kernel Developer's Manual, bestie)
okay so welcome to the vnode-recycling corner of the kernel, where we give file system resources back and say bye to vnodes that are done being useful π this page covers VOP_INACTIVE and VOP_RECLAIM, and together they're giving "reclaim file system resources for a vnode" energy β¨
β¨ NAME β¨
VOP_INACTIVE, VOP_RECLAIM β reclaim file system resources for a vnode π§
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/vnode.h>
int
VOP_INACTIVE(struct vnode *vp, struct thread *td);
int
VOP_RECLAIM(struct vnode *vp, struct thread *td);
π DESCRIPTION π
The arguments are:
vpβ the vnode being reclaimed. that's the one, that's our girl π
VOP_INACTIVE() is usually called when the kernel is no longer using the vnode. usually, bestie, because β and this is the important part β there is no guarantee that it will be called at all. for example if the last reference was dropped while the vnode lock could not be upgraded to exclusive without sleeping. π
why might it fire? could be that the reference count reaches zero, or it could be that the file system is being forcibly unmounted while there are open files. either way, it's useful for reclaiming space on the last close of an 'open but deleted' file ποΈβ¨
VOP_RECLAIM() is called when a vnode is being reused for a different file system. any file system specific resources associated with the vnode should be freed. like, actually freed, that's your job, don't ghost them π periodt.
π LOCKS π
for both VOP_INACTIVE() and VOP_RECLAIM(): the vp will be exclusively locked on entry, and it must be left exclusively locked on return. no cap, don't you dare unlock it on the way out π
π SEE ALSO π
π«Ά AUTHORS π«Ά
this manual page was written by Doug Rabson. iconic of him fr fr π
and that's the whole page, bestie π¦ this one came from the Debian crew β dated March 15, 2019 β and it lives under VOP_INACTIVE(9) in the Kernel Developer's Manual. go forth and free those vnode resources, you absolute main character πβ¨π
π¦ 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