aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-04-09 13:09:05 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-04-09 13:09:05 +0000
commit0ada3afc253298c6dd80828b14dba1573e608941 (patch)
tree92cfec1ca24ab35cbb70a7a57690f18851f4d602
parentefb19cf6dbc7fe119072beac8fd27a579161efb3 (diff)
Notes
-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 decbbe0b4613..2539e1b1d8b8 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 7593ccaa238a..0953d1881759 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 435f412ef809..55e02c456ffd 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