summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/geom/geom_dev.c2
-rw-r--r--sys/geom/multipath/g_multipath.c4
-rw-r--r--sys/vm/swap_pager.c12
3 files changed, 8 insertions, 10 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index decbbe0..2539e1b 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -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);
}
diff --git a/sys/geom/multipath/g_multipath.c b/sys/geom/multipath/g_multipath.c
index 7593cca..0953d18 100644
--- a/sys/geom/multipath/g_multipath.c
+++ b/sys/geom/multipath/g_multipath.c
@@ -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);
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 435f412..55e02c4 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -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
OpenPOWER on IntegriCloud