Date: Wed, 11 Mar 1998 15:09:58 +1100 From: Bruce Evans <bde@zeta.org.au> To: current@FreeBSD.ORG, luoqi@luoqi.watermarkgroup.com Subject: Re: typo in vop_stdlock() ? Message-ID: <199803110409.PAA24737@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803110409.PAA24737>