summaryrefslogtreecommitdiff
path: root/sys/scsi/sd.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2010-06-28 08:35:47 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2010-06-28 08:35:47 +0000
commit449a5242d535e6a55d98a78538e9feb2ae617e46 (patch)
treebe61211591745f9ac49094f78dff8b9436bd29b0 /sys/scsi/sd.c
parente1ff1b940aff4e9a8375c3bf8d8a0ad5daece206 (diff)
Move disk_attach() to the end of the attach functions, at which point the
disk is now ready to handle I/O. ok krw@ dlg@
Diffstat (limited to 'sys/scsi/sd.c')
-rw-r--r--sys/scsi/sd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 5ff51310ab3..11e207b3ff9 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.197 2010/06/24 10:05:18 dlg Exp $ */
+/* $OpenBSD: sd.c,v 1.198 2010/06/28 08:35:46 jsing Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -178,12 +178,11 @@ sdattach(struct device *parent, struct device *self, void *aux)
sc_link->device_softc = sc;
/*
- * Initialize and attach the disk structure.
+ * Initialize disk structures.
*/
sc->sc_dk.dk_driver = &sddkdriver;
sc->sc_dk.dk_name = sc->sc_dev.dv_xname;
sc->sc_bufq = bufq_init(BUFQ_DEFAULT);
- disk_attach(&sc->sc_dk);
if ((sc_link->flags & SDEV_ATAPI) && (sc_link->flags & SDEV_REMOVABLE))
sc_link->quirks |= SDEV_NOSYNCCACHE;
@@ -270,6 +269,9 @@ sdattach(struct device *parent, struct device *self, void *aux)
shutdownhook_establish(sd_shutdown, sc)) == NULL)
printf("%s: WARNING: unable to establish shutdown hook\n",
sc->sc_dev.dv_xname);
+
+ /* Attach disk. */
+ disk_attach(&sc->sc_dk);
}
int