VOP_INACTIVE(9)
π VOP_INACTIVE(9) β the Kernel Developer's Manual, but make it cute
okay so bestie, we're in VOP_INACTIVE(9) territory today β that's the Kernel Developer's Manual section 9, the land of vnodes and vibes. two functions, one mission: giving file system resources back. let's go π¦
β¨ NAME β¨
VOP_INACTIVE, VOP_RECLAIM β reclaim file system resources for a vnode. that's the whole gig, no cap π
πΈ 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 π
first up, the arguments, because we always do the arguments:
vpβ the vnode being reclaimed. that's it, that's the argument bestie π«Ά
π VOP_INACTIVE()
so VOP_INACTIVE() is usually called when the kernel is no longer using the vnode. usually. not always. and that distinction is doing a lot of heavy lifting here π
like, there is no guarantee 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. (yes, without sleeping, that whole situation π)
this may be because the reference count reaches zero, or it may be that the file system is being forcibly unmounted while there are open files. either way, same function.
it can be used to reclaim space on the last close of an 'open but deleted' file. iconic behaviour honestly β¨
π§ VOP_RECLAIM()
VOP_RECLAIM() hits different β it's called when a vnode is being reused for a different file system. any file system specific resources associated with the vnode should be freed. that's your cue to clean up, no hoarding ποΈπ
π LOCKS π
for both VOP_INACTIVE() and VOP_RECLAIM(), the vp will be exclusively locked on entry, and must be left exclusively locked on return. non-negotiable, fr fr π₯
π SEE ALSO π
ποΈ AUTHORS ποΈ
this manual page was written by Doug Rabson. thank you Doug, you ate πβ
and that's the whole page, bestie! ππΈ
sign-off era: this one came from Debian, dated March 15, 2019 β so old, so iconic, we stan a vintage manpage ππ¦ go forth and reclaim those resources π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 1996 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms