summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2008-11-25 23:05:18 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2008-11-25 23:05:18 +0000
commita4da895d5e3f5a0e64c2271f9729508beb443b0e (patch)
treed90a354d969514c81141d22e9ad2d9be38a38fb7
parent798c8bc91f292bdf214bd165571fc5282871ea74 (diff)
Add generic sr_scsi_done function that does the spl dance
-rw-r--r--sys/dev/softraid.c18
-rw-r--r--sys/dev/softraid_aoe.c4
-rw-r--r--sys/dev/softraid_crypto.c4
-rw-r--r--sys/dev/softraid_raid0.c6
-rw-r--r--sys/dev/softraid_raid1.c6
-rw-r--r--sys/dev/softraidvar.h4
6 files changed, 27 insertions, 15 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 03efd09cec8..77a477fb738 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.124 2008/11/25 22:48:22 marco Exp $ */
+/* $OpenBSD: softraid.c,v 1.125 2008/11/25 23:05:17 marco Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -1403,6 +1403,18 @@ sr_wu_get(struct sr_discipline *sd)
return (wu);
}
+void
+sr_scsi_done(struct sr_discipline *sd, struct scsi_xfer *xs)
+{
+ int s;
+
+ DNPRINTF(SR_D_DIS, "%s: sr_scsi_done: xs %p\n", DEVNAME(sd->sd_sc), xs);
+
+ s = splbio();
+ scsi_done(xs);
+ splx(s);
+}
+
int
sr_scsi_cmd(struct scsi_xfer *xs)
{
@@ -1532,11 +1544,9 @@ stuffup:
xs->flags |= ITSDONE;
}
complete:
- s = splbio();
- scsi_done(xs);
- splx(s);
if (wu)
sr_wu_put(wu);
+ sr_scsi_done(sd, xs);
return (COMPLETE);
}
int
diff --git a/sys/dev/softraid_aoe.c b/sys/dev/softraid_aoe.c
index f63936a8ee9..0b7fc789a6f 100644
--- a/sys/dev/softraid_aoe.c
+++ b/sys/dev/softraid_aoe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_aoe.c,v 1.1 2008/11/23 23:44:01 tedu Exp $ */
+/* $OpenBSD: softraid_aoe.c,v 1.2 2008/11/25 23:05:17 marco Exp $ */
/*
* Copyright (c) 2008 Ted Unangst <tedu@openbsd.org>
* Copyright (c) 2008 Marco Peereboom <marco@openbsd.org>
@@ -465,7 +465,7 @@ sr_aoe_input(struct aoe_handler *ah, struct mbuf *m)
/* do not change the order of these 2 functions */
sr_wu_put(wu);
- scsi_done(xs);
+ sr_scsi_done(sd, xs);
}
out:
diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c
index 37ea6712b6c..866def1d1e3 100644
--- a/sys/dev/softraid_crypto.c
+++ b/sys/dev/softraid_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_crypto.c,v 1.31 2008/09/22 19:44:00 miod Exp $ */
+/* $OpenBSD: softraid_crypto.c,v 1.32 2008/11/25 23:05:17 marco Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
@@ -707,7 +707,7 @@ sr_crypto_finish_io(struct sr_workunit *wu)
/* do not change the order of these 2 functions */
sr_wu_put(wu);
- scsi_done(xs);
+ sr_scsi_done(sd, xs);
if (sd->sd_sync && sd->sd_wu_pending == 0)
wakeup(sd);
diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c
index 9eff9facc4c..6422dd53e35 100644
--- a/sys/dev/softraid_raid0.c
+++ b/sys/dev/softraid_raid0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid0.c,v 1.10 2008/10/04 19:21:00 miod Exp $ */
+/* $OpenBSD: softraid_raid0.c,v 1.11 2008/11/25 23:05:17 marco Exp $ */
/*
* Copyright (c) 2008 Marco Peereboom <marco@peereboom.us>
*
@@ -382,7 +382,7 @@ sr_raid0_intr(struct buf *bp)
/* do not change the order of these 2 functions */
sr_wu_put(wu);
- scsi_done(xs);
+ sr_scsi_done(sd, xs);
if (sd->sd_sync && sd->sd_wu_pending == 0)
wakeup(sd);
@@ -394,6 +394,6 @@ bad:
xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
sr_wu_put(wu);
- scsi_done(xs);
+ sr_scsi_done(sd, xs);
splx(s);
}
diff --git a/sys/dev/softraid_raid1.c b/sys/dev/softraid_raid1.c
index a89294ce1c3..30c7e75ee2b 100644
--- a/sys/dev/softraid_raid1.c
+++ b/sys/dev/softraid_raid1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid1.c,v 1.6 2008/07/19 22:41:58 marco Exp $ */
+/* $OpenBSD: softraid_raid1.c,v 1.7 2008/11/25 23:05:17 marco Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -511,7 +511,7 @@ sr_raid1_intr(struct buf *bp)
/* do not change the order of these 2 functions */
sr_wu_put(wu);
- scsi_done(xs);
+ sr_scsi_done(sd, xs);
if (sd->sd_sync && sd->sd_wu_pending == 0)
wakeup(sd);
@@ -524,7 +524,7 @@ bad:
xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
sr_wu_put(wu);
- scsi_done(xs);
+ sr_scsi_done(sd, xs);
splx(s);
}
diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h
index 827a75a6fc1..473afd6041b 100644
--- a/sys/dev/softraidvar.h
+++ b/sys/dev/softraidvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraidvar.h,v 1.64 2008/11/23 23:44:01 tedu Exp $ */
+/* $OpenBSD: softraidvar.h,v 1.65 2008/11/25 23:05:17 marco Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -466,6 +466,8 @@ void sr_meta_save_callback(void *, void *);
int sr_validate_io(struct sr_workunit *, daddr64_t *,
char *);
int sr_check_io_collision(struct sr_workunit *);
+void sr_scsi_done(struct sr_discipline *,
+ struct scsi_xfer *);
/* discipline functions */
int sr_raid_inquiry(struct sr_workunit *);