summaryrefslogtreecommitdiff
path: root/sys/scsi/scsiconf.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2009-08-09 12:47:24 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2009-08-09 12:47:24 +0000
commit1778e353edc65e9ea30f24d9341dfad10dcd57d9 (patch)
tree05f3f9658bab709b43e1b98049fab0c1b7aa3716 /sys/scsi/scsiconf.c
parentf39d463c083bc9393fe45f5cccf828cd7d8ae8ce (diff)
add mpath(4), a driver that steals paths to scsi devices if it
thinks they could be available via multiple paths. those stolen devices are then made available via mpath(4). this is the minimum amount of code to implement the stealing. it is generally broken and very brittle, so it is currently disabled. it is going in so i can work on it in the tree.
Diffstat (limited to 'sys/scsi/scsiconf.c')
-rw-r--r--sys/scsi/scsiconf.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index 3c15768c5b3..84cb1b83b8b 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.139 2009/08/08 09:33:50 dlg Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.140 2009/08/09 12:47:23 dlg Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -48,6 +48,7 @@
*/
#include "bio.h"
+#include "mpath.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -436,7 +437,13 @@ scsi_detach_lun(struct scsibus_softc *sc, int target, int lun, int flags)
/* detaching a device from scsibus is a three step process... */
/* 1. detach the device */
- rv = config_detach(link->device_softc, flags);
+#if NMPATH > 0
+ if (link->device_softc == NULL)
+ rv = mpath_path_detach(link, flags);
+ else
+#endif /* NMPATH */
+ rv = config_detach(link->device_softc, flags);
+
if (rv != 0)
return (rv);
@@ -812,6 +819,14 @@ scsi_probedev(struct scsibus_softc *scsi, int target, int lun)
goto bad;
}
+#if NMPATH > 0
+ /* should multipathing steal the link? */
+ if (mpath_path_attach(sc_link) == 0) {
+ scsi->sc_link[target][lun] = sc_link;
+ return (0);
+ }
+#endif /* NMPATH */
+
finger = (const struct scsi_quirk_inquiry_pattern *)scsi_inqmatch(
inqbuf, scsi_quirk_patterns,
sizeof(scsi_quirk_patterns)/sizeof(scsi_quirk_patterns[0]),