Author: mav
Date: Thu May 8 12:27:24 2014
New Revision: 265672
URL: http://svnweb.freebsd.org/changeset/base/265672
Log:
MFC r256606:
Move g_io_deliver() out of the lock, as required for direct dispatch.
Move g_destroy_bio() out too to reduce lock scope even more.
Modified:
stable/9/sys/geom/geom_disk.c
Directory Properties:
stable/9/ (props changed)
stable/9/sys/ (props changed)
Modified: stable/9/sys/geom/geom_disk.c
==============================================================================
--- stable/9/sys/geom/geom_disk.c Thu May 8 12:26:08 2014
(r265671)
+++ stable/9/sys/geom/geom_disk.c Thu May 8 12:27:24 2014
(r265672)
@@ -249,13 +249,14 @@ g_disk_done(struct bio *bp)
bp2->bio_completed += bp->bio_completed;
if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0)
devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now);
- g_destroy_bio(bp);
bp2->bio_inbed++;
if (bp2->bio_children == bp2->bio_inbed) {
+ mtx_unlock(&sc->done_mtx);
bp2->bio_resid = bp2->bio_bcount - bp2->bio_completed;
g_io_deliver(bp2, bp2->bio_error);
- }
- mtx_unlock(&sc->done_mtx);
+ } else
+ mtx_unlock(&sc->done_mtx);
+ g_destroy_bio(bp);
}
static int
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"