diff options
author | 2013-01-18 11:48:05 +0000 | |
---|---|---|
committer | 2013-01-18 11:48:05 +0000 | |
commit | e10f90d85be82948aa902d7a03209d91b30ccf02 (patch) | |
tree | 56667c7b472b63da72dc14c8c9212ea59c1a3914 /sys/dev/softraid_raid0.c | |
parent | Fix the makefile so it works on other architectures. (diff) | |
download | wireguard-openbsd-e10f90d85be82948aa902d7a03209d91b30ccf02.tar.xz wireguard-openbsd-e10f90d85be82948aa902d7a03209d91b30ccf02.zip |
Convert softraid RAID 0 to new workunit completion functions
Diffstat (limited to 'sys/dev/softraid_raid0.c')
-rw-r--r-- | sys/dev/softraid_raid0.c | 48 |
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); } |