summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum/vinumlock.c
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>1999-09-28 22:56:04 +0000
committergrog <grog@FreeBSD.org>1999-09-28 22:56:04 +0000
commite26d973c1a7304cb1562a92e14311347eb00cb22 (patch)
treecf662f445f7d7363fd27021f85f32b71019660e9 /sys/dev/vinum/vinumlock.c
parent5a83a31cacf6716203df9e4e4150330a2a3068f8 (diff)
downloadFreeBSD-src-e26d973c1a7304cb1562a92e14311347eb00cb22.zip
FreeBSD-src-e26d973c1a7304cb1562a92e14311347eb00cb22.tar.gz
Don't count iterations while waiting for a lock to become free.
Diffstat (limited to 'sys/dev/vinum/vinumlock.c')
-rw-r--r--sys/dev/vinum/vinumlock.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/dev/vinum/vinumlock.c b/sys/dev/vinum/vinumlock.c
index ff46df3..62df004 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);
- }
+ 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);
- plex->lockwaits++; /* waited one more time */
- }
break; /* out of the inner level loop */
}
} else {
OpenPOWER on IntegriCloud