summaryrefslogtreecommitdiffstats
path: root/sys/geom/vinum/geom_vinum_plex.c
diff options
context:
space:
mode:
authorle <le@FreeBSD.org>2005-01-19 14:08:16 +0000
committerle <le@FreeBSD.org>2005-01-19 14:08:16 +0000
commit8c1fee0f75460377513bcc9c1d6951b094b1cad7 (patch)
treedf8941674d961d7e087d9ac79802c3b433088287 /sys/geom/vinum/geom_vinum_plex.c
parenteb12fefc3570c56802a22267d21da4b936c064b6 (diff)
downloadFreeBSD-src-8c1fee0f75460377513bcc9c1d6951b094b1cad7.zip
FreeBSD-src-8c1fee0f75460377513bcc9c1d6951b094b1cad7.tar.gz
Although an object may already be known in the configuration, it's
worker thread may have been destroyed (e.g. during orphaning). Make sure that objects get back their worker threads when they get a new geom.
Diffstat (limited to 'sys/geom/vinum/geom_vinum_plex.c')
-rw-r--r--sys/geom/vinum/geom_vinum_plex.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/geom/vinum/geom_vinum_plex.c b/sys/geom/vinum/geom_vinum_plex.c
index 8fa2923..5e8aafb 100644
--- a/sys/geom/vinum/geom_vinum_plex.c
+++ b/sys/geom/vinum/geom_vinum_plex.c
@@ -773,6 +773,17 @@ gv_plex_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
if (p->vol_sc != NULL)
gv_update_vol_size(p->vol_sc, p->size);
+ /*
+ * If necessary, create a bio queue mutex and a worker thread.
+ */
+ if (mtx_initialized(&p->bqueue_mtx) == 0)
+ mtx_init(&p->bqueue_mtx, "gv_plex", NULL, MTX_DEF);
+ if (!(p->flags & GV_PLEX_THREAD_ACTIVE)) {
+ kthread_create(gv_plex_worker, p, NULL, 0, 0, "gv_p %s",
+ p->name);
+ p->flags |= GV_PLEX_THREAD_ACTIVE;
+ }
+
return (NULL);
/* We need to create a new geom. */
OpenPOWER on IntegriCloud