summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2013-05-21 14:25:23 +0000
committerjsing <jsing@openbsd.org>2013-05-21 14:25:23 +0000
commit97ec8a20eb5b47af0001b243e0807f63c770048f (patch)
tree8383b4407ab0a39fb25e6a9e4d18a7ba300a1d49 /sys
parentWrap list of prototypes in a .nr nS 1/0 pair just like all the others. No (diff)
downloadwireguard-openbsd-97ec8a20eb5b47af0001b243e0807f63c770048f.tar.xz
wireguard-openbsd-97ec8a20eb5b47af0001b243e0807f63c770048f.zip
Use a state to indicate that a work unit should only be constructed and not
scheduled, rather than trying to imply this from the rebuild flag.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/softraid.c4
-rw-r--r--sys/dev/softraid_raid1.c6
-rw-r--r--sys/dev/softraid_raid6.c6
-rw-r--r--sys/dev/softraid_raidp.c6
-rw-r--r--sys/dev/softraidvar.h3
5 files changed, 14 insertions, 11 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index ce0d771fb61..f951a4d57eb 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.302 2013/04/26 15:45:35 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.303 2013/05/21 14:25:23 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -4632,6 +4632,7 @@ sr_rebuild_thread(void *arg)
cr->opcode = READ_16;
_lto4b(sz, cr->length);
_lto8b(lba, cr->addr);
+ wu_r->swu_state = SR_WU_CONSTRUCT;
wu_r->swu_flags |= SR_WUF_REBUILD;
wu_r->swu_xs = &xs_r;
if (sd->sd_scsi_rw(wu_r)) {
@@ -4652,6 +4653,7 @@ sr_rebuild_thread(void *arg)
cw->opcode = WRITE_16;
_lto4b(sz, cw->length);
_lto8b(lba, cw->addr);
+ wu_w->swu_state = SR_WU_CONSTRUCT;
wu_w->swu_flags |= SR_WUF_REBUILD | SR_WUF_WAKEUP;
wu_w->swu_xs = &xs_w;
if (sd->sd_scsi_rw(wu_w)) {
diff --git a/sys/dev/softraid_raid1.c b/sys/dev/softraid_raid1.c
index 0e189930bfd..a0c99a67344 100644
--- a/sys/dev/softraid_raid1.c
+++ b/sys/dev/softraid_raid1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid1.c,v 1.50 2013/04/21 13:00:21 jsing Exp $ */
+/* $OpenBSD: softraid_raid1.c,v 1.51 2013/05/21 14:25:23 jsing Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -404,8 +404,8 @@ ragain:
s = splbio();
- /* rebuild io, let rebuild routine deal with it */
- if (wu->swu_flags & SR_WUF_REBUILD)
+ /* Construct the work unit, do not schedule it. */
+ if (wu->swu_state == SR_WU_CONSTRUCT)
goto queued;
/* current io failed, restart */
diff --git a/sys/dev/softraid_raid6.c b/sys/dev/softraid_raid6.c
index dbf7a954509..231694a8772 100644
--- a/sys/dev/softraid_raid6.c
+++ b/sys/dev/softraid_raid6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid6.c,v 1.49 2013/04/27 14:06:09 jsing Exp $ */
+/* $OpenBSD: softraid_raid6.c,v 1.50 2013/05/21 14:25:23 jsing Exp $ */
/*
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
@@ -630,8 +630,8 @@ sr_raid6_rw(struct sr_workunit *wu)
wu = wu_r;
}
- /* rebuild io, let rebuild routine deal with it */
- if (wu->swu_flags & SR_WUF_REBUILD)
+ /* Construct the work unit, do not schedule it. */
+ if (wu->swu_state == SR_WU_CONSTRUCT)
goto queued;
/* current io failed, restart */
diff --git a/sys/dev/softraid_raidp.c b/sys/dev/softraid_raidp.c
index 02c7d3a7e08..bb2d7753687 100644
--- a/sys/dev/softraid_raidp.c
+++ b/sys/dev/softraid_raidp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raidp.c,v 1.46 2013/04/26 16:06:05 jsing Exp $ */
+/* $OpenBSD: softraid_raidp.c,v 1.47 2013/05/21 14:25:23 jsing Exp $ */
/*
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
@@ -487,8 +487,8 @@ sr_raidp_rw(struct sr_workunit *wu)
wu = wu_r;
}
- /* rebuild io, let rebuild routine deal with it */
- if (wu->swu_flags & SR_WUF_REBUILD)
+ /* Construct the work unit, do not schedule it. */
+ if (wu->swu_state == SR_WU_CONSTRUCT)
goto queued;
/* current io failed, restart */
diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h
index ac3be994c05..f4da0ad2a02 100644
--- a/sys/dev/softraidvar.h
+++ b/sys/dev/softraidvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraidvar.h,v 1.136 2013/04/26 15:45:35 jsing Exp $ */
+/* $OpenBSD: softraidvar.h,v 1.137 2013/05/21 14:25:24 jsing Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -379,6 +379,7 @@ struct sr_workunit {
#define SR_WU_PENDING 6
#define SR_WU_RESTART 7
#define SR_WU_REQUEUE 8
+#define SR_WU_CONSTRUCT 9
int swu_flags; /* additional hints */
#define SR_WUF_REBUILD (1<<0) /* rebuild io */