diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2000-04-02 19:08:05 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2000-04-02 19:08:05 +0000 |
| commit | 282ac69ede590e0a39a0e08862c637269e7daf62 (patch) | |
| tree | 5cadfb37f3a34b824b5d52e69ea01ff89f8b391b /sys/kern/subr_devstat.c | |
| parent | 7c8fdcbd195d1322a8c87df8dda2a5394f27b25b (diff) | |
Notes
Diffstat (limited to 'sys/kern/subr_devstat.c')
| -rw-r--r-- | sys/kern/subr_devstat.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c index 81740ed7cb92..c86d16b966f3 100644 --- a/sys/kern/subr_devstat.c +++ b/sys/kern/subr_devstat.c @@ -245,6 +245,23 @@ devstat_end_transaction_buf(struct devstat *ds, struct buf *bp) DEVSTAT_TAG_ORDERED : DEVSTAT_TAG_SIMPLE, flg); } +void +devstat_end_transaction_bio(struct devstat *ds, struct bio *bp) +{ + devstat_trans_flags flg; + + if (bp->bio_cmd == BIO_DELETE) + flg = DEVSTAT_FREE; + else if (bp->bio_cmd == BIO_READ) + flg = DEVSTAT_READ; + else + flg = DEVSTAT_WRITE; + + devstat_end_transaction(ds, bp->bio_bcount - bp->bio_resid, + (bp->bio_flags & BIO_ORDERED) ? + DEVSTAT_TAG_ORDERED : DEVSTAT_TAG_SIMPLE, flg); +} + /* * This is the sysctl handler for the devstat package. The data pushed out * on the kern.devstat.all sysctl variable consists of the current devstat |
