2008-02-26 23:16:23 +00:00
|
|
|
.\" Copyright (C) 2008 Chad David <davidc@acns.ab.ca>.
|
|
|
|
.\" All rights reserved.
|
2008-02-26 21:09:54 +00:00
|
|
|
.\"
|
|
|
|
.\" 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 form must reproduce the above copyright
|
|
|
|
.\" notice(s), this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
|
|
|
|
.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
.\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
|
|
|
|
.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
|
|
.\" DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2008-09-11 11:36:21 +00:00
|
|
|
.Dd September 8, 2008
|
2010-06-11 06:03:47 +00:00
|
|
|
.Dt INSMNTQUE 9
|
2008-02-26 21:09:54 +00:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
2008-09-11 11:36:21 +00:00
|
|
|
.Nm insmntque ,
|
|
|
|
.Nm insmntque1
|
2008-02-26 21:09:54 +00:00
|
|
|
.Nd "associate a vnode with a mount"
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In sys/param.h
|
|
|
|
.In sys/vnode.h
|
|
|
|
.Ft int
|
|
|
|
.Fn insmntque "struct vnode *vp" "struct mount *mp"
|
2008-09-11 11:36:21 +00:00
|
|
|
.Ft int
|
|
|
|
.Fn insmntque1 "struct vnode *vp" "struct mount *mp" "void (*dtr)(struct vnode *, void *)" "void *dtr_arg"
|
2008-02-26 21:09:54 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Fn insmntque
|
|
|
|
function associates a vnode with a mount.
|
|
|
|
This includes updating
|
|
|
|
.Va v_mount
|
2009-01-08 21:29:40 +00:00
|
|
|
for the vnode, and inserting the vnode into the mount's vnode list.
|
2008-02-26 21:09:54 +00:00
|
|
|
.Pp
|
|
|
|
The mount reference count is incremented for each vnode added to the
|
|
|
|
mount, and that reference is decremented by
|
2008-09-11 11:36:21 +00:00
|
|
|
.Xr vgone 9 .
|
2008-02-26 21:09:54 +00:00
|
|
|
.Pp
|
|
|
|
The mount's interlock is held while the vnode is inserted.
|
2008-09-11 11:36:21 +00:00
|
|
|
For MP-safe file systems, the vnode must be exclusively locked.
|
|
|
|
.Pp
|
|
|
|
On failure,
|
|
|
|
.Fn insmntque
|
|
|
|
calls
|
|
|
|
.Xr 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.
|
2008-02-26 21:09:54 +00:00
|
|
|
.Sh RETURN VALUES
|
2009-01-08 21:29:40 +00:00
|
|
|
The
|
2008-02-26 21:09:54 +00:00
|
|
|
.Fn insmntque
|
2009-01-08 21:29:40 +00:00
|
|
|
function will always return 0, unless the file system is currently being unmounted
|
2008-09-11 11:36:21 +00:00
|
|
|
in which case it may return
|
2008-02-26 21:09:54 +00:00
|
|
|
.Dv EBUSY .
|
2009-01-08 21:29:40 +00:00
|
|
|
Also,
|
2008-09-11 11:36:21 +00:00
|
|
|
.Fn insmntque
|
2009-01-08 21:29:40 +00:00
|
|
|
may be forced to insert the vnode into the mount's vnode list
|
2008-09-11 11:36:21 +00:00
|
|
|
by setting the
|
|
|
|
.Va VV_FORCEINSMQ
|
|
|
|
flag in the vnode
|
|
|
|
.Va v_flag ,
|
|
|
|
even if the file system is being unmounted.
|
2008-02-26 21:09:54 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr vgone 9
|
|
|
|
.Sh AUTHORS
|
|
|
|
This manual page was written by
|
2014-06-26 21:44:30 +00:00
|
|
|
.An Chad David Aq Mt davidc@acns.ab.ca .
|