insmntque (9)
Leading comments
Copyright (C) 2008 Chad David <davidc@acns.ab.ca>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice(s), this list of conditions and the following disclaimer as the first lines of this file unmodified other than the possible addition of one or more copyright notices. 2. Redistributions in binary for...
NAME
insmntque insmntque1 - associate a vnode with a mountSYNOPSIS
In sys/param.h In sys/vnode.h Ft int Fn insmntque struct vnode *vp struct mount *mp Ft int Fn insmntque1 struct vnode *vp struct mount *mp void (*dtr)(struct vnode *, void *) void *dtr_argDESCRIPTION
The Fn insmntque function associates a vnode with a mount. This includes updating v_mount for the vnode, and inserting the vnode into the mount's vnode list.The mount reference count is incremented for each vnode added to the mount, and that reference is decremented by vgone(9).
The mount's interlock is held while the vnode is inserted. For MP-safe file systems, the vnode must be exclusively locked.
On failure, Fn insmntque calls vgone(9) on the supplied vnode, and then drops the vnode lock and reference. If more elaborated cleanup after Fn insmntque failure is needed, the Fn insmntque1 function may be used instead. The Fa dtr argument is a pointer to a function that is called on failure. This function may perform any custom cleanup. The vnode pointer is supplied as the first argument to Fa dtr . The Fa dtr_arg argument is the second, supplying any additional context needed.