From 667b5ca0977d7629038cf2cd6643ba9bd6f7c513 Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Tue, 28 Sep 1999 22:56:04 +0000 Subject: [PATCH] Don't count iterations while waiting for a lock to become free. --- sys/dev/vinum/vinumlock.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/dev/vinum/vinumlock.c b/sys/dev/vinum/vinumlock.c index ff46df3a297e..62df004cbc74 100644 --- a/sys/dev/vinum/vinumlock.c +++ b/sys/dev/vinum/vinumlock.c @@ -236,20 +236,19 @@ lockrange(daddr_t stripe, struct buf *bp, struct plex *plex) * conflict would be an additional * schedule and time through this loop. */ - while (lock->stripe) { /* wait for it to become free */ #ifdef VINUMDEBUG - if (debug & DEBUG_LASTREQS) { - struct rangelock info; + if (debug & DEBUG_LASTREQS) { + struct rangelock info; - info.stripe = stripe; - info.bp = bp; - info.plexno = plex->plexno; - logrq(loginfo_lockwait, (union rqinfou) &info, bp); - } -#endif - tsleep((void *) lock->stripe, PRIBIO | PCATCH, "vrlock", 2 * hz); - plex->lockwaits++; /* waited one more time */ + info.stripe = stripe; + info.bp = bp; + info.plexno = plex->plexno; + logrq(loginfo_lockwait, (union rqinfou) &info, bp); } +#endif + plex->lockwaits++; /* waited one more time */ + while (lock->stripe) /* wait for it to become free */ + tsleep((void *) lock->stripe, PRIBIO | PCATCH, "vrlock", 2 * hz); break; /* out of the inner level loop */ } } else {