summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2013-01-18 11:48:06 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2013-01-18 11:48:06 +0000
commitff14ee4e72e58d5e31f04f31ce3738cc66722903 (patch)
tree478fd20d05f94a8d50557ee9d043e4f10ce8d1e0
parent2fca441a963b2f936bc26a6cb65f97a807703bba (diff)
Convert softraid RAID 0 to new workunit completion functions
-rw-r--r--sys/dev/softraid_raid0.c48
1 files changed, 7 insertions, 41 deletions
diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c
index ae0e846fc16..3edc851eb02 100644
--- a/sys/dev/softraid_raid0.c
+++ b/sys/dev/softraid_raid0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid0.c,v 1.32 2013/01/18 06:49:16 jsing Exp $ */
+/* $OpenBSD: softraid_raid0.c,v 1.33 2013/01/18 11:48:05 jsing Exp $ */
/*
* Copyright (c) 2008 Marco Peereboom <marco@peereboom.us>
*
@@ -246,52 +246,18 @@ void
sr_raid0_intr(struct buf *bp)
{
struct sr_ccb *ccb = (struct sr_ccb *)bp;
- struct sr_workunit *wu = ccb->ccb_wu, *wup;
- struct sr_discipline *sd = wu->swu_dis;
+ struct sr_workunit *wu = ccb->ccb_wu;
+#ifdef SR_DEBUG
struct scsi_xfer *xs = wu->swu_xs;
- struct sr_softc *sc = sd->sd_sc;
+ struct sr_discipline *sd = wu->swu_dis;
+#endif
int s;
DNPRINTF(SR_D_INTR, "%s: %s %s intr bp %x xs %x\n",
- DEVNAME(sc), sd->sd_meta.ssd_name, sd->sd_name, bp, xs);
+ DEVNAME(sd->sd_sc), sd->sd_meta.ssd_name, sd->sd_name, bp, xs);
s = splbio();
-
sr_ccb_done(ccb);
-
- DNPRINTF(SR_D_INTR, "%s: sr_intr: comp: %d count: %d failed: %d\n",
- DEVNAME(sc), wu->swu_ios_complete, wu->swu_io_count,
- wu->swu_ios_failed);
-
- if (wu->swu_ios_complete >= wu->swu_io_count) {
- TAILQ_FOREACH(wup, &sd->sd_wu_pendq, swu_link)
- if (wup == wu)
- break;
-
- if (wup == NULL)
- panic("%s: wu %p not on pending queue",
- DEVNAME(sc), wu);
-
- TAILQ_REMOVE(&sd->sd_wu_pendq, wu, swu_link);
-
- if (wu->swu_collider) {
- /* restart deferred wu */
- wu->swu_collider->swu_state = SR_WU_INPROGRESS;
- TAILQ_REMOVE(&sd->sd_wu_defq,
- wu->swu_collider, swu_link);
- sr_raid_startwu(wu->swu_collider);
- }
-
- if (wu->swu_ios_failed)
- xs->error = XS_DRIVER_STUFFUP;
- else
- xs->error = XS_NOERROR;
-
- sr_scsi_done(sd, xs);
-
- if (sd->sd_sync && sd->sd_wu_pending == 0)
- wakeup(sd);
- }
-
+ sr_wu_done(wu);
splx(s);
}