IOFilterScheme |
Inherits from: | |
Declared In: |
The common base class for all filter scheme objects.
The IOFilterScheme class is the common base class for all filter scheme objects. It extends the IOStorage class by implementing the appropriate open and close semantics for filter objects (standard semantics are act as a relay for incoming opens, producing one outgoing open for each incoming open). It also implements the default read and write semantics, which pass all reads and writes through to the provider media unprocessed. For simple schemes, the default behavior is sufficient. More complex filter schemes such as RAID will want to do extra processing for reads and writes.
discard |
public
virtual IOReturn discard( IOService *client, UInt64 byteStart, UInt64 byteCount);
client
Client requesting the operation.
byteStart
Starting byte offset for the operation.
byteCount
Size of the operation.
Returns the status of the operation.
Delete unused data from the storage object at the specified byte offset, synchronously.
handleClose |
protected
virtual void handleClose( IOService *client, IOOptionBits options);
client
Client requesting the close.
options
Options for the close. Set to zero.
The handleClose method closes the client's access to this object.
This implementation replaces the IOService definition of handleClose().
handleIsOpen |
protected
virtual bool handleIsOpen( const IOService *client) const;
client
Client to check the open state of. Set to zero to check the open state of all clients.
Returns true if the client was (or clients were) open, false otherwise.
The handleIsOpen method determines whether the specified client, or any client if none is specified, presently has an open on this object.
This implementation replaces the IOService definition of handleIsOpen().
handleOpen |
protected
virtual bool handleOpen( IOService *client, IOOptionBits options, void *access);
client
Client requesting the open.
options
Options for the open. Set to zero.
access
Access level for the open. Set to kIOStorageAccessReader or kIOStorageAccessReaderWriter.
Returns true if the open was successful, false otherwise.
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.
This implementation replaces the IOService definition of handleOpen().
read |
public
virtual void read( IOService *client, UInt64 byteStart, IOMemoryDescriptor *buffer, IOStorageAttributes *attributes, IOStorageCompletion *completion);
client
Client requesting the read.
byteStart
Starting byte offset for the data transfer.
buffer
Buffer for the data transfer. The size of the buffer implies the size of the data transfer.
attributes
Attributes of the data transfer. See IOStorageAttributes. It is the responsibility of the callee to maintain the information for the duration of the data transfer, as necessary.
completion
Completion routine to call once the data transfer is complete. It is the responsibility of the callee to maintain the information for the duration of the data transfer, as necessary.
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.
For simple filter schemes, the default behavior is to simply pass the read through to the provider media. More complex filter schemes such as RAID will need to do extra processing here.
synchronizeCache |
public
virtual IOReturn synchronizeCache( IOService *client);
client
Client requesting the cache synchronization.
Returns the status of the cache synchronization.
Flush the cached data in the storage object, if any, synchronously.
write |
public
virtual void write( IOService *client, UInt64 byteStart, IOMemoryDescriptor *buffer, IOStorageAttributes *attributes, IOStorageCompletion *completion);
client
Client requesting the write.
byteStart
Starting byte offset for the data transfer.
buffer
Buffer for the data transfer. The size of the buffer implies the size of the data transfer.
attributes
Attributes of the data transfer. See IOStorageAttributes. It is the responsibility of the callee to maintain the information for the duration of the data transfer, as necessary.
completion
Completion routine to call once the data transfer is complete. It is the responsibility of the callee to maintain the information for the duration of the data transfer, as necessary.
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.
For simple filter schemes, the default behavior is to simply pass the write through to the provider media. More complex filter schemes such as RAID will need to do extra processing here.
Last Updated: 2010-07-29