From 589421d418c4b81cf58d9c38d9d2b78100a7d748 Mon Sep 17 00:00:00 2001 From: KATO Takenori Date: Thu, 26 Feb 1998 03:23:56 +0000 Subject: [PATCH] Deleted KLOCK-hack. --- sys/fs/unionfs/union.h | 6 +----- sys/fs/unionfs/union_subr.c | 18 +----------------- sys/fs/unionfs/union_vnops.c | 12 +++++------- sys/miscfs/union/union.h | 6 +----- sys/miscfs/union/union_subr.c | 18 +----------------- sys/miscfs/union/union_vnops.c | 12 +++++------- 6 files changed, 14 insertions(+), 58 deletions(-) diff --git a/sys/fs/unionfs/union.h b/sys/fs/unionfs/union.h index 442fc9597360..4deb6d42fa2c 100644 --- a/sys/fs/unionfs/union.h +++ b/sys/fs/unionfs/union.h @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union.h 8.9 (Berkeley) 12/10/94 - * $Id: union.h,v 1.10 1998/01/20 10:02:50 kato Exp $ + * $Id: union.h,v 1.11 1998/02/10 03:32:03 kato Exp $ */ struct union_args { @@ -93,10 +93,6 @@ struct union_node { #define UN_ULOCK 0x04 /* Upper node is locked */ #define UN_KLOCK 0x08 /* Keep upper node locked on vput */ #define UN_CACHED 0x10 /* In union cache */ -#define UN_GLOCK 0x20 /* Keep upper node locked on vget */ - -#define SETGLOCK(un) (un)->un_flags |= UN_GLOCK -#define CLEARGLOCK(un) (un)->un_flags &= ~UN_GLOCK extern int union_allocvp __P((struct vnode **, struct mount *, struct vnode *, struct vnode *, diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 8ba3d877f5c6..879b0d053898 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_subr.c 8.20 (Berkeley) 5/20/95 - * $Id: union_subr.c,v 1.27 1998/02/06 12:13:44 eivind Exp $ + * $Id: union_subr.c,v 1.28 1998/02/10 03:32:05 kato Exp $ */ #include @@ -363,27 +363,11 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp, docache) (un->un_uppervp == uppervp || un->un_uppervp == NULLVP) && (UNIONTOV(un)->v_mount == mp)) { - /* - * Do not assume that vget() does not - * lock the vnode even though flags - * argument is 0. - */ - if ((un->un_uppervp != NULLVP) && - ((un->un_flags & UN_KLOCK) == 0)) { - SETGLOCK(un); - klocked = 1; - } else { - klocked = 0; - } if (vget(UNIONTOV(un), 0, cnp ? cnp->cn_proc : NULL)) { - if (klocked) - CLEARGLOCK(un); union_list_unlock(hash); goto loop; } - if (klocked) - CLEARGLOCK(un); break; } } diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index c54dccefaad0..627123c4db37 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95 - * $Id: union_vnops.c,v 1.53 1998/02/06 12:13:44 eivind Exp $ + * $Id: union_vnops.c,v 1.54 1998/02/10 03:32:07 kato Exp $ */ #include @@ -1533,11 +1533,9 @@ union_lock(ap) if (un->un_uppervp != NULLVP) { if (((un->un_flags & UN_ULOCK) == 0) && (vp->v_usecount != 0)) { - if ((un->un_flags & UN_GLOCK) == 0) { - error = vn_lock(un->un_uppervp, flags, p); - if (error) - return (error); - } + error = vn_lock(un->un_uppervp, flags, p); + if (error) + return (error); un->un_flags |= UN_ULOCK; } #ifdef DIAGNOSTIC @@ -1602,7 +1600,7 @@ union_unlock(ap) un->un_flags &= ~UN_LOCKED; - if ((un->un_flags & (UN_ULOCK|UN_KLOCK|UN_GLOCK)) == UN_ULOCK) + if ((un->un_flags & (UN_ULOCK|UN_KLOCK)) == UN_ULOCK) VOP_UNLOCK(un->un_uppervp, 0, p); un->un_flags &= ~(UN_ULOCK|UN_KLOCK); diff --git a/sys/miscfs/union/union.h b/sys/miscfs/union/union.h index 442fc9597360..4deb6d42fa2c 100644 --- a/sys/miscfs/union/union.h +++ b/sys/miscfs/union/union.h @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union.h 8.9 (Berkeley) 12/10/94 - * $Id: union.h,v 1.10 1998/01/20 10:02:50 kato Exp $ + * $Id: union.h,v 1.11 1998/02/10 03:32:03 kato Exp $ */ struct union_args { @@ -93,10 +93,6 @@ struct union_node { #define UN_ULOCK 0x04 /* Upper node is locked */ #define UN_KLOCK 0x08 /* Keep upper node locked on vput */ #define UN_CACHED 0x10 /* In union cache */ -#define UN_GLOCK 0x20 /* Keep upper node locked on vget */ - -#define SETGLOCK(un) (un)->un_flags |= UN_GLOCK -#define CLEARGLOCK(un) (un)->un_flags &= ~UN_GLOCK extern int union_allocvp __P((struct vnode **, struct mount *, struct vnode *, struct vnode *, diff --git a/sys/miscfs/union/union_subr.c b/sys/miscfs/union/union_subr.c index 8ba3d877f5c6..879b0d053898 100644 --- a/sys/miscfs/union/union_subr.c +++ b/sys/miscfs/union/union_subr.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_subr.c 8.20 (Berkeley) 5/20/95 - * $Id: union_subr.c,v 1.27 1998/02/06 12:13:44 eivind Exp $ + * $Id: union_subr.c,v 1.28 1998/02/10 03:32:05 kato Exp $ */ #include @@ -363,27 +363,11 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp, docache) (un->un_uppervp == uppervp || un->un_uppervp == NULLVP) && (UNIONTOV(un)->v_mount == mp)) { - /* - * Do not assume that vget() does not - * lock the vnode even though flags - * argument is 0. - */ - if ((un->un_uppervp != NULLVP) && - ((un->un_flags & UN_KLOCK) == 0)) { - SETGLOCK(un); - klocked = 1; - } else { - klocked = 0; - } if (vget(UNIONTOV(un), 0, cnp ? cnp->cn_proc : NULL)) { - if (klocked) - CLEARGLOCK(un); union_list_unlock(hash); goto loop; } - if (klocked) - CLEARGLOCK(un); break; } } diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c index c54dccefaad0..627123c4db37 100644 --- a/sys/miscfs/union/union_vnops.c +++ b/sys/miscfs/union/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95 - * $Id: union_vnops.c,v 1.53 1998/02/06 12:13:44 eivind Exp $ + * $Id: union_vnops.c,v 1.54 1998/02/10 03:32:07 kato Exp $ */ #include @@ -1533,11 +1533,9 @@ union_lock(ap) if (un->un_uppervp != NULLVP) { if (((un->un_flags & UN_ULOCK) == 0) && (vp->v_usecount != 0)) { - if ((un->un_flags & UN_GLOCK) == 0) { - error = vn_lock(un->un_uppervp, flags, p); - if (error) - return (error); - } + error = vn_lock(un->un_uppervp, flags, p); + if (error) + return (error); un->un_flags |= UN_ULOCK; } #ifdef DIAGNOSTIC @@ -1602,7 +1600,7 @@ union_unlock(ap) un->un_flags &= ~UN_LOCKED; - if ((un->un_flags & (UN_ULOCK|UN_KLOCK|UN_GLOCK)) == UN_ULOCK) + if ((un->un_flags & (UN_ULOCK|UN_KLOCK)) == UN_ULOCK) VOP_UNLOCK(un->un_uppervp, 0, p); un->un_flags &= ~(UN_ULOCK|UN_KLOCK);