Deleted Added
full compact
null_vnops.c (22975) null_vnops.c (24987)
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * John Heidemann of the UCLA Ficus project.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)null_vnops.c 8.6 (Berkeley) 5/27/95
37 *
38 * Ancestors:
39 * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * John Heidemann of the UCLA Ficus project.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)null_vnops.c 8.6 (Berkeley) 5/27/95
37 *
38 * Ancestors:
39 * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
40 * $Id: null_vnops.c,v 1.15 1997/02/12 18:06:08 mpp Exp $
40 * $Id: null_vnops.c,v 1.16 1997/02/22 09:40:22 peter Exp $
41 * ...and...
42 * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
43 *
41 * ...and...
42 * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
43 *
44 * $Id$
44 * $Id: null_vnops.c,v 1.16 1997/02/22 09:40:22 peter Exp $
45 */
46
47/*
48 * Null Layer
49 *
50 * (See mount_null(8) for more information.)
51 *
52 * The null layer duplicates a portion of the file system

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

268 break; /* bail out at end of list */
269 vps_p[i] = this_vp_p =
270 VOPARG_OFFSETTO(struct vnode**,descp->vdesc_vp_offsets[i],ap);
271 /*
272 * We're not guaranteed that any but the first vnode
273 * are of our type. Check for and don't map any
274 * that aren't. (We must always map first vp or vclean fails.)
275 */
45 */
46
47/*
48 * Null Layer
49 *
50 * (See mount_null(8) for more information.)
51 *
52 * The null layer duplicates a portion of the file system

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

268 break; /* bail out at end of list */
269 vps_p[i] = this_vp_p =
270 VOPARG_OFFSETTO(struct vnode**,descp->vdesc_vp_offsets[i],ap);
271 /*
272 * We're not guaranteed that any but the first vnode
273 * are of our type. Check for and don't map any
274 * that aren't. (We must always map first vp or vclean fails.)
275 */
276 if (i && (*this_vp_p == NULL ||
276 if (i && (*this_vp_p == NULLVP ||
277 (*this_vp_p)->v_op != null_vnodeop_p)) {
277 (*this_vp_p)->v_op != null_vnodeop_p)) {
278 old_vps[i] = NULL;
278 old_vps[i] = NULLVP;
279 } else {
280 old_vps[i] = *this_vp_p;
281 *(vps_p[i]) = NULLVPTOLOWERVP(*this_vp_p);
282 /*
283 * XXX - Several operations have the side effect
284 * of vrele'ing their vp's. We must account for
285 * that. (This should go away in the future.)
286 */

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

379 if (dvp == vp)
380 return (error);
381 if (!VOP_ISLOCKED(dvp)) {
382 unlockargs.a_vp = dvp;
383 unlockargs.a_flags = 0;
384 unlockargs.a_p = p;
385 vop_nounlock(&unlockargs);
386 }
279 } else {
280 old_vps[i] = *this_vp_p;
281 *(vps_p[i]) = NULLVPTOLOWERVP(*this_vp_p);
282 /*
283 * XXX - Several operations have the side effect
284 * of vrele'ing their vp's. We must account for
285 * that. (This should go away in the future.)
286 */

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

379 if (dvp == vp)
380 return (error);
381 if (!VOP_ISLOCKED(dvp)) {
382 unlockargs.a_vp = dvp;
383 unlockargs.a_flags = 0;
384 unlockargs.a_p = p;
385 vop_nounlock(&unlockargs);
386 }
387 if (vp != NULL && VOP_ISLOCKED(vp)) {
387 if (vp != NULLVP && VOP_ISLOCKED(vp)) {
388 lockargs.a_vp = vp;
389 lockargs.a_flags = LK_SHARED;
390 lockargs.a_p = p;
391 vop_nolock(&lockargs);
392 }
393 return (error);
394}
395

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

563 struct null_node *xp = VTONULL(vp);
564 struct vnode *lowervp = xp->null_lowervp;
565
566 /*
567 * Note: in vop_reclaim, vp->v_op == dead_vnodeop_p,
568 * so we can't call VOPs on ourself.
569 */
570 /* After this assignment, this node will not be re-used. */
388 lockargs.a_vp = vp;
389 lockargs.a_flags = LK_SHARED;
390 lockargs.a_p = p;
391 vop_nolock(&lockargs);
392 }
393 return (error);
394}
395

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

563 struct null_node *xp = VTONULL(vp);
564 struct vnode *lowervp = xp->null_lowervp;
565
566 /*
567 * Note: in vop_reclaim, vp->v_op == dead_vnodeop_p,
568 * so we can't call VOPs on ourself.
569 */
570 /* After this assignment, this node will not be re-used. */
571 xp->null_lowervp = NULL;
571 xp->null_lowervp = NULLVP;
572 LIST_REMOVE(xp, null_hash);
573 FREE(vp->v_data, M_TEMP);
574 vp->v_data = NULL;
575 vrele (lowervp);
576 return (0);
577}
578
579static int

--- 86 unchanged lines hidden ---
572 LIST_REMOVE(xp, null_hash);
573 FREE(vp->v_data, M_TEMP);
574 vp->v_data = NULL;
575 vrele (lowervp);
576 return (0);
577}
578
579static int

--- 86 unchanged lines hidden ---