- Assert that we're no longer doing recursive vn_locks in inactive/reclaim

as I'd like to get rid of the vxthread.
 - Handle lock requests which don't actually want a lock as this is a
   much more convenient place to handle this condition than in vget().
   These requests simply want to know that VI_DOOMED isn't set.
 - Correct a test at the end of vn_lock, if error !=0 should be
   if error == 0, this has been broken since I comitted the VI_DOOMED
   changes, but no one ran into it because vget() duplicated this
   functionality.

Sponsored by:	Isilon Systems, Inc.
This commit is contained in:
Jeff Roberson 2005-04-11 09:23:56 +00:00
parent 836c5b4149
commit 1b19c74d73

View File

@ -796,14 +796,23 @@ debug_vn_lock(vp, flags, td, filename, line)
{
int error;
KASSERT(vp->v_vxthread != curthread,
("recursive vn_lock in inactive/reclaim."));
do {
if ((flags & LK_INTERLOCK) == 0)
VI_LOCK(vp);
if ((vp->v_iflag & VI_DOOMED) && vp->v_vxthread != td &&
(flags & LK_NOWAIT)) {
if ((flags & LK_NOWAIT || (flags & LK_TYPE_MASK) == 0) &&
vp->v_iflag & VI_DOOMED && vp->v_vxthread != td) {
VI_UNLOCK(vp);
return (ENOENT);
}
/*
* Just polling to check validity.
*/
if ((flags & LK_TYPE_MASK) == 0) {
VI_UNLOCK(vp);
return (0);
}
#ifdef DEBUG_LOCKS
vp->filename = filename;
vp->line = line;
@ -818,7 +827,7 @@ debug_vn_lock(vp, flags, td, filename, line)
* Callers specify LK_RETRY if they wish to get dead vnodes.
* If RETRY is not set, we return ENOENT instead.
*/
if (error != 0 && (vp->v_iflag & VI_DOOMED) &&
if (error == 0 && vp->v_iflag & VI_DOOMED &&
vp->v_vxthread != td && (flags & LK_RETRY) == 0) {
VOP_UNLOCK(vp, 0, td);
error = ENOENT;