checkpoint (first pass at "...")
[unix-history] / usr / src / sys / miscfs / union / union_vnops.c
index 5836363..75c237c 100644 (file)
@@ -8,7 +8,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)union_vnops.c       8.15 (Berkeley) %G%
+ *     @(#)union_vnops.c       8.18 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -138,6 +138,22 @@ union_lookup(ap)
        struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount);
        struct ucred *saved_cred;
 
        struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount);
        struct ucred *saved_cred;
 
+#ifdef notyet
+       if (cnp->cn_namelen == 3 &&
+                       cnp->cn_nameptr[2] == '.' &&
+                       cnp->cn_nameptr[1] == '.' &&
+                       cnp->cn_nameptr[0] == '.') {
+               dvp = *ap->a_vpp = LOWERVP(ap->a_dvp);
+               if (dvp == NULLVP)
+                       return (ENOENT);
+               VREF(dvp);
+               VOP_LOCK(dvp);
+               if (!lockparent || !(cnp->cn_flags & ISLASTCN))
+                       VOP_UNLOCK(ap->a_dvp);
+               return (0);
+       }
+#endif
+
        cnp->cn_flags |= LOCKPARENT;
 
        upperdvp = dun->un_uppervp;
        cnp->cn_flags |= LOCKPARENT;
 
        upperdvp = dun->un_uppervp;
@@ -214,6 +230,14 @@ union_lookup(ap)
                }
        } else {
                lerror = ENOENT;
                }
        } else {
                lerror = ENOENT;
+               if ((cnp->cn_flags & ISDOTDOT) && dun->un_pvp != NULLVP) {
+                       lowervp = LOWERVP(dun->un_pvp);
+                       if (lowervp != NULLVP) {
+                               VREF(lowervp);
+                               VOP_LOCK(lowervp);
+                               lerror = 0;
+                       }
+               }
        }
 
        if (!lockparent)
        }
 
        if (!lockparent)
@@ -570,7 +594,7 @@ union_getattr(ap)
        if ((vap != ap->a_vap) && (vap->va_type == VDIR))
                ap->a_vap->va_nlink += vap->va_nlink;
 
        if ((vap != ap->a_vap) && (vap->va_type == VDIR))
                ap->a_vap->va_nlink += vap->va_nlink;
 
-       vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
+       ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
        return (0);
 }
 
        return (0);
 }