Account i/o done on cdevs.

Reported and tested by:	Adam Vande More <amvandemore gmail com>
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2010-11-25 20:05:11 +00:00
parent e8222ab044
commit eea7f71c81
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=215838

View File

@ -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;