diff options
author | phk <phk@FreeBSD.org> | 2002-09-27 20:53:47 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-09-27 20:53:47 +0000 |
commit | 0aade3f175756813bffa2ed394d419c4612e9f00 (patch) | |
tree | 160a5ea593dfac67cdc6d2e164a7c0d09e00586f /sys/geom/geom_io.c | |
parent | 5002cfbb7eb2c253e16d44b1cb09d24e86fae96f (diff) | |
download | FreeBSD-src-0aade3f175756813bffa2ed394d419c4612e9f00.zip FreeBSD-src-0aade3f175756813bffa2ed394d419c4612e9f00.tar.gz |
Allocate bio's with M_NOWAIT and let the caller deal with the problems.
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/geom/geom_io.c')
-rw-r--r-- | sys/geom/geom_io.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index db6db80..ac71f66 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -124,7 +124,7 @@ g_new_bio(void) bp = g_bioq_first(&g_bio_idle); if (bp == NULL) - bp = g_malloc(sizeof *bp, M_WAITOK | M_ZERO); + bp = g_malloc(sizeof *bp, M_NOWAIT | M_ZERO); g_trace(G_T_BIO, "g_new_bio() = %p", bp); return (bp); } @@ -144,12 +144,14 @@ g_clone_bio(struct bio *bp) struct bio *bp2; bp2 = g_new_bio(); - bp2->bio_linkage = bp; - bp2->bio_cmd = bp->bio_cmd; - bp2->bio_length = bp->bio_length; - bp2->bio_offset = bp->bio_offset; - bp2->bio_data = bp->bio_data; - bp2->bio_attribute = bp->bio_attribute; + if (bp2 != NULL) { + bp2->bio_linkage = bp; + bp2->bio_cmd = bp->bio_cmd; + bp2->bio_length = bp->bio_length; + bp2->bio_offset = bp->bio_offset; + bp2->bio_data = bp->bio_data; + bp2->bio_attribute = bp->bio_attribute; + } g_trace(G_T_BIO, "g_clone_bio(%p) = %p", bp, bp2); return(bp2); } |