| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: vfssubr.9,v 1.25 2014/05/24 17:14:02 wiz Exp $ | | 1 | .\" $NetBSD: vfssubr.9,v 1.26 2017/04/17 08:33:40 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 24, 2014 | | 30 | .Dd Apr 17, 2017 |
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 , |
| @@ -67,29 +67,29 @@ | | | @@ -67,29 +67,29 @@ |
67 | .Ft int | | 67 | .Ft int |
68 | .Fn vfs_export_lookup "struct mount *mp" "struct netexport *nep" \ | | 68 | .Fn vfs_export_lookup "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_setpublicfs "struct mount *mp" "struct netexport *nep" \ | | 71 | .Fn vfs_setpublicfs "struct mount *mp" "struct netexport *nep" \ |
72 | "struct export_args *argp" | | 72 | "struct export_args *argp" |
73 | .Ft int | | 73 | .Ft int |
74 | .Fn vfs_mountedon "struct vnode *vp" | | 74 | .Fn vfs_mountedon "struct vnode *vp" |
75 | .Ft int | | 75 | .Ft int |
76 | .Fn vfs_mountroot "void" | | 76 | .Fn vfs_mountroot "void" |
77 | .Ft void | | 77 | .Ft void |
78 | .Fn vfs_unmountall "struct lwp *l" | | 78 | .Fn vfs_unmountall "struct lwp *l" |
79 | .Ft int | | 79 | .Ft int |
80 | .Fn vfs_busy "struct mount *mp" "struct mount **nextp" | | 80 | .Fn vfs_busy "struct mount *mp" |
81 | .Ft void | | 81 | .Ft void |
82 | .Fn vfs_unbusy "struct mount *mp" "bool keepref" "struct mount **nextp" | | 82 | .Fn vfs_unbusy "struct mount *mp" |
83 | .Ft struct mount * | | 83 | .Ft struct mount * |
84 | .Fn vfs_mountalloc "struct vfsops *vfs" "struct vnode *vp" | | 84 | .Fn vfs_mountalloc "struct vfsops *vfs" "struct vnode *vp" |
85 | .Ft int | | 85 | .Ft int |
86 | .Fn vfs_rootmountalloc "char *fstypename" "char *devname" \ | | 86 | .Fn vfs_rootmountalloc "char *fstypename" "char *devname" \ |
87 | "struct mount **mpp" | | 87 | "struct mount **mpp" |
88 | .Ft void | | 88 | .Ft void |
89 | .Fn vfs_shutdown "void" | | 89 | .Fn vfs_shutdown "void" |
90 | .Ft int | | 90 | .Ft int |
91 | .Fn vfs_attach "struct vfsops *vfs" | | 91 | .Fn vfs_attach "struct vfsops *vfs" |
92 | .Ft int | | 92 | .Ft int |
93 | .Fn vfs_detach "struct vfsops *vfs" | | 93 | .Fn vfs_detach "struct vfsops *vfs" |
94 | .Ft void | | 94 | .Ft void |
95 | .Fn vfs_reinit "void" | | 95 | .Fn vfs_reinit "void" |
| @@ -129,79 +129,55 @@ is the address of the networked client. | | | @@ -129,79 +129,55 @@ is the address of the networked client. |
129 | This function is used by file system type specific functions to verify | | 129 | This function is used by file system type specific functions to verify |
130 | that the client can access the file system. | | 130 | that the client can access the file system. |
131 | .It Fn vfs_setpublicfs "mp" "nep" "argp" | | 131 | .It Fn vfs_setpublicfs "mp" "nep" "argp" |
132 | Set the publicly exported file system specified by the mount structure | | 132 | Set the publicly exported file system specified by the mount structure |
133 | .Fa mp . | | 133 | .Fa mp . |
134 | .It Fn vfs_mountedon "vp" | | 134 | .It Fn vfs_mountedon "vp" |
135 | Check to see if a file system is mounted on a block device specified | | 135 | Check to see if a file system is mounted on a block device specified |
136 | by the vnode | | 136 | by the vnode |
137 | .Fa vp . | | 137 | .Fa vp . |
138 | .It Fn vfs_mountroot "void" | | 138 | .It Fn vfs_mountroot "void" |
139 | Mount the root file system. | | 139 | Mount the root file system. |
140 | .It Fn vfs_unmountall "l" | | 140 | .It Fn vfs_unmountall "l" |
141 | Unmount all file systems. | | 141 | Unmount all file systems. |
142 | .It Fn vfs_busy "mp" "nextp" | | 142 | .It Fn vfs_busy "mp" |
143 | Mark the mount point specified by | | 143 | Mark the mount point specified by |
144 | .Fa mp | | 144 | .Fa mp |
145 | as busy and get a reference to it. | | 145 | as busy and get a reference to it. |
146 | This function is used to synchronize access and to delay unmounting. | | 146 | This function is used to synchronize access and to delay unmounting. |
147 | The caller must hold a pre-existing reference to the mount. | | 147 | The caller must hold a pre-existing reference to the mount. |
148 | If | | 148 | .It Fn vfs_unbusy "mp" |
149 | .Fa nextp | | | |
150 | is not | | | |
151 | .Dv NULL , | | | |
152 | the caller must hold the | | | |
153 | .Em mountlist_lock | | | |
154 | and | | | |
155 | .Fa nextp | | | |
156 | will receive the next mount from mount list on error. | | | |
157 | The | | | |
158 | .Em mountlist_lock | | | |
159 | is released on return. | | | |
160 | .It Fn vfs_unbusy "mp" "keepref" "nextp" | | | |
161 | Undo a | | 149 | Undo a |
162 | .Fn vfs_busy | | 150 | .Fn vfs_busy |
163 | on the mount point specified by | | 151 | on the mount point specified by |
164 | .Fa mp . | | 152 | .Fa mp . |
165 | If | | | |
166 | .Fa keepref | | | |
167 | is true, preserve the reference added by | | | |
168 | .Fn vfs_busy . | | | |
169 | If | | | |
170 | .Fa nextp | | | |
171 | is not | | | |
172 | .Dv NULL , | | | |
173 | the | | | |
174 | .Em mountlist_lock | | | |
175 | will be aquired and | | | |
176 | .Fa nextp | | | |
177 | will receive the next mount from mount list. | | | |
178 | .It Fn vfs_mountalloc "vfsops" "vp" | | 153 | .It Fn vfs_mountalloc "vfsops" "vp" |
179 | Allocate and initialise a mount structure, setting | | 154 | Allocate and initialise a mount structure, setting |
180 | .Em mnt_vnodecovered | | 155 | .Em mnt_vnodecovered |
181 | to | | 156 | to |
182 | .Fa vp | | 157 | .Fa vp |
183 | and | | 158 | and |
184 | .Em mnt_op | | 159 | .Em mnt_op |
185 | to | | 160 | to |
186 | .Fa vfsops . | | 161 | .Fa vfsops . |
187 | On success, mark the mount structure as busy and return its address. | | 162 | On success return the address of the mount structure. |
188 | Otherwise, return | | 163 | Otherwise, return |
189 | .Dv NULL . | | 164 | .Dv NULL . |
190 | .It Fn vfs_rootmountalloc "fstypename" "devname" "mpp" | | 165 | .It Fn vfs_rootmountalloc "fstypename" "devname" "mpp" |
191 | Lookup a file system type specified by the name | | 166 | Lookup a file system type specified by the name |
192 | .Fa fstypename | | 167 | .Fa fstypename |
193 | and if found allocate and initialise a mount structure for it. | | 168 | and if found allocate and initialise a mount structure for it. |
194 | The allocated mount structure is returned in the address specified by | | 169 | The allocated mount structure is marked as busy and returned in the |
| | | 170 | address specified by |
195 | .Fa mpp . | | 171 | .Fa mpp . |
196 | The device the root file system was mounted from is specified by the | | 172 | The device the root file system was mounted from is specified by the |
197 | argument | | 173 | argument |
198 | .Fa devname | | 174 | .Fa devname |
199 | and is recorded in the new mount structure. | | 175 | and is recorded in the new mount structure. |
200 | .It Fn vfs_shutdown | | 176 | .It Fn vfs_shutdown |
201 | Sync and unmount all file systems before shutting down. | | 177 | Sync and unmount all file systems before shutting down. |
202 | Invoked by | | 178 | Invoked by |
203 | .Xr cpu_reboot 9 . | | 179 | .Xr cpu_reboot 9 . |
204 | .It Fn vfs_attach "vfs" | | 180 | .It Fn vfs_attach "vfs" |
205 | Establish file system | | 181 | Establish file system |
206 | .Fa vfs | | 182 | .Fa vfs |
207 | and initialise it. | | 183 | and initialise it. |