add union_revoke operator
authorJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Fri, 12 May 1995 07:04:32 +0000 (23:04 -0800)
committerJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Fri, 12 May 1995 07:04:32 +0000 (23:04 -0800)
SCCS-vsn: sys/miscfs/union/union_vnops.c 8.26

usr/src/sys/miscfs/union/union_vnops.c

index 1a4b275..2de83d4 100644 (file)
@@ -8,7 +8,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)union_vnops.c       8.25 (Berkeley) %G%
+ *     @(#)union_vnops.c       8.26 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -796,6 +796,22 @@ union_select(ap)
                                ap->a_cred, ap->a_p));
 }
 
                                ap->a_cred, ap->a_p));
 }
 
+int
+union_revoke(ap)
+       struct vop_revoke_args /* {
+               struct vnode *a_vp;
+               int a_flags;
+       } */ *ap;
+{
+       struct vnode *vp = ap->a_vp;
+
+       if (UPPERVP(vp))
+               VOP_REVOKE(UPPERVP(vp), ap->a_flags);
+       if (LOWERVP(vp))
+               VOP_REVOKE(UPPERVP(vp), ap->a_flags);
+       vgone(vp);
+}
+
 int
 union_mmap(ap)
        struct vop_mmap_args /* {
 int
 union_mmap(ap)
        struct vop_mmap_args /* {
@@ -1283,7 +1299,7 @@ union_inactive(ap)
        }
 
        if ((un->un_flags & UN_CACHED) == 0)
        }
 
        if ((un->un_flags & UN_CACHED) == 0)
-               VOP_REVOKE(ap->a_vp, 0);
+               vgone(ap->a_vp);
 
        return (0);
 }
 
        return (0);
 }
@@ -1322,9 +1338,10 @@ start:
                        un->un_flags |= UN_ULOCK;
                }
 #ifdef DIAGNOSTIC
                        un->un_flags |= UN_ULOCK;
                }
 #ifdef DIAGNOSTIC
-               if (un->un_flags & UN_KLOCK)
+               if (un->un_flags & UN_KLOCK) {
                        vprint("union: dangling klock", vp);
                        panic("union: dangling upper lock (%lx)", vp);
                        vprint("union: dangling klock", vp);
                        panic("union: dangling upper lock (%lx)", vp);
+               }
 #endif
        }
 
 #endif
        }
 
@@ -1538,6 +1555,7 @@ struct vnodeopv_entry_desc union_vnodeop_entries[] = {
        { &vop_lease_desc, union_lease },               /* lease */
        { &vop_ioctl_desc, union_ioctl },               /* ioctl */
        { &vop_select_desc, union_select },             /* select */
        { &vop_lease_desc, union_lease },               /* lease */
        { &vop_ioctl_desc, union_ioctl },               /* ioctl */
        { &vop_select_desc, union_select },             /* select */
+       { &vop_revoke_desc, union_revoke },             /* revoke */
        { &vop_mmap_desc, union_mmap },                 /* mmap */
        { &vop_fsync_desc, union_fsync },               /* fsync */
        { &vop_seek_desc, union_seek },                 /* seek */
        { &vop_mmap_desc, union_mmap },                 /* mmap */
        { &vop_fsync_desc, union_fsync },               /* fsync */
        { &vop_seek_desc, union_seek },                 /* seek */