diff options
Diffstat (limited to 'sys/miscfs/union/union_vnops.c')
-rw-r--r-- | sys/miscfs/union/union_vnops.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c index 1c6b124..d856da2 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.47 1998/01/18 07:56:41 kato Exp $ + * $Id: union_vnops.c,v 1.48 1998/01/18 08:17:48 kato Exp $ */ #include <sys/param.h> @@ -58,9 +58,6 @@ } \ } -#define SETKLOCK(un) (un)->un_flags |= UN_KLOCK -#define CLEARKLOCK(un) (un)->un_flags &= ~UN_KLOCK - static int union_abortop __P((struct vop_abortop_args *ap)); static int union_access __P((struct vop_access_args *ap)); static int union_advlock __P((struct vop_advlock_args *ap)); @@ -1548,11 +1545,13 @@ start: un = VTOUNION(vp); if (un->un_uppervp != NULLVP) { - if (((un->un_flags & (UN_ULOCK | UN_KLOCK)) == 0) && + if (((un->un_flags & UN_ULOCK) == 0) && (vp->v_usecount != 0)) { - error = vn_lock(un->un_uppervp, flags, p); - if (error) - return (error); + if ((un->un_flags & UN_KLOCK) == 0) { + error = vn_lock(un->un_uppervp, flags, p); + if (error) + return (error); + } un->un_flags |= UN_ULOCK; } } @@ -1590,6 +1589,10 @@ start: * * If UN_KLOCK isn't set, then the upper vnode is unlocked here. */ +/* + * FreeBSD: Do not cleark UN_KLOCK flag. UN_KLOCK flag is tested + * in union_lock(). + */ static int union_unlock(ap) struct vop_unlock_args /* { |