summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_physio.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-11-25 20:05:11 +0000
committerkib <kib@FreeBSD.org>2010-11-25 20:05:11 +0000
commit8633830499db1c406c3dfa7e654d2bae768193bb (patch)
tree9fed979128a2851a15264510e3983c288b4f1ffc /sys/kern/kern_physio.c
parent42dd23c4f975f42c276dc06e71b0cae6a27fc943 (diff)
downloadFreeBSD-src-8633830499db1c406c3dfa7e654d2bae768193bb.zip
FreeBSD-src-8633830499db1c406c3dfa7e654d2bae768193bb.tar.gz
Account i/o done on cdevs.
Reported and tested by: Adam Vande More <amvandemore gmail com> MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_physio.c')
-rw-r--r--sys/kern/kern_physio.c7
1 files changed, 5 insertions, 2 deletions
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;
OpenPOWER on IntegriCloud