From 8633830499db1c406c3dfa7e654d2bae768193bb Mon Sep 17 00:00:00 2001 From: kib Date: Thu, 25 Nov 2010 20:05:11 +0000 Subject: 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(-) (limited to 'sys/kern/kern_physio.c') diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index d6be6e7..34072f3 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; -- cgit v1.1