summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2001-01-10 05:01:12 +0000
committergrog <grog@FreeBSD.org>2001-01-10 05:01:12 +0000
commit16c617b81881c4af5065f6e7024370870cde36ee (patch)
tree8a2d0743edb30f9d8ec3d4632678f735911308c3 /sys/dev/vinum
parent4f5d8ed82579a945555b585b43ab2d09eae30c77 (diff)
downloadFreeBSD-src-16c617b81881c4af5065f6e7024370870cde36ee.zip
FreeBSD-src-16c617b81881c4af5065f6e7024370870cde36ee.tar.gz
config_plex: Initialize mutex for parity plexes.
remove_plex_entry: Destroy mutex for parity plexes. Part of rewrite of RAID-[45] locking code.
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r--sys/dev/vinum/vinumconfig.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c
index 7dd36db..5251f24 100644
--- a/sys/dev/vinum/vinumconfig.c
+++ b/sys/dev/vinum/vinumconfig.c
@@ -45,7 +45,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumconfig.c,v 1.30 2000/05/01 09:45:50 grog Exp grog $
+ * $Id: vinumconfig.c,v 1.31 2001/01/10 01:16:00 grog Exp grog $
* $FreeBSD$
*/
@@ -1393,6 +1393,13 @@ config_plex(int update)
sprintf(plexsuffix, ".p%d", pindex); /* form the suffix */
strcat(plex->name, plexsuffix); /* and add it to the name */
}
+ if (isparity(plex)) {
+ plex->lock = (struct rangelock *)
+ Malloc(PLEX_LOCKS * sizeof(struct rangelock));
+ CHECKALLOC(plex->lock, "vinum: Can't allocate lock table\n");
+ bzero((char *) plex->lock, PLEX_LOCKS * sizeof(struct rangelock));
+ mtx_init(&plex->lockmtx, plex->name, MTX_DEF);
+ }
/* Note the last plex we configured */
current_plex = plexno;
plex->state = state; /* set whatever state we chose */
@@ -1774,6 +1781,8 @@ remove_plex_entry(int plexno, int force, int recurse)
}
}
log(LOG_INFO, "vinum: removing %s\n", plex->name);
+ if (isparity(plex))
+ mtx_destroy(&plex->lockmtx);
free_plex(plexno);
vinum_conf.plexes_used--; /* one less plex */
}
OpenPOWER on IntegriCloud