Re: IOBlockStorageDriver::synchronizeCache
Re: IOBlockStorageDriver::synchronizeCache
- Subject: Re: IOBlockStorageDriver::synchronizeCache
- From: Michael Smith <email@hidden>
- Date: Fri, 6 Aug 2010 09:20:17 -0700
On Aug 6, 2010, at 8:42 AM, Niklas Hoglund wrote: We need to ensure ordering between writes, to make sure one write is not started until another has completed, to avoid potential data corruption in the case of power losses or crashes.
In a driver that inherits from IOBlockStorageDriver, can I be sure that any data that has been written to that device has reached the disk surface by calling synchronizeCache, or could drive buffers, NCQ or similar interfere with that.
synchronizeCache is the mechanism used by the OS when it has the same needs you do. It will do everything that the software stack can to ensure that data reaches stable storage.
Unfortunately, many drives do not honour this request (typically so that they look better in magazine benchmarks), so depending on the level of assurance you need, you may be forced to qualify drives on a firmware-by-firmware basis.
= Mike
-- Excellence in any department can be attained only by the labor of a lifetime; it is not to be purchased at a lesser price -- Samuel Johnson
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden