Date: Tue, 25 Jan 2011 20:46:54 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r217842 - projects/graid/head/sys/geom/raid Message-ID: <201101252046.p0PKksqU049913@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Jan 25 20:46:54 2011 New Revision: 217842 URL: http://svn.freebsd.org/changeset/base/217842 Log: Allocate dumping BIO on stack, same as done in other places. Modified: projects/graid/head/sys/geom/raid/g_raid.c Modified: projects/graid/head/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 20:44:24 2011 (r217841) +++ projects/graid/head/sys/geom/raid/g_raid.c Tue Jan 25 20:46:54 2011 (r217842) @@ -728,25 +728,24 @@ g_raid_dump(void *arg, { struct g_raid_softc *sc; struct g_raid_volume *vol; - struct bio *bp; + struct bio bp; vol = (struct g_raid_volume *)arg; sc = vol->v_softc; G_RAID_DEBUG(3, "Dumping at off %llu len %llu.", (long long unsigned)offset, (long long unsigned)length); - bp = g_alloc_bio(); - bp->bio_cmd = BIO_WRITE; - bp->bio_done = g_raid_dumpdone; - bp->bio_attribute = NULL; - bp->bio_offset = offset; - bp->bio_length = length; - bp->bio_data = virtual; - bp->bio_to = vol->v_provider; - - g_raid_start(bp); + bzero(&bp, sizeof(bp)); + bp.bio_cmd = BIO_WRITE; + bp.bio_done = g_raid_dumpdone; + bp.bio_attribute = NULL; + bp.bio_offset = offset; + bp.bio_length = length; + bp.bio_data = virtual; + bp.bio_to = vol->v_provider; - while (!(bp->bio_flags & BIO_DONE)) { + g_raid_start(&bp); + while (!(bp.bio_flags & BIO_DONE)) { G_RAID_DEBUG(4, "Poll..."); g_raid_poll(sc); DELAY(10); @@ -754,8 +753,6 @@ g_raid_dump(void *arg, G_RAID_DEBUG(3, "Dumping at off %llu len %llu done.", (long long unsigned)offset, (long long unsigned)length); - - g_destroy_bio(bp); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101252046.p0PKksqU049913>