From eea7f71c81a8ed9a645a3d820399c7e945749f2d Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 25 Nov 2010 20:05:11 +0000 Subject: [PATCH] Account i/o done on cdevs. Reported and tested by: Adam Vande More MFC after: 1 week --- sys/kern/kern_physio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index d6be6e7c087e..34072f33a6ac 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -57,10 +57,13 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) for (i = 0; i < uio->uio_iovcnt; i++) { while (uio->uio_iov[i].iov_len) { bp->b_flags = 0; - if (uio->uio_rw == UIO_READ) + if (uio->uio_rw == UIO_READ) { bp->b_iocmd = BIO_READ; - else + curthread->td_ru.ru_inblock++; + } else { bp->b_iocmd = BIO_WRITE; + curthread->td_ru.ru_oublock++; + } bp->b_iodone = bdone; bp->b_data = uio->uio_iov[i].iov_base; bp->b_bcount = uio->uio_iov[i].iov_len;