summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-all.h
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2008-03-17 10:33:23 +0000
committerphk <phk@FreeBSD.org>2008-03-17 10:33:23 +0000
commit916647a52a03a583385f5a55dd2c00410a3c2075 (patch)
tree42facee2a8a6b82282cf32d98ef5558ca3765746 /sys/dev/ata/ata-all.h
parent341d5f653b205917fac261a059ef06e686ae47ab (diff)
downloadFreeBSD-src-916647a52a03a583385f5a55dd2c00410a3c2075.zip
FreeBSD-src-916647a52a03a583385f5a55dd2c00410a3c2075.tar.gz
Add a "spindown" facility to ata-disks: If no requests have been received
for a configurable number of seconds, spin the disk down. Spin it back up on the next request. Notice that the timeout is only armed by a request, so to spin down a disk you may have to do: atacontrol spindown ad10 5 dd if=/dev/ad10 of=/dev/null count=1 To disable spindown, set timeout to zero: atacontrol spindown ad10 0 In order to debug any trouble caused, this code is somewhat noisy on the console. Enabling spindown on a disk containing / or /var/log/messages is not going to do anything sensible. Spinning a disk up and down all the time will wear it out, use sensibly. Approved by: sos
Diffstat (limited to 'sys/dev/ata/ata-all.h')
-rw-r--r--sys/dev/ata/ata-all.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h
index f590c35..28adac9 100644
--- a/sys/dev/ata/ata-all.h
+++ b/sys/dev/ata/ata-all.h
@@ -403,6 +403,9 @@ struct ata_device {
struct ata_params param; /* ata param structure */
int mode; /* current transfermode */
u_int32_t max_iosize; /* max IO size */
+ int spindown; /* idle spindown timeout */
+ struct callout spindown_timer;
+ int spindown_state;
int flags;
#define ATA_D_USE_CHS 0x0001
#define ATA_D_MEDIA_CHANGED 0x0002
OpenPOWER on IntegriCloud