From 0bfb5dbc867a4ef73b0b2259adfd285a1cbaf5d2 Mon Sep 17 00:00:00 2001 From: imp Date: Wed, 17 Feb 2016 17:16:02 +0000 Subject: Create an API to reset a struct bio (g_reset_bio). This is mandatory for all struct bio you get back from g_{new,alloc}_bio. Temporary bios that you create on the stack or elsewhere should use this before first use of the bio, and between uses of the bio. At the moment, it is nothing more than a wrapper around bzero, but that may change in the future. The wrapper also removes one place where we encode the size of struct bio in the KBI. --- sys/dev/mmc/mmcsd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/dev/mmc') diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c index 4ca0c24..7749123 100644 --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -487,7 +488,7 @@ mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, if (!length) return (0); - bzero(&bp, sizeof(struct bio)); + g_reset_bio(&bp); bp.bio_disk = disk; bp.bio_pblkno = offset / disk->d_sectorsize; bp.bio_bcount = length; -- cgit v1.1