INSMNTQUE(9)
π¦ INSMNTQUE(9) β the vnode-and-mount bestie page π¦
hiii bestie π welcome to the INSMNTQUE(9) page from the Kernel Developer's Manual. this one is all about introducing a vnode to a mount. iconic behavior, honestly.
π NAME π
insmntque, insmntque1 β associate a vnode with a mount
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/vnode.h>
int
insmntque(struct vnode *vp, struct mount *mp);
int
insmntque1(struct vnode *vp, struct mount *mp);
π DESCRIPTION π
okay so insmntque() is the function that associates a vnode with a mount. like, it handles updating v_mount for the vnode and inserting the vnode into the mount's vnode list. very matchmaker of it. π«
the indirect mount reference count is maintained as the count of the vnodes owned by it. it gets incremented for each vnode added to the mount, and that reference is decremented by vgone(9). the way that all lines up?? obsessed. πΈ
bestie, important vibe check: the mount's interlock is held while the vnode is inserted. the vnode must be exclusively locked. no exceptions, periodt. π
on failure, insmntque() resets the vnode's operations vector to the vector of deadfs(9), clears v_data, and then calls vgone(9) and vput(9). π
if you need more elaborated cleanup after an insmntque() failure, use insmntque1() instead. it does not do any cleanup following a failure β all the work is left to the caller. in particular, the operations vector v_op and v_data fields of the vnode are kept intact. π«Ά
π RETURN VALUES π
insmntque()will always return0, unless the file system is currently being unmounted β in which case it may returnEBUSY. yikes, but okay. π- also,
insmntque()may be forced to insert the vnode into the mount's vnode list by setting theVV_FORCEINSMQflag in the vnodev_flag, even if the file system is being unmounted. forced entry, but make it kernel. π
π₯ SEE ALSO π₯
π AUTHORS π
This manual page was written by Chad David <davidc@acns.ab.ca>. shoutout to Chad, fr fr. π
this cute little page comes straight from Debian, dated October 24, 2025 β slay and goodbye bestie πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (C) 2008 Chad David <davidc@acns.ab.ca>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms