Jens Axboe wrote:
Ok, I'll give you some hints to get you started... What you really want
to do, is:
- Insert a park request at the front of the queue
- On completion callback on that request, freeze the block queue and
schedule it for unfreeze after a given time
Am attaching a first attempt at a patch - for comments only - please don't apply to a production system. I've not delved into the IDE code before, so I've just been following my nose... In other words - It appears to work for me - but I may be doing something crazy ;)
Having said that, I tested with a utility that repeatedly froze/thawed hundreds of times while really hammering the disk with file copies, and nothing oopsed or failed to checksum afterwards...
To do:
Move the /proc interface to sysfs. At the moment it's just a simple 'echo -n 1 > /proc/ide/hda/freeze' to freeze, and 0 to thaw.
Address Jens concerns about our userspace code falling over and leaving the machine hung. I favour retaining a binary on/off interface (rather than specifying a timeout up front), but having the IDE code auto-thaw on a timer.. That way we can just keep writing 1's to it while we're checking the accelerometer and wanting to keep it frozen, and if we should die then it'll wake up by itself after a second or so...
Same again for libata (for T43 owners).
Regards,
Jon.
______________________________________________________________
Email via Mailtraq4Free from Enstar (www.mailtraqdirect.co.uk)