Remove sleeps from geom_up thread on device destruction.

MFC after:	3 days.
This commit is contained in:
Alexander Motin 2015-04-09 13:09:05 +00:00
parent efb19cf6db
commit 0ada3afc25
3 changed files with 8 additions and 10 deletions

View File

@ -572,7 +572,7 @@ g_dev_done(struct bio *bp2)
}
mtx_unlock(&sc->sc_mtx);
if (destroy)
g_post_event(g_dev_destroy, cp, M_WAITOK, NULL);
g_post_event(g_dev_destroy, cp, M_NOWAIT, NULL);
biodone(bp);
}

View File

@ -369,9 +369,9 @@ g_multipath_done(struct bio *bp)
mtx_lock(&sc->sc_mtx);
(*cnt)--;
if (*cnt == 0 && (cp->index & MP_LOST)) {
cp->index |= MP_POSTED;
if (g_post_event(g_mpd, cp, M_NOWAIT, NULL) == 0)
cp->index |= MP_POSTED;
mtx_unlock(&sc->sc_mtx);
g_post_event(g_mpd, cp, M_WAITOK, NULL);
} else
mtx_unlock(&sc->sc_mtx);
g_std_done(bp);

View File

@ -2579,7 +2579,6 @@ swapgeom_done(struct bio *bp2)
struct swdevt *sp;
struct buf *bp;
struct g_consumer *cp;
int destroy;
bp = bp2->bio_caller2;
cp = bp2->bio_from;
@ -2590,15 +2589,14 @@ swapgeom_done(struct bio *bp2)
bp->b_error = bp2->bio_error;
bufdone(bp);
mtx_lock(&sw_dev_mtx);
destroy = ((--cp->index) == 0 && cp->private);
if (destroy) {
sp = bp2->bio_caller1;
sp->sw_id = NULL;
if ((--cp->index) == 0 && cp->private) {
if (g_post_event(swapgeom_close_ev, cp, M_NOWAIT, NULL) == 0) {
sp = bp2->bio_caller1;
sp->sw_id = NULL;
}
}
mtx_unlock(&sw_dev_mtx);
g_destroy_bio(bp2);
if (destroy)
g_waitfor_event(swapgeom_close_ev, cp, M_WAITOK, NULL);
}
static void