---
name: "insmntque"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/insmntque"
---

# insmntque(9)

associate a vnode with a mount

## 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

The **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 indirect mount reference count, maintained as the count of the vnodes owned by it, is incremented for each vnode added to the mount, and that reference is decremented by [vgone(9)](/vgone/9.md).

The mount's interlock is held while the vnode is inserted. The vnode must be exclusively locked.

On failure, **insmntque**() resets vnode's operations vector to the vector of [deadfs(9)](/deadfs/9.md), clears *v\_data*, and then calls [vgone(9)](/vgone/9.md) and [vput(9)](/vput/9.md). If more elaborated cleanup after **insmntque**() failure is needed, the **insmntque1**() function may be used instead. It does not do any cleanup following a failure, leaving all the work to the caller. In particular, the operations vector *v\_op* and *v\_data* fields of the vnode are kept intact.

## RETURN VALUES

The **insmntque**() function will always return 0, unless the file system is currently being unmounted in which case it may return EBUSY. Also, **insmntque**() may be forced to insert the vnode into the mount's vnode list by setting the *VV\_FORCEINSMQ* flag in the vnode *v\_flag*, even if the file system is being unmounted.

## SEE ALSO

[vgone(9)](/vgone/9.md)

## AUTHORS

This manual page was written by Chad David ⟨*davidc@acns.ab.ca*⟩.
