Add a DriveDetach() method to properly power down USB hard disk enclosures
This work is inspired by this thread
http://thread.gmane.org/gmane.linux.hotplug.devel/14079
that is referencing this blog entry
http://elliotli.blogspot.com/2009/01/safely-remove-usb-hard-drive-in-linux.html
The only difference here is that instead of unbinding the usb driver
from the usb device, we unbind the usb-storage driver from the usb
interface in question. This is to better handle multi-function devices
(e.g. multiple USB interfaces).
Things like GVfs (ie. Nautilus) can use this new method to offer an
"Eject" option for USB enclosures that can invoke DriveDetach() on
this service. (In GVfs, such devices currently have no eject option
since they don't support removable media).
12 files changed: