Add field "mnt_lower" to "struct mount" to track the file system a layered file system is mounted on. Welcome to 7.99.65diff -r1.76 -r1.77 src/sys/fs/union/union_vfsops.c
(hannken)
--- src/sys/fs/union/union_vfsops.c 2017/02/17 08:31:25 1.76
+++ src/sys/fs/union/union_vfsops.c 2017/03/06 10:10:07 1.77
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: union_vfsops.c,v 1.76 2017/02/17 08:31:25 hannken Exp $ */ | 1 | /* $NetBSD: union_vfsops.c,v 1.77 2017/03/06 10:10:07 hannken Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1994 The Regents of the University of California. | 4 | * Copyright (c) 1994 The Regents of the University of California. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software donated to Berkeley by | 7 | * This code is derived from software donated to Berkeley by | |
8 | * Jan-Simon Pendry. | 8 | * Jan-Simon Pendry. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -67,27 +67,27 @@ | @@ -67,27 +67,27 @@ | |||
67 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 67 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
68 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 68 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
69 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 69 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
70 | * SUCH DAMAGE. | 70 | * SUCH DAMAGE. | |
71 | * | 71 | * | |
72 | * @(#)union_vfsops.c 8.20 (Berkeley) 5/20/95 | 72 | * @(#)union_vfsops.c 8.20 (Berkeley) 5/20/95 | |
73 | */ | 73 | */ | |
74 | 74 | |||
75 | /* | 75 | /* | |
76 | * Union Layer | 76 | * Union Layer | |
77 | */ | 77 | */ | |
78 | 78 | |||
79 | #include <sys/cdefs.h> | 79 | #include <sys/cdefs.h> | |
80 | __KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.76 2017/02/17 08:31:25 hannken Exp $"); | 80 | __KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.77 2017/03/06 10:10:07 hannken Exp $"); | |
81 | 81 | |||
82 | #include <sys/param.h> | 82 | #include <sys/param.h> | |
83 | #include <sys/systm.h> | 83 | #include <sys/systm.h> | |
84 | #include <sys/sysctl.h> | 84 | #include <sys/sysctl.h> | |
85 | #include <sys/time.h> | 85 | #include <sys/time.h> | |
86 | #include <sys/proc.h> | 86 | #include <sys/proc.h> | |
87 | #include <sys/vnode.h> | 87 | #include <sys/vnode.h> | |
88 | #include <sys/mount.h> | 88 | #include <sys/mount.h> | |
89 | #include <sys/namei.h> | 89 | #include <sys/namei.h> | |
90 | #include <sys/malloc.h> | 90 | #include <sys/malloc.h> | |
91 | #include <sys/filedesc.h> | 91 | #include <sys/filedesc.h> | |
92 | #include <sys/queue.h> | 92 | #include <sys/queue.h> | |
93 | #include <sys/stat.h> | 93 | #include <sys/stat.h> | |
@@ -242,26 +242,28 @@ union_mount(struct mount *mp, const char | @@ -242,26 +242,28 @@ union_mount(struct mount *mp, const char | |||
242 | * mount of the underlying filesystem to go from rdonly to rdwr | 242 | * mount of the underlying filesystem to go from rdonly to rdwr | |
243 | * will leave the unioned view as read-only. | 243 | * will leave the unioned view as read-only. | |
244 | */ | 244 | */ | |
245 | mp->mnt_flag |= (um->um_uppervp->v_mount->mnt_flag & MNT_RDONLY); | 245 | mp->mnt_flag |= (um->um_uppervp->v_mount->mnt_flag & MNT_RDONLY); | |
246 | 246 | |||
247 | mp->mnt_data = um; | 247 | mp->mnt_data = um; | |
248 | vfs_getnewfsid(mp); | 248 | vfs_getnewfsid(mp); | |
249 | 249 | |||
250 | error = set_statvfs_info( path, UIO_USERSPACE, NULL, UIO_USERSPACE, | 250 | error = set_statvfs_info( path, UIO_USERSPACE, NULL, UIO_USERSPACE, | |
251 | mp->mnt_op->vfs_name, mp, l); | 251 | mp->mnt_op->vfs_name, mp, l); | |
252 | if (error) | 252 | if (error) | |
253 | goto bad; | 253 | goto bad; | |
254 | 254 | |||
255 | mp->mnt_lower = um->um_uppervp->v_mount; | |||
256 | ||||
255 | switch (um->um_op) { | 257 | switch (um->um_op) { | |
256 | case UNMNT_ABOVE: | 258 | case UNMNT_ABOVE: | |
257 | cp = "<above>:"; | 259 | cp = "<above>:"; | |
258 | break; | 260 | break; | |
259 | case UNMNT_BELOW: | 261 | case UNMNT_BELOW: | |
260 | cp = "<below>:"; | 262 | cp = "<below>:"; | |
261 | break; | 263 | break; | |
262 | case UNMNT_REPLACE: | 264 | case UNMNT_REPLACE: | |
263 | cp = ""; | 265 | cp = ""; | |
264 | break; | 266 | break; | |
265 | default: | 267 | default: | |
266 | cp = "<invalid>:"; | 268 | cp = "<invalid>:"; | |
267 | #ifdef DIAGNOSTIC | 269 | #ifdef DIAGNOSTIC |
--- src/sys/miscfs/nullfs/null_vfsops.c 2017/02/17 08:31:25 1.91
+++ src/sys/miscfs/nullfs/null_vfsops.c 2017/03/06 10:10:07 1.92
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: null_vfsops.c,v 1.91 2017/02/17 08:31:25 hannken Exp $ */ | 1 | /* $NetBSD: null_vfsops.c,v 1.92 2017/03/06 10:10:07 hannken Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1999 National Aeronautics & Space Administration | 4 | * Copyright (c) 1999 National Aeronautics & Space Administration | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This software was written by William Studenmund of the | 7 | * This software was written by William Studenmund of the | |
8 | * Numerical Aerospace Simulation Facility, NASA Ames Research Center. | 8 | * Numerical Aerospace Simulation Facility, NASA Ames Research Center. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -66,27 +66,27 @@ | @@ -66,27 +66,27 @@ | |||
66 | * | 66 | * | |
67 | * from: Id: lofs_vfsops.c,v 1.9 1992/05/30 10:26:24 jsp Exp | 67 | * from: Id: lofs_vfsops.c,v 1.9 1992/05/30 10:26:24 jsp Exp | |
68 | * from: @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 | 68 | * from: @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 | |
69 | * @(#)null_vfsops.c 8.7 (Berkeley) 5/14/95 | 69 | * @(#)null_vfsops.c 8.7 (Berkeley) 5/14/95 | |
70 | */ | 70 | */ | |
71 | 71 | |||
72 | /* | 72 | /* | |
73 | * Null file-system: VFS operations. | 73 | * Null file-system: VFS operations. | |
74 | * | 74 | * | |
75 | * See null_vnops.c for a description. | 75 | * See null_vnops.c for a description. | |
76 | */ | 76 | */ | |
77 | 77 | |||
78 | #include <sys/cdefs.h> | 78 | #include <sys/cdefs.h> | |
79 | __KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.91 2017/02/17 08:31:25 hannken Exp $"); | 79 | __KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.92 2017/03/06 10:10:07 hannken Exp $"); | |
80 | 80 | |||
81 | #include <sys/param.h> | 81 | #include <sys/param.h> | |
82 | #include <sys/systm.h> | 82 | #include <sys/systm.h> | |
83 | #include <sys/sysctl.h> | 83 | #include <sys/sysctl.h> | |
84 | #include <sys/vnode.h> | 84 | #include <sys/vnode.h> | |
85 | #include <sys/mount.h> | 85 | #include <sys/mount.h> | |
86 | #include <sys/namei.h> | 86 | #include <sys/namei.h> | |
87 | #include <sys/module.h> | 87 | #include <sys/module.h> | |
88 | 88 | |||
89 | #include <miscfs/nullfs/null.h> | 89 | #include <miscfs/nullfs/null.h> | |
90 | #include <miscfs/genfs/layer_extern.h> | 90 | #include <miscfs/genfs/layer_extern.h> | |
91 | 91 | |||
92 | MODULE(MODULE_CLASS_VFS, null, "layerfs"); | 92 | MODULE(MODULE_CLASS_VFS, null, "layerfs"); | |
@@ -160,26 +160,27 @@ nullfs_mount(struct mount *mp, const cha | @@ -160,26 +160,27 @@ nullfs_mount(struct mount *mp, const cha | |||
160 | error = layer_node_create(mp, lowerrootvp, &vp); | 160 | error = layer_node_create(mp, lowerrootvp, &vp); | |
161 | if (error) { | 161 | if (error) { | |
162 | vrele(lowerrootvp); | 162 | vrele(lowerrootvp); | |
163 | kmem_free(nmp, sizeof(struct null_mount)); | 163 | kmem_free(nmp, sizeof(struct null_mount)); | |
164 | return error; | 164 | return error; | |
165 | } | 165 | } | |
166 | /* | 166 | /* | |
167 | * Keep a held reference to the root vnode. It will be released on | 167 | * Keep a held reference to the root vnode. It will be released on | |
168 | * umount. Note: nullfs is MP-safe. | 168 | * umount. Note: nullfs is MP-safe. | |
169 | */ | 169 | */ | |
170 | vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); | 170 | vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); | |
171 | vp->v_vflag |= VV_ROOT; | 171 | vp->v_vflag |= VV_ROOT; | |
172 | nmp->nullm_rootvp = vp; | 172 | nmp->nullm_rootvp = vp; | |
173 | mp->mnt_lower = nmp->nullm_vfs; | |||
173 | mp->mnt_iflag |= IMNT_MPSAFE; | 174 | mp->mnt_iflag |= IMNT_MPSAFE; | |
174 | VOP_UNLOCK(vp); | 175 | VOP_UNLOCK(vp); | |
175 | 176 | |||
176 | error = set_statvfs_info(path, UIO_USERSPACE, args->la.target, | 177 | error = set_statvfs_info(path, UIO_USERSPACE, args->la.target, | |
177 | UIO_USERSPACE, mp->mnt_op->vfs_name, mp, curlwp); | 178 | UIO_USERSPACE, mp->mnt_op->vfs_name, mp, curlwp); | |
178 | return error; | 179 | return error; | |
179 | } | 180 | } | |
180 | 181 | |||
181 | int | 182 | int | |
182 | nullfs_unmount(struct mount *mp, int mntflags) | 183 | nullfs_unmount(struct mount *mp, int mntflags) | |
183 | { | 184 | { | |
184 | struct null_mount *nmp = MOUNTTONULLMOUNT(mp); | 185 | struct null_mount *nmp = MOUNTTONULLMOUNT(mp); | |
185 | struct vnode *null_rootvp = nmp->nullm_rootvp; | 186 | struct vnode *null_rootvp = nmp->nullm_rootvp; |
--- src/sys/miscfs/overlay/overlay_vfsops.c 2017/02/17 08:31:25 1.64
+++ src/sys/miscfs/overlay/overlay_vfsops.c 2017/03/06 10:10:07 1.65
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: overlay_vfsops.c,v 1.64 2017/02/17 08:31:25 hannken Exp $ */ | 1 | /* $NetBSD: overlay_vfsops.c,v 1.65 2017/03/06 10:10:07 hannken Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1999, 2000 National Aeronautics & Space Administration | 4 | * Copyright (c) 1999, 2000 National Aeronautics & Space Administration | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This software was written by William Studenmund of the | 7 | * This software was written by William Studenmund of the | |
8 | * Numerical Aerospace Simulation Facility, NASA Ames Research Center. | 8 | * Numerical Aerospace Simulation Facility, NASA Ames Research Center. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -64,27 +64,27 @@ | @@ -64,27 +64,27 @@ | |||
64 | * SUCH DAMAGE. | 64 | * SUCH DAMAGE. | |
65 | * | 65 | * | |
66 | * from: Id: lofs_vfsops.c,v 1.9 1992/05/30 10:26:24 jsp Exp | 66 | * from: Id: lofs_vfsops.c,v 1.9 1992/05/30 10:26:24 jsp Exp | |
67 | * from: @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 | 67 | * from: @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 | |
68 | * @(#)null_vfsops.c 8.7 (Berkeley) 5/14/95 | 68 | * @(#)null_vfsops.c 8.7 (Berkeley) 5/14/95 | |
69 | */ | 69 | */ | |
70 | 70 | |||
71 | /* | 71 | /* | |
72 | * Overlay Layer | 72 | * Overlay Layer | |
73 | * (See overlay_vnops.c for a description of what this does.) | 73 | * (See overlay_vnops.c for a description of what this does.) | |
74 | */ | 74 | */ | |
75 | 75 | |||
76 | #include <sys/cdefs.h> | 76 | #include <sys/cdefs.h> | |
77 | __KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.64 2017/02/17 08:31:25 hannken Exp $"); | 77 | __KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.65 2017/03/06 10:10:07 hannken Exp $"); | |
78 | 78 | |||
79 | #include <sys/param.h> | 79 | #include <sys/param.h> | |
80 | #include <sys/systm.h> | 80 | #include <sys/systm.h> | |
81 | #include <sys/sysctl.h> | 81 | #include <sys/sysctl.h> | |
82 | #include <sys/time.h> | 82 | #include <sys/time.h> | |
83 | #include <sys/proc.h> | 83 | #include <sys/proc.h> | |
84 | #include <sys/vnode.h> | 84 | #include <sys/vnode.h> | |
85 | #include <sys/mount.h> | 85 | #include <sys/mount.h> | |
86 | #include <sys/namei.h> | 86 | #include <sys/namei.h> | |
87 | #include <sys/module.h> | 87 | #include <sys/module.h> | |
88 | #include <miscfs/overlay/overlay.h> | 88 | #include <miscfs/overlay/overlay.h> | |
89 | #include <miscfs/genfs/layer_extern.h> | 89 | #include <miscfs/genfs/layer_extern.h> | |
90 | 90 | |||
@@ -175,26 +175,27 @@ ov_mount(struct mount *mp, const char *p | @@ -175,26 +175,27 @@ ov_mount(struct mount *mp, const char *p | |||
175 | if (error) { | 175 | if (error) { | |
176 | vrele(lowerrootvp); | 176 | vrele(lowerrootvp); | |
177 | kmem_free(nmp, sizeof(struct overlay_mount)); | 177 | kmem_free(nmp, sizeof(struct overlay_mount)); | |
178 | return error; | 178 | return error; | |
179 | } | 179 | } | |
180 | 180 | |||
181 | /* | 181 | /* | |
182 | * Keep a held reference to the root vnode. | 182 | * Keep a held reference to the root vnode. | |
183 | * It is vrele'd in ov_unmount. | 183 | * It is vrele'd in ov_unmount. | |
184 | */ | 184 | */ | |
185 | vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); | 185 | vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); | |
186 | vp->v_vflag |= VV_ROOT; | 186 | vp->v_vflag |= VV_ROOT; | |
187 | nmp->ovm_rootvp = vp; | 187 | nmp->ovm_rootvp = vp; | |
188 | mp->mnt_lower = nmp->ovm_vfs; | |||
188 | VOP_UNLOCK(vp); | 189 | VOP_UNLOCK(vp); | |
189 | 190 | |||
190 | error = set_statvfs_info(path, UIO_USERSPACE, args->la.target, | 191 | error = set_statvfs_info(path, UIO_USERSPACE, args->la.target, | |
191 | UIO_USERSPACE, mp->mnt_op->vfs_name, mp, l); | 192 | UIO_USERSPACE, mp->mnt_op->vfs_name, mp, l); | |
192 | #ifdef OVERLAYFS_DIAGNOSTIC | 193 | #ifdef OVERLAYFS_DIAGNOSTIC | |
193 | printf("ov_mount: lower %s, alias at %s\n", | 194 | printf("ov_mount: lower %s, alias at %s\n", | |
194 | mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); | 195 | mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); | |
195 | #endif | 196 | #endif | |
196 | return error; | 197 | return error; | |
197 | } | 198 | } | |
198 | 199 | |||
199 | /* | 200 | /* | |
200 | * Free reference to overlay layer | 201 | * Free reference to overlay layer |
--- src/sys/miscfs/umapfs/umap_vfsops.c 2017/02/17 08:31:25 1.96
+++ src/sys/miscfs/umapfs/umap_vfsops.c 2017/03/06 10:10:07 1.97
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: umap_vfsops.c,v 1.96 2017/02/17 08:31:25 hannken Exp $ */ | 1 | /* $NetBSD: umap_vfsops.c,v 1.97 2017/03/06 10:10:07 hannken Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1992, 1993 | 4 | * Copyright (c) 1992, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software donated to Berkeley by | 7 | * This code is derived from software donated to Berkeley by | |
8 | * the UCLA Ficus project. | 8 | * the UCLA Ficus project. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -31,27 +31,27 @@ | @@ -31,27 +31,27 @@ | |||
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
32 | * SUCH DAMAGE. | 32 | * SUCH DAMAGE. | |
33 | * | 33 | * | |
34 | * from: @(#)null_vfsops.c 1.5 (Berkeley) 7/10/92 | 34 | * from: @(#)null_vfsops.c 1.5 (Berkeley) 7/10/92 | |
35 | * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 | 35 | * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | /* | 38 | /* | |
39 | * Umap Layer | 39 | * Umap Layer | |
40 | * (See mount_umap(8) for a description of this layer.) | 40 | * (See mount_umap(8) for a description of this layer.) | |
41 | */ | 41 | */ | |
42 | 42 | |||
43 | #include <sys/cdefs.h> | 43 | #include <sys/cdefs.h> | |
44 | __KERNEL_RCSID(0, "$NetBSD: umap_vfsops.c,v 1.96 2017/02/17 08:31:25 hannken Exp $"); | 44 | __KERNEL_RCSID(0, "$NetBSD: umap_vfsops.c,v 1.97 2017/03/06 10:10:07 hannken Exp $"); | |
45 | 45 | |||
46 | #include <sys/param.h> | 46 | #include <sys/param.h> | |
47 | #include <sys/systm.h> | 47 | #include <sys/systm.h> | |
48 | #include <sys/sysctl.h> | 48 | #include <sys/sysctl.h> | |
49 | #include <sys/proc.h> | 49 | #include <sys/proc.h> | |
50 | #include <sys/time.h> | 50 | #include <sys/time.h> | |
51 | #include <sys/vnode.h> | 51 | #include <sys/vnode.h> | |
52 | #include <sys/mount.h> | 52 | #include <sys/mount.h> | |
53 | #include <sys/namei.h> | 53 | #include <sys/namei.h> | |
54 | #include <sys/kauth.h> | 54 | #include <sys/kauth.h> | |
55 | #include <sys/module.h> | 55 | #include <sys/module.h> | |
56 | 56 | |||
57 | #include <miscfs/umapfs/umap.h> | 57 | #include <miscfs/umapfs/umap.h> | |
@@ -210,26 +210,27 @@ umapfs_mount(struct mount *mp, const cha | @@ -210,26 +210,27 @@ umapfs_mount(struct mount *mp, const cha | |||
210 | if (error) { | 210 | if (error) { | |
211 | vrele(lowerrootvp); | 211 | vrele(lowerrootvp); | |
212 | kmem_free(amp, sizeof(struct umap_mount)); | 212 | kmem_free(amp, sizeof(struct umap_mount)); | |
213 | return error; | 213 | return error; | |
214 | } | 214 | } | |
215 | 215 | |||
216 | /* | 216 | /* | |
217 | * Keep a held reference to the root vnode. | 217 | * Keep a held reference to the root vnode. | |
218 | * It is vrele'd in umapfs_unmount. | 218 | * It is vrele'd in umapfs_unmount. | |
219 | */ | 219 | */ | |
220 | vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); | 220 | vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); | |
221 | vp->v_vflag |= VV_ROOT; | 221 | vp->v_vflag |= VV_ROOT; | |
222 | amp->umapm_rootvp = vp; | 222 | amp->umapm_rootvp = vp; | |
223 | mp->mnt_lower = amp->umapm_vfs; | |||
223 | VOP_UNLOCK(vp); | 224 | VOP_UNLOCK(vp); | |
224 | 225 | |||
225 | error = set_statvfs_info(path, UIO_USERSPACE, args->umap_target, | 226 | error = set_statvfs_info(path, UIO_USERSPACE, args->umap_target, | |
226 | UIO_USERSPACE, mp->mnt_op->vfs_name, mp, l); | 227 | UIO_USERSPACE, mp->mnt_op->vfs_name, mp, l); | |
227 | #ifdef UMAPFS_DIAGNOSTIC | 228 | #ifdef UMAPFS_DIAGNOSTIC | |
228 | printf("umapfs_mount: lower %s, alias at %s\n", | 229 | printf("umapfs_mount: lower %s, alias at %s\n", | |
229 | mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); | 230 | mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); | |
230 | #endif | 231 | #endif | |
231 | return error; | 232 | return error; | |
232 | } | 233 | } | |
233 | 234 | |||
234 | /* | 235 | /* | |
235 | * Free reference to umap layer | 236 | * Free reference to umap layer |
--- src/sys/sys/mount.h 2017/01/11 09:07:57 1.220
+++ src/sys/sys/mount.h 2017/03/06 10:10:07 1.221
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mount.h,v 1.220 2017/01/11 09:07:57 hannken Exp $ */ | 1 | /* $NetBSD: mount.h,v 1.221 2017/03/06 10:10:07 hannken Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1989, 1991, 1993 | 4 | * Copyright (c) 1989, 1991, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -103,26 +103,27 @@ struct vnode; | @@ -103,26 +103,27 @@ struct vnode; | |||
103 | struct vnode_impl; | 103 | struct vnode_impl; | |
104 | struct vattr; | 104 | struct vattr; | |
105 | 105 | |||
106 | /* | 106 | /* | |
107 | * Structure per mounted file system. Each mounted file system has an | 107 | * Structure per mounted file system. Each mounted file system has an | |
108 | * array of operations and an instance record. The file systems are | 108 | * array of operations and an instance record. The file systems are | |
109 | * put on a doubly linked list. | 109 | * put on a doubly linked list. | |
110 | */ | 110 | */ | |
111 | struct mount { | 111 | struct mount { | |
112 | TAILQ_ENTRY(mount) mnt_list; /* mount list */ | 112 | TAILQ_ENTRY(mount) mnt_list; /* mount list */ | |
113 | TAILQ_HEAD(, vnode_impl) mnt_vnodelist; /* list of vnodes this mount */ | 113 | TAILQ_HEAD(, vnode_impl) mnt_vnodelist; /* list of vnodes this mount */ | |
114 | struct vfsops *mnt_op; /* operations on fs */ | 114 | struct vfsops *mnt_op; /* operations on fs */ | |
115 | struct vnode *mnt_vnodecovered; /* vnode we mounted on */ | 115 | struct vnode *mnt_vnodecovered; /* vnode we mounted on */ | |
116 | struct mount *mnt_lower; /* fs mounted on */ | |||
116 | int mnt_synclist_slot; /* synclist slot index */ | 117 | int mnt_synclist_slot; /* synclist slot index */ | |
117 | void *mnt_transinfo; /* for FS-internal use */ | 118 | void *mnt_transinfo; /* for FS-internal use */ | |
118 | void *mnt_data; /* private data */ | 119 | void *mnt_data; /* private data */ | |
119 | kmutex_t mnt_unmounting; /* to prevent new activity */ | 120 | kmutex_t mnt_unmounting; /* to prevent new activity */ | |
120 | kmutex_t mnt_renamelock; /* per-fs rename lock */ | 121 | kmutex_t mnt_renamelock; /* per-fs rename lock */ | |
121 | int mnt_refcnt; /* ref count on this structure */ | 122 | int mnt_refcnt; /* ref count on this structure */ | |
122 | unsigned int mnt_busynest; /* vfs_busy nestings */ | 123 | unsigned int mnt_busynest; /* vfs_busy nestings */ | |
123 | int mnt_flag; /* flags */ | 124 | int mnt_flag; /* flags */ | |
124 | int mnt_iflag; /* internal flags */ | 125 | int mnt_iflag; /* internal flags */ | |
125 | int mnt_fs_bshift; /* offset shift for lblkno */ | 126 | int mnt_fs_bshift; /* offset shift for lblkno */ | |
126 | int mnt_dev_bshift; /* shift for device sectors */ | 127 | int mnt_dev_bshift; /* shift for device sectors */ | |
127 | struct statvfs mnt_stat; /* cache of filesystem stats */ | 128 | struct statvfs mnt_stat; /* cache of filesystem stats */ | |
128 | specificdata_reference | 129 | specificdata_reference |
--- src/sys/sys/param.h 2017/03/01 10:44:47 1.531
+++ src/sys/sys/param.h 2017/03/06 10:10:07 1.532
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: param.h,v 1.531 2017/03/01 10:44:47 hannken Exp $ */ | 1 | /* $NetBSD: param.h,v 1.532 2017/03/06 10:10:07 hannken Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1982, 1986, 1989, 1993 | 4 | * Copyright (c) 1982, 1986, 1989, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * (c) UNIX System Laboratories, Inc. | 6 | * (c) UNIX System Laboratories, Inc. | |
7 | * All or some portions of this file are derived from material licensed | 7 | * All or some portions of this file are derived from material licensed | |
8 | * to the University of California by American Telephone and Telegraph | 8 | * to the University of California by American Telephone and Telegraph | |
9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | 9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | |
10 | * the permission of UNIX System Laboratories, Inc. | 10 | * the permission of UNIX System Laboratories, Inc. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -57,27 +57,27 @@ | @@ -57,27 +57,27 @@ | |||
57 | * m = minor version; a minor number of 99 indicates current. | 57 | * m = minor version; a minor number of 99 indicates current. | |
58 | * r = 0 (*) | 58 | * r = 0 (*) | |
59 | * p = patchlevel | 59 | * p = patchlevel | |
60 | * | 60 | * | |
61 | * When new releases are made, src/gnu/usr.bin/groff/tmac/mdoc.local | 61 | * When new releases are made, src/gnu/usr.bin/groff/tmac/mdoc.local | |
62 | * needs to be updated and the changes sent back to the groff maintainers. | 62 | * needs to be updated and the changes sent back to the groff maintainers. | |
63 | * | 63 | * | |
64 | * (*) Up to 2.0I "release" used to be "",A-Z,Z[A-Z] but numeric | 64 | * (*) Up to 2.0I "release" used to be "",A-Z,Z[A-Z] but numeric | |
65 | * e.g. NetBSD-1.2D = 102040000 ('D' == 4) | 65 | * e.g. NetBSD-1.2D = 102040000 ('D' == 4) | |
66 | * NetBSD-2.0H (200080000) was changed on 20041001 to: | 66 | * NetBSD-2.0H (200080000) was changed on 20041001 to: | |
67 | * 2.99.9 (299000900) | 67 | * 2.99.9 (299000900) | |
68 | */ | 68 | */ | |
69 | 69 | |||
70 | #define __NetBSD_Version__ 799006400 /* NetBSD 7.99.64 */ | 70 | #define __NetBSD_Version__ 799006500 /* NetBSD 7.99.65 */ | |
71 | 71 | |||
72 | #define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \ | 72 | #define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \ | |
73 | (m) * 1000000) + (p) * 100) <= __NetBSD_Version__) | 73 | (m) * 1000000) + (p) * 100) <= __NetBSD_Version__) | |
74 | 74 | |||
75 | /* | 75 | /* | |
76 | * Historical NetBSD #define | 76 | * Historical NetBSD #define | |
77 | * | 77 | * | |
78 | * NetBSD 1.4 was the last release for which this value was incremented. | 78 | * NetBSD 1.4 was the last release for which this value was incremented. | |
79 | * The value is now permanently fixed at 199905. It will never be | 79 | * The value is now permanently fixed at 199905. It will never be | |
80 | * changed again. | 80 | * changed again. | |
81 | * | 81 | * | |
82 | * New code must use __NetBSD_Version__ instead, and should not even | 82 | * New code must use __NetBSD_Version__ instead, and should not even | |
83 | * count on NetBSD being defined. | 83 | * count on NetBSD being defined. |