summaryrefslogtreecommitdiff
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2013-03-25 16:01:50 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2013-03-25 16:01:50 +0000
commit70f9a624f789799fd8f194e22c02586549b30e9b (patch)
tree68ae4bb668bd63f83717a5e50dfdb95b47943623 /sys/dev/softraid.c
parent8719864660c5c508599035e11298e4116b707f6d (diff)
Factor out the code that is used to recreate work units - one copy of the
code is sufficient. ok krw@
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 5c23b464ce7..74d7f37a6fb 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.290 2013/03/10 09:05:12 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.291 2013/03/25 16:01:48 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -4128,6 +4128,28 @@ sr_raid_startwu(struct sr_workunit *wu)
}
void
+sr_raid_recreate_wu(struct sr_workunit *wu)
+{
+ struct sr_discipline *sd = wu->swu_dis;
+ struct sr_workunit *wup = wu;
+
+ /*
+ * Recreate a work unit by releasing the associated CCBs and reissuing
+ * the SCSI I/O request. This process is then repeated for all of the
+ * colliding work units.
+ */
+ do {
+ sr_wu_release_ccbs(wup);
+
+ wup->swu_state = SR_WU_REQUEUE;
+ if (sd->sd_scsi_rw(wup))
+ panic("could not requeue I/O");
+
+ wup = wup->swu_collider;
+ } while (wup);
+}
+
+void
sr_set_chunk_state(struct sr_discipline *sd, int c, int new_state)
{
int old_state, s;