diff options
author | le <le@FreeBSD.org> | 2005-01-19 14:08:16 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2005-01-19 14:08:16 +0000 |
commit | 8c1fee0f75460377513bcc9c1d6951b094b1cad7 (patch) | |
tree | df8941674d961d7e087d9ac79802c3b433088287 /sys/geom/vinum/geom_vinum_volume.c | |
parent | eb12fefc3570c56802a22267d21da4b936c064b6 (diff) | |
download | FreeBSD-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_volume.c')
-rw-r--r-- | sys/geom/vinum/geom_vinum_volume.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/geom/vinum/geom_vinum_volume.c b/sys/geom/vinum/geom_vinum_volume.c index 4ace9d2..307cfa8 100644 --- a/sys/geom/vinum/geom_vinum_volume.c +++ b/sys/geom/vinum/geom_vinum_volume.c @@ -314,6 +314,8 @@ gv_volume_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) first = 0; p = gp->softc; + + /* Let's see if the volume this plex wants is already configured. */ v = gv_find_vol(sc, p->volume); if (v == NULL) return (NULL); @@ -325,12 +327,18 @@ gv_volume_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) gp->softc = v; first++; TAILQ_INIT(&v->bqueue); + } else + gp = v->geom; + + /* Create bio queue mutex and worker thread, if necessary. */ + if (mtx_initialized(&v->bqueue_mtx) == 0) mtx_init(&v->bqueue_mtx, "gv_plex", NULL, MTX_DEF); + + if (!(v->flags & GV_VOL_THREAD_ACTIVE)) { kthread_create(gv_vol_worker, v, NULL, 0, 0, "gv_v %s", v->name); v->flags |= GV_VOL_THREAD_ACTIVE; - } else - gp = v->geom; + } /* * Create a new consumer and attach it to the plex geom. Since this |