Mac Developer Library

Developer

IOStorage.h Reference

Options
Deployment Target:

On This Page

IOStorage.h Reference

This header contains the IOStorage class definition.

Included Headers

  • <sys/kernel_types.h>

  • <IOKit/IOTypes.h>

  • <IOKit/assert.h>

  • <IOKit/IOMemoryDescriptor.h>

  • <IOKit/IOService.h>

Callbacks

  • Declaration

    Objective-C

    typedef void ( *IOStorageCompletionAction)( void *target, void *parameter, IOReturn status, UInt64 actualByteCount);

    Parameters

    target

    Opaque client-supplied pointer (or an instance pointer for a C++ callback).

    parameter

    Opaque client-supplied pointer.

    status

    Status of the data transfer.

    actualByteCount

    Actual number of bytes transferred in the data transfer.

    Discussion

    The IOStorageCompletionAction declaration describes the C (or C++) completion routine that is called once an asynchronous storage operation completes.

    Import Statement

    Availability

    Available in OS X v10.6 and later.

Data Types

See the Overview section above for header-level documentation.

  • Declaration

    Objective-C

    struct IOStorageAttributes { IOStorageOptions options; #ifdef __LP64__ UInt32 reserved0032; UInt64 reserved0064; UInt64 reserved0128; bufattr_t bufattr; #if TARGET_OS_EMBEDDED UInt64 adjustedOffset; #endif /* TARGET_OS_EMBEDDED */ #else /* !__LP64__ */ bufattr_t bufattr; #if TARGET_OS_EMBEDDED UInt64 adjustedOffset; #else /* !TARGET_OS_EMBEDDED */ UInt64 reserved0064; #endif /* !TARGET_OS_EMBEDDED */ # endif /* !__LP64__ */ };

    Fields

    options

    Options for the request. See IOStorageOptions.

    bufattr

    Reserved for future use. Set to zero.

    Discussion

    Attributes of read and write storage requests.

    Availability

    Available in OS X v10.6 and later.

  • Declaration

    Objective-C

    struct IOStorageCompletion { void *target; IOStorageCompletionAction action; void *parameter; };

    Fields

    target

    Opaque client-supplied pointer (or an instance pointer for a C++ callback).

    action

    Completion routine to call on completion of the data transfer.

    parameter

    Opaque client-supplied pointer.

    Discussion

    The IOStorageCompletion structure describes the C (or C++) completion routine that is called once an asynchronous storage operation completes. The values passed for the target and parameter fields will be passed to the routine when it is called.

    Availability

    Available in OS X v10.6 and later.

  • Declaration

    Objective-C

    struct IOStorageExtent { UInt64 byteStart; UInt64 byteCount; };

    Fields

    byteStart

    Starting byte offset for the operation.

    byteCount

    Size of the operation.

    Discussion

    Extent for unmap storage requests.

    Availability

    Available in OS X v10.7 and later.

Constants

See the Overview section above for header-level documentation.

  • Declaration

    Objective-C

    #define kIOStorageCategory "IOStorage" /* (as IOMatchCategory) */ #define kIOStorageClass "IOStorage" #define kIOStorageFeatureForceUnitAccess "Force Unit Access" #define kIOStorageFeaturesKey "IOStorageFeatures" #define kIOStorageFeatureUnmap "Unmap"

    Constants

    • kIOStorageCategory

      kIOStorageCategory

      kIOStorageCategory is a value for IOService's kIOMatchCategoryKey property.

      The kIOStorageCategory value is the standard value for the IOService property kIOMatchCategoryKey ("IOMatchCategory") for all storage drivers. All storage objects that expect to drive new content (that is, produce new media objects) are expected to compete within the kIOStorageCategory namespace.

      See the IOService documentation for more information on match categories.

      Available in OS X v10.0 and later.

    • kIOStorageClass

      kIOStorageClass

      The name of the IOStorage class.

      Available in OS X v10.0 and later.

    • kIOStorageFeatureForceUnitAccess

      kIOStorageFeatureForceUnitAccess

      Describes the presence of the Force Unit Access feature.

      This property describes the ability of the storage stack to force a request to access the media. It is one of the feature entries listed under the top- level kIOStorageFeaturesKey property table. It has an OSBoolean value.

      Available in OS X v10.5 and later.

    • kIOStorageFeaturesKey

      kIOStorageFeaturesKey

      A property of any object in the storage stack.

      kIOStorageFeaturesKey is a property of any object in the storage stack that wishes to express support of additional features, such as Force Unit Access. It is typically defined in the device object below the block storage driver object. It has an OSDictionary value, where each entry describes one given feature.

      Available in OS X v10.5 and later.

    • kIOStorageFeatureUnmap

      kIOStorageFeatureUnmap

      Describes the presence of the Unmap feature.

      This property describes the ability of the storage stack to delete unused data from the media. It is one of the feature entries listed under the top- level kIOStorageFeaturesKey property table. It has an OSBoolean value.

      Available in OS X v10.7 and later.

    Import Statement

  • Declaration

    Objective-C

    enum { kIOStorageAccessNone = 0x00, kIOStorageAccessReader = 0x01, kIOStorageAccessReaderWriter = 0x03, kIOStorageAccessSharedLock = 0x04, kIOStorageAccessExclusiveLock = 0x08 };

    Constants

    • kIOStorageAccessNone

      kIOStorageAccessNone

      No access is requested; should not be passed to open().

      Available in OS X v10.4 and later.

    • kIOStorageAccessReader

      kIOStorageAccessReader

      Read-only access is requested.

      Available in OS X v10.4 and later.

    • kIOStorageAccessReaderWriter

      kIOStorageAccessReaderWriter

      Read and write access is requested.

      Available in OS X v10.4 and later.

    • kIOStorageAccessSharedLock

      kIOStorageAccessSharedLock

      Shared access is requested.

      Available in OS X v10.4 and later.

    • kIOStorageAccessExclusiveLock

      kIOStorageAccessExclusiveLock

      Exclusive access is requested.

      Available in OS X v10.4 and later.

    Discussion

    The IOStorageAccess enumeration describes the possible access levels for open requests.

    Import Statement

  • Declaration

    Objective-C

    enum { kIOStorageOptionNone = 0x00000000, kIOStorageOptionForceUnitAccess = 0x00000001, kIOStorageOptionIsEncrypted = 0x00000010, kIOStorageOptionIsStatic = 0x00000020, kIOStorageOptionReserved = 0xFFFFFFCE };

    Constants

    • kIOStorageOptionForceUnitAccess

      kIOStorageOptionForceUnitAccess

      Force the request to access the media.

      Available in OS X v10.6 and later.

    • kIOStorageOptionIsEncrypted

      kIOStorageOptionIsEncrypted

      The data is already encrypted.

      Available in OS X v10.7 and later.

    • kIOStorageOptionIsStatic

      kIOStorageOptionIsStatic

      The data is likely to remain unaltered.

      Available in OS X v10.8 and later.

    Discussion

    Options for read and write storage requests.

    Import Statement