summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/contrib/dev/fla/fla.c11
-rw-r--r--sys/dev/ata/atapi-fd.c4
-rw-r--r--sys/dev/ccd/ccd.c9
-rw-r--r--sys/dev/fdc/fdc.c7
-rw-r--r--sys/dev/ida/ida_disk.c4
-rw-r--r--sys/geom/geom_ccd.c9
-rw-r--r--sys/i386/isa/atapi-cd.c4
-rw-r--r--sys/i386/isa/wd.c8
-rw-r--r--sys/i386/isa/wd_cd.c4
-rw-r--r--sys/i386/isa/wfd.c8
-rw-r--r--sys/isa/fd.c7
-rw-r--r--sys/pc98/cbus/fdc.c7
-rw-r--r--sys/pc98/pc98/fd.c7
-rw-r--r--sys/pc98/pc98/wd.c8
-rw-r--r--sys/pc98/pc98/wd_cd.c4
-rw-r--r--sys/pc98/pc98/wfd.c8
16 files changed, 19 insertions, 90 deletions
diff --git a/sys/contrib/dev/fla/fla.c b/sys/contrib/dev/fla/fla.c
index 83b0edc..b8998d6 100644
--- a/sys/contrib/dev/fla/fla.c
+++ b/sys/contrib/dev/fla/fla.c
@@ -197,7 +197,6 @@ flastrategy(struct buf *bp)
int s;
struct fla_s *sc;
enum doc2k_work what;
- devstat_trans_flags dop;
if (fla_debug > 1)
printf("flastrategy(%p) %s %lx, %d, %ld, %p)\n",
@@ -230,11 +229,11 @@ flastrategy(struct buf *bp)
unit = dkunit(bp->b_dev);
if (bp->b_flags & B_FREEBUF)
- what = DOC2K_ERASE, dop = DEVSTAT_NO_DATA;
+ what = DOC2K_ERASE;
else if (bp->b_flags & B_READ)
- what = DOC2K_READ, dop = DEVSTAT_READ;
+ what = DOC2K_READ;
else
- what = DOC2K_WRITE, dop = DEVSTAT_WRITE;
+ what = DOC2K_WRITE;
LEAVE();
@@ -254,10 +253,8 @@ flastrategy(struct buf *bp)
} else {
bp->b_resid = 0;
}
+ devstat_end_transaction_buf(&sc->stats, bp);
biodone(bp);
- devstat_end_transaction(&sc->stats, bp->b_bcount,
- DEVSTAT_TAG_NONE, dop);
-
s = splbio();
}
diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c
index 7191f79..5c98107 100644
--- a/sys/dev/ata/atapi-fd.c
+++ b/sys/dev/ata/atapi-fd.c
@@ -395,9 +395,7 @@ afd_done(struct atapi_request *request)
else
bp->b_resid += request->bytecount;
- devstat_end_transaction(&fdp->stats, bp->b_bcount - bp->b_resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags&B_READ) ? DEVSTAT_READ:DEVSTAT_WRITE);
+ devstat_end_transaction_buf(&fdp->stats, bp);
biodone(bp);
afd_start(fdp);
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c
index a889ca3..e13ac65 100644
--- a/sys/dev/ccd/ccd.c
+++ b/sys/dev/ccd/ccd.c
@@ -954,16 +954,9 @@ ccdintr(cs, bp)
/*
* Request is done for better or worse, wakeup the top half.
*/
- /* Record device statistics */
- devstat_end_transaction(&cs->device_stats,
- bp->b_bcount - bp->b_resid,
- (bp->b_flags & B_ORDERED) ?
- DEVSTAT_TAG_ORDERED : DEVSTAT_TAG_SIMPLE,
- (bp->b_flags & B_READ) ? DEVSTAT_READ :
- DEVSTAT_WRITE);
-
if (bp->b_flags & B_ERROR)
bp->b_resid = bp->b_bcount;
+ devstat_end_transaction_buf(&cs->device_stats, bp);
biodone(bp);
}
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 4075bf4..38fd38e 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -1935,12 +1935,7 @@ fdstate(fdc_p fdc)
/* ALL DONE */
fd->skip = 0;
fdc->bp = NULL;
- /* Tell devstat we have finished with the transaction */
- devstat_end_transaction(&fd->device_stats,
- bp->b_bcount - bp->b_resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags & B_READ) ?
- DEVSTAT_READ : DEVSTAT_WRITE);
+ devstat_end_transaction_buf(&fd->device_stats, bp);
biodone(bp);
fdc->fd = (fd_p) 0;
fdc->fdu = -1;
diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c
index 2874d25..6ec65cb 100644
--- a/sys/dev/ida/ida_disk.c
+++ b/sys/dev/ida/ida_disk.c
@@ -254,10 +254,8 @@ id_intr(struct buf *bp)
else
bp->b_resid = 0;
+ devstat_end_transaction_buf(&drv->stats, bp);
biodone(bp);
- devstat_end_transaction(&drv->stats,
- bp->b_bcount - bp->b_resid, DEVSTAT_TAG_NONE,
- (bp->b_flags & B_READ) ? DEVSTAT_READ : DEVSTAT_WRITE);
}
static void
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c
index a889ca3..e13ac65 100644
--- a/sys/geom/geom_ccd.c
+++ b/sys/geom/geom_ccd.c
@@ -954,16 +954,9 @@ ccdintr(cs, bp)
/*
* Request is done for better or worse, wakeup the top half.
*/
- /* Record device statistics */
- devstat_end_transaction(&cs->device_stats,
- bp->b_bcount - bp->b_resid,
- (bp->b_flags & B_ORDERED) ?
- DEVSTAT_TAG_ORDERED : DEVSTAT_TAG_SIMPLE,
- (bp->b_flags & B_READ) ? DEVSTAT_READ :
- DEVSTAT_WRITE);
-
if (bp->b_flags & B_ERROR)
bp->b_resid = bp->b_bcount;
+ devstat_end_transaction_buf(&cs->device_stats, bp);
biodone(bp);
}
diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c
index 678603f..e4b9ddc 100644
--- a/sys/i386/isa/atapi-cd.c
+++ b/sys/i386/isa/atapi-cd.c
@@ -546,9 +546,6 @@ static void
acd_done(struct acd *cdp, struct buf *bp, int resid, struct atapires result)
{
- devstat_end_transaction(cdp->device_stats, bp->b_bcount - resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags&B_READ) ? DEVSTAT_READ:DEVSTAT_WRITE);
if (result.code) {
atapi_error(cdp->ata, cdp->unit, result);
bp->b_error = EIO;
@@ -558,6 +555,7 @@ acd_done(struct acd *cdp, struct buf *bp, int resid, struct atapires result)
if ((bp->b_flags & B_READ) == B_WRITE)
cdp->flags |= F_WRITTEN;
}
+ devstat_end_transaction_buf(cdp->device_stats, bp);
biodone(bp);
acd_start(cdp);
}
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index 76a9755..93a031e 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -1157,13 +1157,7 @@ done: ;
bp->b_resid = bp->b_bcount - du->dk_skip * DEV_BSIZE;
wdutab[du->dk_lunit].b_active = 0;
du->dk_skip = 0;
-
- /* Update device stats */
- devstat_end_transaction(&du->dk_stats,
- bp->b_bcount - bp->b_resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags & B_READ) ? DEVSTAT_READ : DEVSTAT_WRITE);
-
+ devstat_end_transaction_buf(&du->dk_stats, bp);
biodone(bp);
}
diff --git a/sys/i386/isa/wd_cd.c b/sys/i386/isa/wd_cd.c
index 678603f..e4b9ddc 100644
--- a/sys/i386/isa/wd_cd.c
+++ b/sys/i386/isa/wd_cd.c
@@ -546,9 +546,6 @@ static void
acd_done(struct acd *cdp, struct buf *bp, int resid, struct atapires result)
{
- devstat_end_transaction(cdp->device_stats, bp->b_bcount - resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags&B_READ) ? DEVSTAT_READ:DEVSTAT_WRITE);
if (result.code) {
atapi_error(cdp->ata, cdp->unit, result);
bp->b_error = EIO;
@@ -558,6 +555,7 @@ acd_done(struct acd *cdp, struct buf *bp, int resid, struct atapires result)
if ((bp->b_flags & B_READ) == B_WRITE)
cdp->flags |= F_WRITTEN;
}
+ devstat_end_transaction_buf(cdp->device_stats, bp);
biodone(bp);
acd_start(cdp);
}
diff --git a/sys/i386/isa/wfd.c b/sys/i386/isa/wfd.c
index 3a169ac..21fdb44 100644
--- a/sys/i386/isa/wfd.c
+++ b/sys/i386/isa/wfd.c
@@ -554,13 +554,7 @@ static void wfd_done (struct wfd *t, struct buf *bp, int resid,
*/
if (((int)bp->b_driver1)-- <= 0) {
bp->b_resid = (int)bp->b_driver2;
-
- /* Tell devstat we have finished with the transaction */
- devstat_end_transaction(&t->device_stats,
- bp->b_bcount - bp->b_resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags & B_READ) ? DEVSTAT_READ : DEVSTAT_WRITE);
-
+ devstat_end_transaction_buf(&t->device_stats, bp);
biodone (bp);
}
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index 4075bf4..38fd38e 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.c
@@ -1935,12 +1935,7 @@ fdstate(fdc_p fdc)
/* ALL DONE */
fd->skip = 0;
fdc->bp = NULL;
- /* Tell devstat we have finished with the transaction */
- devstat_end_transaction(&fd->device_stats,
- bp->b_bcount - bp->b_resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags & B_READ) ?
- DEVSTAT_READ : DEVSTAT_WRITE);
+ devstat_end_transaction_buf(&fd->device_stats, bp);
biodone(bp);
fdc->fd = (fd_p) 0;
fdc->fdu = -1;
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c
index a3431ef..63bfecd 100644
--- a/sys/pc98/cbus/fdc.c
+++ b/sys/pc98/cbus/fdc.c
@@ -2375,12 +2375,7 @@ fdstate(fdc_p fdc)
/* ALL DONE */
fd->skip = 0;
fdc->bp = NULL;
- /* Tell devstat we have finished with the transaction */
- devstat_end_transaction(&fd->device_stats,
- bp->b_bcount - bp->b_resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags & B_READ) ?
- DEVSTAT_READ : DEVSTAT_WRITE);
+ devstat_end_transaction_buf(&fd->device_stats, bp);
biodone(bp);
fdc->fd = (fd_p) 0;
fdc->fdu = -1;
diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c
index a3431ef..63bfecd 100644
--- a/sys/pc98/pc98/fd.c
+++ b/sys/pc98/pc98/fd.c
@@ -2375,12 +2375,7 @@ fdstate(fdc_p fdc)
/* ALL DONE */
fd->skip = 0;
fdc->bp = NULL;
- /* Tell devstat we have finished with the transaction */
- devstat_end_transaction(&fd->device_stats,
- bp->b_bcount - bp->b_resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags & B_READ) ?
- DEVSTAT_READ : DEVSTAT_WRITE);
+ devstat_end_transaction_buf(&fd->device_stats, bp);
biodone(bp);
fdc->fd = (fd_p) 0;
fdc->fdu = -1;
diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c
index 4404e9c..6383b34 100644
--- a/sys/pc98/pc98/wd.c
+++ b/sys/pc98/pc98/wd.c
@@ -1279,13 +1279,7 @@ done: ;
bp->b_resid = bp->b_bcount - du->dk_skip * DEV_BSIZE;
wdutab[du->dk_lunit].b_active = 0;
du->dk_skip = 0;
-
- /* Update device stats */
- devstat_end_transaction(&du->dk_stats,
- bp->b_bcount - bp->b_resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags & B_READ) ? DEVSTAT_READ : DEVSTAT_WRITE);
-
+ devstat_end_transaction_buf(&du->dk_stats, bp);
biodone(bp);
}
diff --git a/sys/pc98/pc98/wd_cd.c b/sys/pc98/pc98/wd_cd.c
index 678603f..e4b9ddc 100644
--- a/sys/pc98/pc98/wd_cd.c
+++ b/sys/pc98/pc98/wd_cd.c
@@ -546,9 +546,6 @@ static void
acd_done(struct acd *cdp, struct buf *bp, int resid, struct atapires result)
{
- devstat_end_transaction(cdp->device_stats, bp->b_bcount - resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags&B_READ) ? DEVSTAT_READ:DEVSTAT_WRITE);
if (result.code) {
atapi_error(cdp->ata, cdp->unit, result);
bp->b_error = EIO;
@@ -558,6 +555,7 @@ acd_done(struct acd *cdp, struct buf *bp, int resid, struct atapires result)
if ((bp->b_flags & B_READ) == B_WRITE)
cdp->flags |= F_WRITTEN;
}
+ devstat_end_transaction_buf(cdp->device_stats, bp);
biodone(bp);
acd_start(cdp);
}
diff --git a/sys/pc98/pc98/wfd.c b/sys/pc98/pc98/wfd.c
index 3a169ac..21fdb44 100644
--- a/sys/pc98/pc98/wfd.c
+++ b/sys/pc98/pc98/wfd.c
@@ -554,13 +554,7 @@ static void wfd_done (struct wfd *t, struct buf *bp, int resid,
*/
if (((int)bp->b_driver1)-- <= 0) {
bp->b_resid = (int)bp->b_driver2;
-
- /* Tell devstat we have finished with the transaction */
- devstat_end_transaction(&t->device_stats,
- bp->b_bcount - bp->b_resid,
- DEVSTAT_TAG_NONE,
- (bp->b_flags & B_READ) ? DEVSTAT_READ : DEVSTAT_WRITE);
-
+ devstat_end_transaction_buf(&t->device_stats, bp);
biodone (bp);
}
OpenPOWER on IntegriCloud