Sat Feb 22 10:05:54 2014 UTC ()
Update the description of vfs_busy() and vfs_unbusy().


(hannken)
diff -r1.20 -r1.21 src/share/man/man9/vfssubr.9

cvs diff -r1.20 -r1.21 src/share/man/man9/vfssubr.9 (expand / switch to unified diff)

--- src/share/man/man9/vfssubr.9 2010/12/02 12:54:13 1.20
+++ src/share/man/man9/vfssubr.9 2014/02/22 10:05:54 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: vfssubr.9,v 1.20 2010/12/02 12:54:13 wiz Exp $ 1.\" $NetBSD: vfssubr.9,v 1.21 2014/02/22 10:05:54 hannken Exp $
2.\" 2.\"
3.\" Copyright (c) 2003, 2005, 2006 The NetBSD Foundation, Inc. 3.\" Copyright (c) 2003, 2005, 2006 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Gregory McGarry. 7.\" by Gregory McGarry.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17.\" 17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE. 28.\" POSSIBILITY OF SUCH DAMAGE.
29.\" 29.\"
30.Dd May 9, 2009 30.Dd February 22, 2014
31.Dt VFSSUBR 9 31.Dt VFSSUBR 9
32.Os 32.Os
33.Sh NAME 33.Sh NAME
34.Nm vfssubr , 34.Nm vfssubr ,
35.Nm vfs_getnewfsid , 35.Nm vfs_getnewfsid ,
36.Nm vfs_getvfs , 36.Nm vfs_getvfs ,
37.Nm vfs_export , 37.Nm vfs_export ,
38.Nm vfs_showexport , 38.Nm vfs_showexport ,
39.Nm vfs_export_lookup , 39.Nm vfs_export_lookup ,
40.Nm vfs_setpublicfs , 40.Nm vfs_setpublicfs ,
41.Nm vfs_mountedon , 41.Nm vfs_mountedon ,
42.Nm vfs_mountroot , 42.Nm vfs_mountroot ,
43.Nm vfs_unmountall , 43.Nm vfs_unmountall ,
@@ -64,29 +64,29 @@ @@ -64,29 +64,29 @@
64.Ft int 64.Ft int
65.Fn vfs_export_lookup "struct mount *mp" "struct netexport *nep" \ 65.Fn vfs_export_lookup "struct mount *mp" "struct netexport *nep" \
66"struct export_args *argp" 66"struct export_args *argp"
67.Ft int 67.Ft int
68.Fn vfs_setpublicfs "struct mount *mp" "struct netexport *nep" \ 68.Fn vfs_setpublicfs "struct mount *mp" "struct netexport *nep" \
69"struct export_args *argp" 69"struct export_args *argp"
70.Ft int 70.Ft int
71.Fn vfs_mountedon "struct vnode *vp" 71.Fn vfs_mountedon "struct vnode *vp"
72.Ft int 72.Ft int
73.Fn vfs_mountroot "void" 73.Fn vfs_mountroot "void"
74.Ft void 74.Ft void
75.Fn vfs_unmountall "struct lwp *l" 75.Fn vfs_unmountall "struct lwp *l"
76.Ft int 76.Ft int
77.Fn vfs_busy "struct mount *mp" "int flags" "struct simplelock *interlkp" 77.Fn vfs_busy "struct mount *mp" "struct mount **nextp"
78.Ft void 78.Ft void
79.Fn vfs_unbusy "struct mount *mp" 79.Fn vfs_unbusy "struct mount *mp" "bool keepref" "struct mount **nextp"
80.Ft struct mount * 80.Ft struct mount *
81.Fn vfs_mountalloc "struct vfsops *vfs" "struct vnode *vp" 81.Fn vfs_mountalloc "struct vfsops *vfs" "struct vnode *vp"
82.Ft int 82.Ft int
83.Fn vfs_rootmountalloc "char *fstypename" "char *devname" \ 83.Fn vfs_rootmountalloc "char *fstypename" "char *devname" \
84"struct mount **mpp" 84"struct mount **mpp"
85.Ft void 85.Ft void
86.Fn vfs_shutdown "void" 86.Fn vfs_shutdown "void"
87.Ft int 87.Ft int
88.Fn vfs_attach "struct vfsops *vfs" 88.Fn vfs_attach "struct vfsops *vfs"
89.Ft int 89.Ft int
90.Fn vfs_detach "struct vfsops *vfs" 90.Fn vfs_detach "struct vfsops *vfs"
91.Ft void 91.Ft void
92.Fn vfs_reinit "void" 92.Fn vfs_reinit "void"
@@ -120,37 +120,58 @@ is the address of the networked client. @@ -120,37 +120,58 @@ is the address of the networked client.
120This function is used by file system type specific functions to verify 120This function is used by file system type specific functions to verify
121that the client can access the file system. 121that the client can access the file system.
122.It Fn vfs_setpublicfs "mp" "nep" "argp" 122.It Fn vfs_setpublicfs "mp" "nep" "argp"
123Set the publicly exported file system specified by the mount structure 123Set the publicly exported file system specified by the mount structure
124.Fa mp . 124.Fa mp .
125.It Fn vfs_mountedon "vp" 125.It Fn vfs_mountedon "vp"
126Check to see if a file system is mounted on a block device specified 126Check to see if a file system is mounted on a block device specified
127by the vnode 127by the vnode
128.Fa vp . 128.Fa vp .
129.It Fn vfs_mountroot "void" 129.It Fn vfs_mountroot "void"
130Mount the root file system. 130Mount the root file system.
131.It Fn vfs_unmountall "l" 131.It Fn vfs_unmountall "l"
132Unmount all file systems. 132Unmount all file systems.
133.It Fn vfs_busy "mp" "flags" "interlkp" 133.It Fn vfs_busy "mp" "nextp"
134Mark the mount point specified by 134Mark the mount point specified by
135.Fa mp 135.Fa mp
136as busy. 136as busy and get a reference to it.
137This function is used to synchronize access and to delay unmounting. 137This function is used to synchronize access and to delay unmounting.
138The interlock specified by argument 138The caller must hold a pre-existing reference to the mount.
139.Fa interlkp 139If
140is not released on failure. 140.Fa nextp
141.It Fn vfs_unbusy "mp" 141is not NULL, the caller must hold the
142Free the busy file system specified by the mount structure 142.Em mountlist_lock
 143and
 144.Fa nextp
 145will receive the next mount from mount list on error.
 146The
 147.Em mountlist_lock
 148is released on return.
 149.It Fn vfs_unbusy "mp" "keepref" "nextp"
 150Undo a
 151.Fn vfs_busy
 152on the mount point specified by
143.Fa mp . 153.Fa mp .
 154If
 155.Fa keepref
 156is true, preserve the reference added by
 157.Fn vfs_busy .
 158If
 159.Fa nextp
 160is not NULL, the
 161.Em mountlist_lock
 162will be aquired and
 163.Fa nextp
 164will receive the next mount from mount list.
144.It Fn vfs_mountalloc "vfsops" "vp" 165.It Fn vfs_mountalloc "vfsops" "vp"
145Allocate and initialise a mount structure, setting 166Allocate and initialise a mount structure, setting
146.Em mnt_vnodecovered 167.Em mnt_vnodecovered
147to 168to
148.Fa vp 169.Fa vp
149and 170and
150.Em mnt_op 171.Em mnt_op
151to 172to
152.Fa vfsops . 173.Fa vfsops .
153On success, mark the mount structure as busy and return its address. 174On success, mark the mount structure as busy and return its address.
154Otherwise, return 175Otherwise, return
155.Dv NULL . 176.Dv NULL .
156.It Fn vfs_rootmountalloc "fstypename" "devname" "mpp" 177.It Fn vfs_rootmountalloc "fstypename" "devname" "mpp"