keep track of parent union node, so allowing .. to refer to
authorJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Sat, 18 Jun 1994 00:43:17 +0000 (16:43 -0800)
committerJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Sat, 18 Jun 1994 00:43:17 +0000 (16:43 -0800)
SCCS-vsn: sys/miscfs/union/union.h 8.6
SCCS-vsn: sys/miscfs/union/union_subr.c 8.11

usr/src/sys/miscfs/union/union.h
usr/src/sys/miscfs/union/union_subr.c

index e4a919e..a39ad69 100644 (file)
@@ -8,7 +8,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)union.h     8.5 (Berkeley) %G%
+ *     @(#)union.h     8.6 (Berkeley) %G%
  */
 
 struct union_args {
  */
 
 struct union_args {
@@ -48,6 +48,7 @@ struct union_node {
        struct vnode            *un_uppervp;    /* overlaying object */
        struct vnode            *un_lowervp;    /* underlying object */
        struct vnode            *un_dirvp;      /* Parent dir of uppervp */
        struct vnode            *un_uppervp;    /* overlaying object */
        struct vnode            *un_lowervp;    /* underlying object */
        struct vnode            *un_dirvp;      /* Parent dir of uppervp */
+       struct vnode            *un_pvp;        /* Parent vnode */
        char                    *un_path;       /* saved component name */
        int                     un_hash;        /* saved un_path hash value */
        int                     un_openl;       /* # of opens on lowervp */
        char                    *un_path;       /* saved component name */
        int                     un_hash;        /* saved un_path hash value */
        int                     un_openl;       /* # of opens on lowervp */
index 6784e66..a07ae68 100644 (file)
@@ -8,7 +8,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)union_subr.c        8.10 (Berkeley) %G%
+ *     @(#)union_subr.c        8.11 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -241,7 +241,7 @@ int
 union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp)
        struct vnode **vpp;
        struct mount *mp;
 union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp)
        struct vnode **vpp;
        struct mount *mp;
-       struct vnode *undvp;
+       struct vnode *undvp;            /* parent union vnode */
        struct vnode *dvp;              /* may be null */
        struct componentname *cnp;      /* may be null */
        struct vnode *uppervp;          /* may be null */
        struct vnode *dvp;              /* may be null */
        struct componentname *cnp;      /* may be null */
        struct vnode *uppervp;          /* may be null */
@@ -446,6 +446,9 @@ loop:
        un->un_uppersz = VNOVAL;
        un->un_lowervp = lowervp;
        un->un_lowersz = VNOVAL;
        un->un_uppersz = VNOVAL;
        un->un_lowervp = lowervp;
        un->un_lowersz = VNOVAL;
+       un->un_pvp = undvp;
+       if (undvp != NULLVP)
+               VREF(undvp);
        un->un_openl = 0;
        un->un_flags = UN_LOCKED;
        if (un->un_uppervp)
        un->un_openl = 0;
        un->un_flags = UN_LOCKED;
        if (un->un_uppervp)
@@ -492,6 +495,8 @@ union_freevp(vp)
                LIST_REMOVE(un, un_cache);
        }
 
                LIST_REMOVE(un, un_cache);
        }
 
+       if (un->un_pvp != NULLVP)
+               vrele(un->un_pvp);
        if (un->un_uppervp != NULLVP)
                vrele(un->un_uppervp);
        if (un->un_lowervp != NULLVP)
        if (un->un_uppervp != NULLVP)
                vrele(un->un_uppervp);
        if (un->un_lowervp != NULLVP)