Functions



complete

protected:

inline void complete(IOStorageCompletion completion, IOReturn status, UInt64 actualByteCount = 0);

Invokes the specified completion action of the read/write request. If the completion action is unspecified, no action is taken. This method serves simply as a convenience to storage subclass developers.

Parameters

NameDescription
completionCompletion information for the data transfer.
statusStatus of the data transfer.
actualByteCountActual number of bytes transferred in the data transfer.

handleClose

protected:

virtual void handleClose(IOService * client, IOOptionBits options) = 0;

The handleClose method closes the client's access to this object.

Parameters

NameDescription
clientClient requesting the close.
optionsOptions for the close. Set to zero.

handleIsOpen

protected:

virtual bool handleIsOpen(const IOService * client) const = 0;

The handleIsOpen method determines whether the specified client, or any client if none is specificed, presently has an open on this object.

Parameters

NameDescription
clientClient to check the open state of. Set to zero to check the open state of all clients.
Result: Returns true if the client was (or clients were) open, false otherwise.

handleOpen

protected:

virtual bool handleOpen(IOService * client, IOOptionBits options, void * access) = 0;

The handleOpen method grants or denies permission to access this object to an interested client. The argument is an IOStorageAccess value that specifies the level of access desired -- reader or reader-writer. * This method can be invoked to upgrade or downgrade the access level for an existing client as well. The previous access level will prevail for upgrades that fail, of course. A downgrade should never fail. If the new access level should be the same as the old for a given client, this method will do nothing and return success. In all cases, one, singular close-per-client is expected for all opens-per-client received.

Parameters

NameDescription
clientClient requesting the open.
optionsOptions for the open. Set to zero.
accessAccess level for the open. Set to kAccessReader or kAccessReaderWriter.
Result: Returns true if the open was successful, false otherwise.

open

public:

inline bool open(IOService * client, IOOptionBits options, IOStorageAccess access);

Ask the storage object for permission to access its contents; the method is equivalent to IOService::open(), but with the correct parameter types. * This method may also be invoked to upgrade or downgrade the access of an existing open (if it fails, the existing open prevails).

Parameters

NameDescription
clientClient requesting the open.
optionsOptions for the open. Set to zero.
accessAccess level for the open. Set to kAccessReader or kAccessReaderWriter.
Result: Returns true if the open was successful, false otherwise.

read

public:

virtual void read(IOService * client, UInt64 byteStart, IOMemoryDescriptor * buffer, IOStorageCompletion completion) = 0;

Read data from the storage object at the specified byte offset into the specified buffer, asynchronously. When the read completes, the caller will be notified via the specified completion action. * The buffer will be retained for the duration of the read.

Parameters

NameDescription
clientClient requesting the read.
byteStartStarting byte offset for the data transfer.
bufferBuffer for the data transfer. The size of the buffer implies the size of the data transfer.
completionCompletion routine to call once the data transfer is complete.

read

public:

virtual IOReturn read(IOService * client, UInt64 byteStart, IOMemoryDescriptor * buffer, UInt64 * actualByteCount = 0);

Read data from the storage object at the specified byte offset into the specified buffer, synchronously. When the read completes, this method will return to the caller. The actual byte count field is optional.

Parameters

NameDescription
clientClient requesting the read.
byteStartStarting byte offset for the data transfer.
bufferBuffer for the data transfer. The size of the buffer implies the size of the data transfer.
actualByteCountReturns the actual number of bytes transferred in the data transfer.
Result: Returns the status of the data transfer.

write

public:

virtual void write(IOService * client, UInt64 byteStart, IOMemoryDescriptor * buffer, IOStorageCompletion completion) = 0;

Write data into the storage object at the specified byte offset from the specified buffer, asynchronously. When the write completes, the caller will be notified via the specified completion action. * The buffer will be retained for the duration of the write.

Parameters

NameDescription
clientClient requesting the write.
byteStartStarting byte offset for the data transfer.
bufferBuffer for the data transfer. The size of the buffer implies the size of the data transfer.
completionCompletion routine to call once the data transfer is complete.

write

public:

virtual IOReturn write(IOService * client, UInt64 byteStart, IOMemoryDescriptor * buffer, UInt64 * actualByteCount = 0);

Write data into the storage object at the specified byte offset from the specified buffer, synchronously. When the write completes, this method will return to the caller. The actual byte count field is optional.

Parameters

NameDescription
clientClient requesting the write.
byteStartStarting byte offset for the data transfer.
bufferBuffer for the data transfer. The size of the buffer implies the size of the data transfer.
actualByteCountReturns the actual number of bytes transferred in the data transfer.
Result: Returns the status of the data transfer.

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)