diff options
author | 2013-04-26 15:45:35 +0000 | |
---|---|---|
committer | 2013-04-26 15:45:35 +0000 | |
commit | 19d5807363573486e21c3b35e0ec8f29d8a88a06 (patch) | |
tree | fea6e1cb5d4ef19cbebc5e5c936d4959e18ee1e6 /sys/dev/softraid.c | |
parent | Don't use usbd_bulk_transfer() to submit a synchronous transfer here too. (diff) | |
download | wireguard-openbsd-19d5807363573486e21c3b35e0ec8f29d8a88a06.tar.xz wireguard-openbsd-19d5807363573486e21c3b35e0ec8f29d8a88a06.zip |
Add a SR_WUF_DISCIPLINE flag that identifies work units that have resulted
from discipline specific I/O. Such work units are not associated with a
SCSI xfer and are returned via sr_wu_put() on completion.
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index b63ba7ed547..ce0d771fb61 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.301 2013/04/23 12:49:52 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.302 2013/04/26 15:45:35 jsing Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -2253,12 +2253,21 @@ sr_wu_done_callback(void *arg1, void *arg2) struct sr_workunit *wup; int s; + /* + * The SR_WUF_DISCIPLINE or SR_WUF_REBUILD flag must be set if + * the work unit is not associated with a scsi_xfer. + */ + KASSERT(xs != NULL || + (wu->swu_flags & (SR_WUF_DISCIPLINE|SR_WUF_REBUILD))); + s = splbio(); - if (wu->swu_ios_failed) - xs->error = XS_DRIVER_STUFFUP; - else - xs->error = XS_NOERROR; + if (xs != NULL) { + if (wu->swu_ios_failed) + xs->error = XS_DRIVER_STUFFUP; + else + xs->error = XS_NOERROR; + } if (sd->sd_scsi_wu_done) { if (sd->sd_scsi_wu_done(wu) == SR_WU_RESTART) @@ -2294,6 +2303,8 @@ sr_wu_done_callback(void *arg1, void *arg2) wakeup(wu); if (sd->sd_scsi_done) sd->sd_scsi_done(wu); + else if (wu->swu_flags & SR_WUF_DISCIPLINE) + sr_scsi_wu_put(sd, wu); else if (!(wu->swu_flags & SR_WUF_REBUILD)) sr_scsi_done(sd, xs); |