summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/softraid.c4
-rw-r--r--sys/dev/softraid_raid1.c15
-rw-r--r--sys/dev/softraid_raid6.c14
-rw-r--r--sys/dev/softraid_raidp.c15
-rw-r--r--sys/dev/softraidvar.h5
5 files changed, 24 insertions, 29 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 380d8032cb2..b7216d91779 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.292 2013/03/29 11:46:43 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.293 2013/03/29 12:00:59 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -4570,7 +4570,7 @@ sr_rebuild_thread(void *arg)
cw->opcode = WRITE_16;
_lto4b(sz, cw->length);
_lto8b(lba, cw->addr);
- wu_w->swu_flags |= SR_WUF_REBUILD;
+ wu_w->swu_flags |= SR_WUF_REBUILD | SR_WUF_WAKEUP;
wu_w->swu_xs = &xs_w;
if (sd->sd_scsi_rw(wu_w)) {
printf("%s: could not create write io\n",
diff --git a/sys/dev/softraid_raid1.c b/sys/dev/softraid_raid1.c
index d94f6c59436..699b37a88ff 100644
--- a/sys/dev/softraid_raid1.c
+++ b/sys/dev/softraid_raid1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid1.c,v 1.44 2013/03/29 11:46:45 jsing Exp $ */
+/* $OpenBSD: softraid_raid1.c,v 1.45 2013/03/29 12:00:59 jsing Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -531,15 +531,12 @@ sr_raid1_intr(struct buf *bp)
sr_raid_startwu(wu->swu_collider);
}
- if (wu->swu_flags & SR_WUF_REBUILD) {
- /* XXX - decouple from SCSI_DATA_OUT. */
- if (wu->swu_xs->flags & SCSI_DATA_OUT) {
- wu->swu_flags |= SR_WUF_REBUILDIOCOMP;
- wakeup(wu);
- }
- } else {
+ if (wu->swu_flags & SR_WUF_REBUILD)
+ wu->swu_flags |= SR_WUF_REBUILDIOCOMP;
+ if (wu->swu_flags & SR_WUF_WAKEUP)
+ wakeup(wu);
+ if (!(wu->swu_flags & SR_WUF_REBUILD))
sr_scsi_done(sd, xs);
- }
done:
splx(s);
diff --git a/sys/dev/softraid_raid6.c b/sys/dev/softraid_raid6.c
index 1eeff435468..0283516d938 100644
--- a/sys/dev/softraid_raid6.c
+++ b/sys/dev/softraid_raid6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid6.c,v 1.37 2013/03/29 11:46:45 jsing Exp $ */
+/* $OpenBSD: softraid_raid6.c,v 1.38 2013/03/29 12:00:59 jsing Exp $ */
/*
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
@@ -819,13 +819,11 @@ sr_raid6_intr(struct buf *bp)
sr_raid_startwu(wu->swu_collider);
}
- if (wu->swu_flags & SR_WUF_REBUILD) {
- /* XXX - decouple from SCSI_DATA_OUT. */
- if (wu->swu_xs->flags & SCSI_DATA_OUT) {
- wu->swu_flags |= SR_WUF_REBUILDIOCOMP;
- wakeup(wu);
- }
- } else {
+ if (wu->swu_flags & SR_WUF_REBUILD)
+ wu->swu_flags |= SR_WUF_REBUILDIOCOMP;
+ if (wu->swu_flags & SR_WUF_WAKEUP)
+ wakeup(wu);
+ if (!(wu->swu_flags & SR_WUF_REBUILD)) {
if (xs == NULL) {
scsi_io_put(&sd->sd_iopool, wu);
if (sd->sd_sync && sd->sd_wu_pending == 0)
diff --git a/sys/dev/softraid_raidp.c b/sys/dev/softraid_raidp.c
index e01bc7b8776..5b4700bb3ec 100644
--- a/sys/dev/softraid_raidp.c
+++ b/sys/dev/softraid_raidp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raidp.c,v 1.34 2013/03/29 11:46:45 jsing Exp $ */
+/* $OpenBSD: softraid_raidp.c,v 1.35 2013/03/29 12:00:59 jsing Exp $ */
/*
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
@@ -635,13 +635,11 @@ sr_raidp_intr(struct buf *bp)
sr_raid_startwu(wu->swu_collider);
}
- if (wu->swu_flags & SR_WUF_REBUILD) {
- /* XXX - decouple from SCSI_DATA_OUT. */
- if (wu->swu_xs->flags & SCSI_DATA_OUT) {
- wu->swu_flags |= SR_WUF_REBUILDIOCOMP;
- wakeup(wu);
- }
- } else {
+ if (wu->swu_flags & SR_WUF_REBUILD)
+ wu->swu_flags |= SR_WUF_REBUILDIOCOMP;
+ if (wu->swu_flags & SR_WUF_WAKEUP)
+ wakeup(wu);
+ if (!(wu->swu_flags & SR_WUF_REBUILD)) {
if (xs == NULL) {
scsi_io_put(&sd->sd_iopool, wu);
if (sd->sd_sync && sd->sd_wu_pending == 0)
@@ -795,6 +793,7 @@ sr_raidp_scrub(struct sr_discipline *sd)
/* Collide wu_w with wu_r */
wu_w->swu_state = SR_WU_DEFERRED;
+ wu_w->swu_flags |= SR_WUF_REBUILD | SR_WUF_WAKEUP;
wu_r->swu_collider = wu_w;
s = splbio();
diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h
index 7aa0c5353da..4d654d04fc6 100644
--- a/sys/dev/softraidvar.h
+++ b/sys/dev/softraidvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraidvar.h,v 1.129 2013/03/25 16:01:49 jsing Exp $ */
+/* $OpenBSD: softraidvar.h,v 1.130 2013/03/29 12:00:59 jsing Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -382,9 +382,10 @@ struct sr_workunit {
int swu_flags; /* additional hints */
#define SR_WUF_REBUILD (1<<0) /* rebuild io */
-#define SR_WUF_REBUILDIOCOMP (1<<1) /* rbuild io complete */
+#define SR_WUF_REBUILDIOCOMP (1<<1) /* rebuild io complete */
#define SR_WUF_FAIL (1<<2) /* RAID6: failure */
#define SR_WUF_FAILIOCOMP (1<<3)
+#define SR_WUF_WAKEUP (1<<4) /* Wakeup on I/O completion. */
int swu_fake; /* faked wu */
/* workunit io range */