From 1b8c015f6ea3e2660a2924d4a0fc69243cb16e0b Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 18 Sep 1999 21:30:27 +0000 Subject: [PATCH] Use devstat_end_transaction_buf() rather than Use devstat_end_transaction() --- sys/contrib/dev/fla/fla.c | 11 ++++------- sys/dev/ata/atapi-fd.c | 4 +--- sys/dev/ccd/ccd.c | 9 +-------- sys/dev/fdc/fdc.c | 7 +------ sys/dev/ida/ida_disk.c | 4 +--- sys/geom/geom_ccd.c | 9 +-------- sys/i386/isa/atapi-cd.c | 4 +--- sys/i386/isa/wd.c | 8 +------- sys/i386/isa/wd_cd.c | 4 +--- sys/i386/isa/wfd.c | 8 +------- sys/isa/fd.c | 7 +------ sys/pc98/cbus/fdc.c | 7 +------ sys/pc98/pc98/fd.c | 7 +------ sys/pc98/pc98/wd.c | 8 +------- sys/pc98/pc98/wd_cd.c | 4 +--- sys/pc98/pc98/wfd.c | 8 +------- 16 files changed, 19 insertions(+), 90 deletions(-) diff --git a/sys/contrib/dev/fla/fla.c b/sys/contrib/dev/fla/fla.c index 83b0edc59dc2..b8998d6c898e 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 7191f798d05e..5c98107afe5f 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 a889ca38ca1c..e13ac65c99fa 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 4075bf40397f..38fd38e370e3 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 2874d2565c18..6ec65cba7065 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 a889ca38ca1c..e13ac65c99fa 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 678603fbdd99..e4b9ddcaaf4c 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 76a9755e960e..93a031e30c7b 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 678603fbdd99..e4b9ddcaaf4c 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 3a169acc0a13..21fdb4410798 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 4075bf40397f..38fd38e370e3 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 a3431ef0c4db..63bfecdd97cf 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 a3431ef0c4db..63bfecdd97cf 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 4404e9c8f817..6383b347bad9 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 678603fbdd99..e4b9ddcaaf4c 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 3a169acc0a13..21fdb4410798 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); }