Deleted Added
full compact
null_vfsops.c (175202) null_vfsops.c (175294)
1/*-
2 * Copyright (c) 1992, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94
33 *
34 * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92
1/*-
2 * Copyright (c) 1992, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94
33 *
34 * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92
35 * $FreeBSD: head/sys/fs/nullfs/null_vfsops.c 175202 2008-01-10 01:10:58Z attilio $
35 * $FreeBSD: head/sys/fs/nullfs/null_vfsops.c 175294 2008-01-13 14:44:15Z attilio $
36 */
37
38/*
39 * Null Layer
40 * (See null_vnops.c for a description of what this does.)
41 */
42
43#include <sys/param.h>

--- 59 unchanged lines hidden (view full) ---

103 return (EINVAL);
104
105 /*
106 * Unlock lower node to avoid deadlock.
107 * (XXX) VOP_ISLOCKED is needed?
108 */
109 if ((mp->mnt_vnodecovered->v_op == &null_vnodeops) &&
110 VOP_ISLOCKED(mp->mnt_vnodecovered, NULL)) {
36 */
37
38/*
39 * Null Layer
40 * (See null_vnops.c for a description of what this does.)
41 */
42
43#include <sys/param.h>

--- 59 unchanged lines hidden (view full) ---

103 return (EINVAL);
104
105 /*
106 * Unlock lower node to avoid deadlock.
107 * (XXX) VOP_ISLOCKED is needed?
108 */
109 if ((mp->mnt_vnodecovered->v_op == &null_vnodeops) &&
110 VOP_ISLOCKED(mp->mnt_vnodecovered, NULL)) {
111 VOP_UNLOCK(mp->mnt_vnodecovered, 0, td);
111 VOP_UNLOCK(mp->mnt_vnodecovered, 0);
112 isvnunlocked = 1;
113 }
114 /*
115 * Find lower node
116 */
117 NDINIT(ndp, LOOKUP, FOLLOW|LOCKLEAF,
118 UIO_SYSSPACE, target, td);
119 error = namei(ndp);

--- 33 unchanged lines hidden (view full) ---

153 * Save reference. Each mount also holds
154 * a reference on the root vnode.
155 */
156 error = null_nodeget(mp, lowerrootvp, &vp);
157 /*
158 * Make sure the node alias worked
159 */
160 if (error) {
112 isvnunlocked = 1;
113 }
114 /*
115 * Find lower node
116 */
117 NDINIT(ndp, LOOKUP, FOLLOW|LOCKLEAF,
118 UIO_SYSSPACE, target, td);
119 error = namei(ndp);

--- 33 unchanged lines hidden (view full) ---

153 * Save reference. Each mount also holds
154 * a reference on the root vnode.
155 */
156 error = null_nodeget(mp, lowerrootvp, &vp);
157 /*
158 * Make sure the node alias worked
159 */
160 if (error) {
161 VOP_UNLOCK(vp, 0, td);
161 VOP_UNLOCK(vp, 0);
162 vrele(lowerrootvp);
163 free(xmp, M_NULLFSMNT); /* XXX */
164 return (error);
165 }
166
167 /*
168 * Keep a held reference to the root vnode.
169 * It is vrele'd in nullfs_unmount.
170 */
171 nullm_rootvp = vp;
172 nullm_rootvp->v_vflag |= VV_ROOT;
173 xmp->nullm_rootvp = nullm_rootvp;
174
175 /*
176 * Unlock the node (either the lower or the alias)
177 */
162 vrele(lowerrootvp);
163 free(xmp, M_NULLFSMNT); /* XXX */
164 return (error);
165 }
166
167 /*
168 * Keep a held reference to the root vnode.
169 * It is vrele'd in nullfs_unmount.
170 */
171 nullm_rootvp = vp;
172 nullm_rootvp->v_vflag |= VV_ROOT;
173 xmp->nullm_rootvp = nullm_rootvp;
174
175 /*
176 * Unlock the node (either the lower or the alias)
177 */
178 VOP_UNLOCK(vp, 0, td);
178 VOP_UNLOCK(vp, 0);
179
180 if (NULLVPTOLOWERVP(nullm_rootvp)->v_mount->mnt_flag & MNT_LOCAL) {
181 MNT_ILOCK(mp);
182 mp->mnt_flag |= MNT_LOCAL;
183 MNT_IUNLOCK(mp);
184 }
185 MNT_ILOCK(mp);
186 mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & MNTK_MPSAFE;

--- 184 unchanged lines hidden ---
179
180 if (NULLVPTOLOWERVP(nullm_rootvp)->v_mount->mnt_flag & MNT_LOCAL) {
181 MNT_ILOCK(mp);
182 mp->mnt_flag |= MNT_LOCAL;
183 MNT_IUNLOCK(mp);
184 }
185 MNT_ILOCK(mp);
186 mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & MNTK_MPSAFE;

--- 184 unchanged lines hidden ---