-/* $OpenBSD: sd.c,v 1.253 2014/02/19 10:15:35 mpi Exp $ */
+/* $OpenBSD: sd.c,v 1.254 2014/07/10 19:13:55 mpi Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
void sdminphys(struct buf *);
int sdgetdisklabel(dev_t, struct sd_softc *, struct disklabel *, int);
void sdstart(struct scsi_xfer *);
-void sd_shutdown(void *);
int sd_interpret_sense(struct scsi_xfer *);
int sd_read_cap_10(struct sd_softc *, int);
int sd_read_cap_16(struct sd_softc *, int);
sd_ioctl_cache(sc, DIOCSCACHE, &dkc);
}
- /*
- * Establish a shutdown hook so that we can ensure that
- * our data has actually made it onto the platter at
- * shutdown time. Note that this relies on the fact
- * that the shutdown hook code puts us at the head of
- * the list (thus guaranteeing that our hook runs before
- * our ancestors').
- */
- if ((sc->sc_sdhook =
- 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_dev, &sc->sc_dk);
}
/*
* Stop the disk. Stopping the disk should flush the
* cache, but we are paranoid so we flush the cache
- * first.
+ * first. We're cold at this point, so we poll for
+ * completion.
*/
if ((sc->flags & SDF_DIRTY) != 0)
sd_flush(sc, SCSI_AUTOCONF);
disk_gone(sdopen, self->dv_unit);
- /* Get rid of the shutdown hook. */
- if (sc->sc_sdhook != NULL)
- shutdownhook_disestablish(sc->sc_sdhook);
-
/* Detach disk. */
bufq_destroy(&sc->sc_bufq);
disk_detach(&sc->sc_dk);
}
-void
-sd_shutdown(void *arg)
-{
- struct sd_softc *sc = (struct sd_softc *)arg;
-
- /*
- * If the disk cache needs to be flushed, and the disk supports
- * it, flush it. We're cold at this point, so we poll for
- * completion.
- */
- if ((sc->flags & SDF_DIRTY) != 0)
- sd_flush(sc, SCSI_AUTOCONF);
-}
-
/*
* Check Errors
*/