IOBlockStorageDriver
The common base class for generic block storage drivers.
Declaration
class IOBlockStorageDriver : IOStorageOverview
The IOBlockStorageDriver class is the common base class for generic block storage drivers. It matches and communicates via an IOBlockStorageDevice interface, and connects to the remainder of the storage framework via the IOStorage protocol. It extends the IOStorage protocol by implementing the appropriate open and close semantics, deblocking for unaligned transfers, polling for ejectable media, locking and ejection policies, media object creation and tear-down, and statistics gathering and reporting.
Block storage drivers are split into two parts: the generic driver handles all generic device issues, independent of the lower-level transport mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations at the generic driver level are translated into a series of generic device operations. These operations are passed via the IOBlockStorageDevice nub to a transport driver, which implements the appropriate transport-dependent protocol to execute these operations.
To determine the write-protect state of a device (or media), for example, the generic driver would issue a call to the Transport Driver's reportWriteProtection method. If this were a SCSI device, its transport driver would issue a Mode Sense command to extract the write-protection status bit. The transport driver then reports true or false to the generic driver.
The generic driver therefore has no knowledge of, or involvement with, the actual commands and mechanisms used to communicate with the device. It is expected that the generic driver will rarely, if ever, need to be subclassed to handle device idiosyncrasies; rather, the transport driver should be changed via overrides.
A generic driver could be subclassed to create a different type of generic device. The generic driver IOCDBlockStorageDriver class is a subclass of IOBlockStorageDriver, adding CD functions.
Topics
Miscellaneous
acceptNewMediaaddToBytesTransferredallocateContextbreakUpRequestcheckForMediaconstrainByteCountcopyPhysicalExtentdeblockRequestdecommissionMediadeleteContextejectMediaexecuteRequestformatMediagetDeviceTypeNamegetFormatCapacitiesgetMediaBlockSizegetMediaStategetStatisticgetStatisticshandleClosehandleIsOpenhandleOpenhandleStartincrementErrorsincrementRetriesinitMediaStateinstantiateDesiredMediaObjectinstantiateMediaObjectisMediaEjectableisMediaRemovableisMediaWritablelockPhysicalExtentsmediaStateHasChangedprepareRequestreadrecordMediaParametersrejectMediarequestIdlesynchronizeCacheunlockPhysicalExtentsunmapvalidateNewMediawrite
Instance Variables
_writeProtected_removable_mediaType_mediaObject_mediaBlockSize_maxWriteByteTransfer_maxReadByteTransfer_maxBlockNumber_ejectable
Instance Methods
acceptNewMediaaddToBytesTransferredallocateContextbreakUpRequestcheckForMediaconstrainByteCountcopyPhysicalExtentdeblockRequestdecommissionMediadeleteContextdidTerminateejectMediaexecuteRequestformatMediafreegetDeviceTypeNamegetFormatCapacitiesgetMediaBlockSizegetMediaStategetMetaClassgetProvidergetProvisionStatusgetStatisticgetStatisticshandleClosehandleIsOpenhandleOpenhandleStarthandleYieldincrementErrorsincrementRetriesinitinitMediaStateinstantiateDesiredMediaObjectinstantiateMediaObjectisMediaEjectableisMediaPollExpensiveisMediaPollRequiredisMediaRemovableisMediaWritablelockMedialockPhysicalExtentsmediaStateHasChangedmessagepollMediaprepareRequestreadrecordMediaParametersrejectMediarequestIdleschedulePollersetPrioritystartstopsynchronizesystemWillShutdownunlockPhysicalExtentsunmapunschedulePollervalidateNewMediawriteyield