summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-09-11 11:36:21 +0000
committerkib <kib@FreeBSD.org>2008-09-11 11:36:21 +0000
commite3f791c62ff3f65fbcb393c19d975dd307dc28ed (patch)
treef9661c45bff270ad3917b7dec1a3da522c4140d5 /share
parent0d6a982e10174323c8b14954cf327f73604b8453 (diff)
downloadFreeBSD-src-e3f791c62ff3f65fbcb393c19d975dd307dc28ed.zip
FreeBSD-src-e3f791c62ff3f65fbcb393c19d975dd307dc28ed.tar.gz
Update insmntque(9) manpage, bringing it close to reality.
Reviewed by: brueffer
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/insmntque.940
1 files changed, 36 insertions, 4 deletions
diff --git a/share/man/man9/insmntque.9 b/share/man/man9/insmntque.9
index 42c7cb6..204d288 100644
--- a/share/man/man9/insmntque.9
+++ b/share/man/man9/insmntque.9
@@ -26,17 +26,20 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 25, 2008
+.Dd September 8, 2008
.Dt insmntque 9
.Os
.Sh NAME
-.Nm insmntque
+.Nm insmntque ,
+.Nm insmntque1
.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"
+.Ft int
+.Fn insmntque1 "struct vnode *vp" "struct mount *mp" "void (*dtr)(struct vnode *, void *)" "void *dtr_arg"
.Sh DESCRIPTION
The
.Fn insmntque
@@ -47,14 +50,43 @@ for the vnode, and inserting the vnode into the mounts vnode list.
.Pp
The mount reference count is incremented for each vnode added to the
mount, and that reference is decremented by
-.Fn vgone 9 .
+.Xr vgone 9 .
.Pp
The mount's interlock is held while the vnode is inserted.
+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.
.Sh RETURN VALUES
.Fn insmntque
will always return 0, unless the file system is currently being unmounted
-in which case it will return
+in which case it may return
.Dv EBUSY .
+The
+.Fn insmntque
+function may be forced to insert the vnode into the mount's vnode list
+by setting the
+.Va VV_FORCEINSMQ
+flag in the vnode
+.Va v_flag ,
+even if the file system is being unmounted.
.Sh SEE ALSO
.Xr vgone 9
.Sh AUTHORS
OpenPOWER on IntegriCloud