From owner-freebsd-current Tue Mar 10 20:10:50 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA09682 for freebsd-current-outgoing; Tue, 10 Mar 1998 20:10:50 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA09666 for ; Tue, 10 Mar 1998 20:10:45 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id PAA24737; Wed, 11 Mar 1998 15:09:58 +1100 Date: Wed, 11 Mar 1998 15:09:58 +1100 From: Bruce Evans Message-Id: <199803110409.PAA24737@godzilla.zeta.org.au> To: current@FreeBSD.ORG, luoqi@luoqi.watermarkgroup.com Subject: Re: typo in vop_stdlock() ? Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >int >vop_stdlock(ap) > struct vop_lock_args /* { > struct vnode *a_vp; > int a_flags; > struct proc *a_p; > } */ *ap; >{ > struct lock *l; > > if ((l = (struct lock *)ap->a_vp->v_data) == NULL) { > if (ap->a_flags & LK_INTERLOCK) > simple_unlock(&ap->a_vp->v_interlock); > ^^^^^^^^^^^^^ > return 0; > } > > return (lockmgr(l, ap->a_flags, &ap->a_vp->v_interlock, ap->a_p)); >} > >Shouldn't simple_unlock be simple_lock instead? No. LK_INTERLOCK means that the vnode is already simple-interlocked and that the simple-interlock shall be released when the function returns. The lock is normally relased in lockmgr() as part of upgrading to a non-simple lock, but non-simple locking is impossible in the NULL v_data case (v_data points to an inode whose first element is the non-simple lock, except of course when the pointer is NULL). Perhaps this case shouldn't happen. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message