diff options
author | grog <grog@FreeBSD.org> | 2003-05-23 01:14:35 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 2003-05-23 01:14:35 +0000 |
commit | 23a0f80a76418e4302b9dfdd568d7eedcf7aadbe (patch) | |
tree | 53885b4645fe6a7a99459b2c0a895b1018dfe162 /sys/dev/vinum/vinumlock.c | |
parent | 1ae9be9a1f44b86f7d488d5b295a2736bdbf26fc (diff) | |
download | FreeBSD-src-23a0f80a76418e4302b9dfdd568d7eedcf7aadbe.zip FreeBSD-src-23a0f80a76418e4302b9dfdd568d7eedcf7aadbe.tar.gz |
Change the way the plex lock mutexes work. Previously they were part
of the struct plex, which tore apart the mutex linked lists when the
plex table was expanded. Now we maintain a pool of mutexes (currently
32) to be shared by all plexes. This is still a lot better than the
splhigh() method used in other architectures.
Approved by: re (jhb)
Diffstat (limited to 'sys/dev/vinum/vinumlock.c')
-rw-r--r-- | sys/dev/vinum/vinumlock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/vinum/vinumlock.c b/sys/dev/vinum/vinumlock.c index bf1b051..33d9578 100644 --- a/sys/dev/vinum/vinumlock.c +++ b/sys/dev/vinum/vinumlock.c @@ -37,7 +37,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: vinumlock.c,v 1.17 2003/02/02 05:07:51 grog Exp $ + * $Id: vinumlock.c,v 1.19 2003/05/23 01:07:18 grog Exp $ * $FreeBSD$ */ @@ -132,11 +132,11 @@ lockrange(daddr_t stripe, struct buf *bp, struct plex *plex) * increment all addresses by 1. */ stripe++; - mtx_lock(&plex->lockmtx); + mtx_lock(plex->lockmtx); /* Wait here if the table is full */ while (plex->usedlocks == PLEX_LOCKS) /* all in use */ - msleep(&plex->usedlocks, &plex->lockmtx, PRIBIO, "vlock", 0); + msleep(&plex->usedlocks, plex->lockmtx, PRIBIO, "vlock", 0); #ifdef DIAGNOSTIC if (plex->usedlocks >= PLEX_LOCKS) @@ -164,7 +164,7 @@ lockrange(daddr_t stripe, struct buf *bp, struct plex *plex) } #endif plex->lockwaits++; /* waited one more time */ - msleep(lock, &plex->lockmtx, PRIBIO, "vrlock", 0); + msleep(lock, plex->lockmtx, PRIBIO, "vrlock", 0); lock = &plex->lock[-1]; /* start again */ foundlocks = 0; pos = NULL; @@ -188,7 +188,7 @@ lockrange(daddr_t stripe, struct buf *bp, struct plex *plex) pos->stripe = stripe; pos->bp = bp; plex->usedlocks++; /* one more lock */ - mtx_unlock(&plex->lockmtx); + mtx_unlock(plex->lockmtx); #ifdef VINUMDEBUG if (debug & DEBUG_LOCKREQS) { struct rangelockinfo lockinfo; |