summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-disk.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2003-05-02 13:47:44 +0000
committersos <sos@FreeBSD.org>2003-05-02 13:47:44 +0000
commitf1adb3279732da93033f0d0fb2b8c48294fbdaf9 (patch)
tree8bc5a20772d204c38e0a29546e4855994ee98d4a /sys/dev/ata/ata-disk.c
parent5ffbb6f14814926705590b37cac74dfd7fb68378 (diff)
downloadFreeBSD-src-f1adb3279732da93033f0d0fb2b8c48294fbdaf9.zip
FreeBSD-src-f1adb3279732da93033f0d0fb2b8c48294fbdaf9.tar.gz
Add flushing of devices on shutdown.
Note: this might print failure messages on some systems, unfortunatly the info from the device, stating if flushing is supported, cannot be trusted so the operation is always issued on all devices, just in case...
Diffstat (limited to 'sys/dev/ata/ata-disk.c')
-rw-r--r--sys/dev/ata/ata-disk.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c
index cb4e163..ffd31fb 100644
--- a/sys/dev/ata/ata-disk.c
+++ b/sys/dev/ata/ata-disk.c
@@ -53,7 +53,6 @@
/* prototypes */
static disk_open_t adopen;
-static disk_close_t adclose;
static disk_strategy_t adstrategy;
static dumper_t addump;
static void ad_invalidatequeue(struct ad_softc *, struct ad_request *);
@@ -186,7 +185,6 @@ ad_attach(struct ata_device *atadev)
ATA_UNLOCK_CH(atadev->channel);
adp->disk.d_open = adopen;
- adp->disk.d_close = adclose;
adp->disk.d_strategy = adstrategy;
adp->disk.d_dump = addump;
adp->disk.d_name = "ad";
@@ -208,7 +206,7 @@ ad_attach(struct ata_device *atadev)
}
void
-ad_detach(struct ata_device *atadev, int flush) /* get rid of flush XXX SOS */
+ad_detach(struct ata_device *atadev)
{
struct ad_softc *adp = atadev->driver;
struct ad_request *request;
@@ -229,10 +227,6 @@ ad_detach(struct ata_device *atadev, int flush) /* get rid of flush XXX SOS */
if (adp->flags & AD_F_RAID_SUBDISK)
ata_raiddisk_detach(adp);
- if (flush) {
- if (ata_command(atadev, ATA_C_FLUSHCACHE, 0, 0, 0, ATA_WAIT_READY))
- ata_prtdev(atadev, "flushing cache on detach failed\n");
- }
ata_free_name(atadev);
ata_free_lun(&adp_lun_map, adp->lun);
atadev->driver = NULL;
@@ -254,20 +248,6 @@ adopen(struct disk *dp)
return 0;
}
-static int
-adclose(struct disk *dp)
-{
- struct ad_softc *adp = dp->d_drv1;
-
- adp->device->channel->locking(adp->device->channel, ATA_LF_LOCK);
- ATA_SLEEPLOCK_CH(adp->device->channel, ATA_CONTROL);
- if (ata_command(adp->device, ATA_C_FLUSHCACHE, 0, 0, 0, ATA_WAIT_READY))
- ata_prtdev(adp->device, "flushing cache on close failed\n");
- ATA_UNLOCK_CH(adp->device->channel);
- adp->device->channel->locking(adp->device->channel, ATA_LF_UNLOCK);
- return 0;
-}
-
static void
adstrategy(struct bio *bp)
{
OpenPOWER on IntegriCloud