Use devstat_end_transaction_buf() rather than Use devstat_end_transaction()
This commit is contained in:
parent
f7a80b89b7
commit
1b8c015f6e
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user