summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2016-02-17 17:16:02 +0000
committerimp <imp@FreeBSD.org>2016-02-17 17:16:02 +0000
commit0bfb5dbc867a4ef73b0b2259adfd285a1cbaf5d2 (patch)
tree9d0b9ff9938b0c9fa10bfca4675a8a542491fbe6 /sys/kern
parenta8f5ecad19b5c936057dbbcda2353b9ca84b09f5 (diff)
downloadFreeBSD-src-0bfb5dbc867a4ef73b0b2259adfd285a1cbaf5d2.zip
FreeBSD-src-0bfb5dbc867a4ef73b0b2259adfd285a1cbaf5d2.tar.gz
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.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_physio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index 5d75304..a148386 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -110,7 +110,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
error = 0;
for (i = 0; i < uio->uio_iovcnt; i++) {
while (uio->uio_iov[i].iov_len) {
- bzero(bp, sizeof(*bp));
+ g_reset_bio(bp);
if (uio->uio_rw == UIO_READ) {
bp->bio_cmd = BIO_READ;
curthread->td_ru.ru_inblock++;
OpenPOWER on IntegriCloud