home *** CD-ROM | disk | FTP | other *** search
- /*
- File: BlockStoragePlugin.h
-
- Contains: Block Storage Plug In Programming Interface
-
- Version: Technology: Copland
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __BLOCKSTORAGEPLUGIN__
- #define __BLOCKSTORAGEPLUGIN__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __ERRORS__
- #include <Errors.h>
- #endif
- #ifndef __FILEMANAGERTYPES__
- #include <FileManagerTypes.h>
- #endif
- #ifndef __NAMEREGISTRY__
- #include <NameRegistry.h>
- #endif
- #ifndef __BLOCKSTORAGE__
- #include <BlockStorage.h>
- #endif
- #ifndef __IOMEMORYLISTS__
- #include <IOMemoryLists.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=power
- /* the following contents can only be used by compilers that support PowerPC struct alignment */
-
- #if FOR_SYSTEM8_PREEMPTIVE
- /*
- ******************************************************************************
- *******************************************************************************
- *******************************************************************************
-
- Plug In Constants
-
- *******************************************************************************
- *******************************************************************************
- *****************************************************************************
- */
- /*
- ******************************************************************************
-
- Options to a BSIOFunc
-
- *****************************************************************************
- */
-
- enum {
- kBSRead = 0,
- kBSWrite = 1
- };
-
- /*
- ******************************************************************************
-
- Mapping Plug-In Level of Confidence values
-
- *****************************************************************************
- */
-
- enum {
- kBSMPIDeviceNotSupported = 0,
- kBSMPIDeviceTypeRecognized = 1,
- kBSMPIDeviceMfrRecognized = 2,
- kBSMPIDeviceModelRecognized = 3,
- kBSMPIDeviceMediaRecognized = 4
- };
-
- typedef UInt32 BSMPIConfidenceLevel;
- /*
- ******************************************************************************
-
- Mapping Plug-In Level of Confidence values
-
- *****************************************************************************
- */
-
- enum {
- kBSCPIDeviceNotSupported = 0,
- kBSCPIDeviceTypeRecognized = 1,
- kBSCPIDeviceMfrRecognized = 2,
- kBSCPIDeviceModelRecognized = 3
- };
-
- typedef UInt32 BSCPIConfidenceLevel;
- /*
- ******************************************************************************
-
- Plug In Version - this tracks the revision of the plug-in interface and
- should be placed in the version field of the plug-in interface structure
-
- *****************************************************************************
- */
-
- enum {
- kBSPlugInInterfaceVersion = 0x02011996
- };
-
- /*
- ******************************************************************************
-
- BSIOStatus values
-
- *****************************************************************************
- */
-
- enum {
- kBSIOCompleted = 1,
- kBSIOContinuing = 2,
- kBSIOFailed = 3,
- kBSIONotStarted = 4
- };
-
- typedef UInt32 BSIOStatus;
- /*
- ******************************************************************************
- *******************************************************************************
- *******************************************************************************
-
- Types
-
- *******************************************************************************
- *******************************************************************************
- *****************************************************************************
- */
- typedef void *BSStorePtr;
- typedef void *BSContainerPtr;
- typedef void *BSIORequestBlockPtr;
- typedef OSStatus BSIOErrors;
- /*
- ******************************************************************************
- BSErrorList: another structure to manage I/O success/failure.
-
- BSErrorList data structure allows a Mapping Plug-In to keep track of the
- current state of each transfer request sent to it by the Block Storage client. If transfers complete
- successfully, a pointer 0 is returned. If an error occurs, a linked list (?) of these data structures
- is returned specifying the exact state of each transfer request.
-
- startingBlock: The initial transfer block of this fragment of the request
- blockCount: The number of blocks to be transfered including the startingBlock
- status: A constant representing the final state of the transfer of the blocks:
- kIONotStarted: No processing was begun on these blocks
- kIOStarted: The BS Plug-In began to process the blocks
- kIOToFamily: The request was sent to the device family
- kIOComplete: The request completed normally
- kIOFailed: The request failed to complete execution
- error: The exact error, if any
- xferID: An index representing which request of a multiple-request I/O this is
- next: A pointer to the next data structure (could be eliminated in favor of indices)
- *****************************************************************************
- */
- struct BSErrorList {
- BSByteCount startingBlock;
- BSByteCount length;
- UInt32 status;
- BSIOErrors error;
- ItemCount xferID;
- struct BSErrorList * next;
- };
- typedef struct BSErrorList BSErrorList;
-
- typedef BSErrorList *BSErrorListPtr;
- /*
- ****************************************************************************
-
- BSStoreMPIComponent describes a component of a Store. A component may
- be an external device or another Store. This is the internal form of
- BSStoreComponent.
-
- ***************************************************************************
- */
- struct BSStoreMPIComponent {
- BSComponentType componentType;
- BSByteCount startingOffset; /* Where in the Store this */
- /* component will be placed */
- RegEntryRef sourceNode; /* Physical components */
- BSStorePtr srcStore; /* Logical components */
- BSPartitionDescriptor partitionInfo; /* Logical components */
- };
- typedef struct BSStoreMPIComponent BSStoreMPIComponent;
-
- typedef BSStoreMPIComponent *BSStoreMPIComponentPtr;
- /*
- ******************************************************************************
-
- BSStoreMPIInfo - Information about the Store that the Mapping Plug-in can
- provide
-
- *****************************************************************************
- */
- struct BSStoreMPIInfo {
- BSAccessibilityState curState;
- BSByteCount storeSize;
- BSByteCount readBlockSize; /* minimum read size & granularity */
- BSByteCount writeBlockSize; /* minimum write size & granularity */
-
- Boolean isEjectable;
- Boolean isWriteable;
- Boolean hasAutoEjectHardware;
- Boolean isFormattable;
-
- Boolean isPartitionable;
- Boolean isFilesystem;
- Boolean reserved1;
- Boolean reserved2;
-
- BSStoreFormatInfo curFormat;
-
- BSStoreFormatInfo possibleFormats[8];
-
- char name[48];
- };
- typedef struct BSStoreMPIInfo BSStoreMPIInfo;
-
- typedef BSStoreMPIInfo *BSStoreMPIInfoPtr;
- /*
- ******************************************************************************
-
- BSStorePPIInfo - Information about the Store that the Partitioning Plug-in
- can provide
-
- *****************************************************************************
- */
- struct BSStorePPIInfo {
- ItemCount numPartitions;
- ItemCount maxPartitions;
- };
- typedef struct BSStorePPIInfo BSStorePPIInfo;
-
- typedef BSStorePPIInfo *BSStorePPIInfoPtr;
- /*
- ******************************************************************************
-
- BSContainerPIInfo - Information about the Container that the Container
- Plug-in can provide
-
- *****************************************************************************
- */
- struct BSContainerPIInfo {
- ItemCount numChildren;
- Boolean isEjectable;
-
- };
- typedef struct BSContainerPIInfo BSContainerPIInfo;
-
- typedef BSContainerPIInfo *BSContainerPIInfoPtr;
- /*
- ******************************************************************************
- *******************************************************************************
- *******************************************************************************
-
- Plug-In Interface Functions
-
- *******************************************************************************
- *******************************************************************************
- *****************************************************************************
- */
- /*
- ******************************************************************************
- *******************************************************************************
-
- Mapping Plug-In Interface
-
- *******************************************************************************
- *****************************************************************************
- */
- /*
- ******************************************************************************
- BSMappingPIExamine - Plug-in's opportunity to examine a device and determine
- if it is an appropriate plug-in for it
-
- Inputs: examineStore - a pointer to the in-process Store to be examined
-
- Outputs: confidence - level of confidence the plug-in has that the plugin
- is the correct one
-
- Returns: E_BSSuccess if no errors happened examining the device.
- If an error happened, the error received from the other family is
- returned
- *****************************************************************************
- */
- typedef OSStatus (*BSMappingPIExamine)(BSStorePtr examineStore, BSMPIConfidenceLevel *confidence);
- /*
- ******************************************************************************
-
- BSMappingPIInit - Plug-in's initialization routine. Called when plug-in
- is selected for a Store. Plug-in's opportunity to initialize
- device, allocate data structures, etc.
-
- Inputs: initStore - a pointer to the Store this plug-in will be attached
- to
- Outputs: curState - the current state of the media
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSMappingPIInit)(BSStorePtr initStore);
- /*
- ******************************************************************************
-
- BSMappingPICleanup - Plug-in's dispose routine. Called when Store is
- being disposed of. Should dispose of any memory or data structures
- held for this Store, finalize all I/O for Store
-
- Inputs: cleanupStore - Store that is being disposed of
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSMappingPICleanup)(BSStorePtr cleanupStore);
- /*
- ******************************************************************************
- BSMappingPIIO - Plug-in's input/output routine
-
- Inputs: ioStore - the Store on which IO is to be performed
- blocks - descriptor of the blocks to do IO on
- memory - descriptor of the memory to do IO on (memory has been prepared)
- parentRequest - the request this request is being made on behalf of
- options - read/write
-
- Outputs: errors - where exactly the errors occured, if any
-
- Returns: kBSIOContinuing if IO was started successfully and the I/O
- completion routine still needs to be called
- kBSIOCompleted if IO was completed and no further action is
- necessary
- kBSIOFailed if IO failed for some reason
- kBSIONotStarted if the IO could not be started
- *****************************************************************************
- */
- typedef BSIOStatus (*BSMappingPIIO)(BSStorePtr ioStore, BSBlockListDescriptorRef blocks, MemListDescriptorRef memory, BSIORequestBlockPtr parentRequest, OptionBits options, BSErrorList **errors);
- /*
- ******************************************************************************
- BSMappingPIFlush - flush plug-in's cached data (if any)
- BSMappingPIFlush flushes the plug-in's cached data. It is called
- in a similar fashion to an I/O request. BSStoreRW may be used
- as may BSStoreFlush.
-
- Inputs: flushStore - the Store on which flush is to be performed
- parentRequest - the request this request is being made on behalf of
-
- Outputs: errors - where exactly the errors occured, if any
-
- Returns: kBSIOContinuing if IO was started successfully and the I/O
- completion routine still needs to be called
- kBSIOCompleted if IO was completed and no further action is
- necessary
- kBSIOFailed if IO failed for some reason
- kBSIONotStarted if the IO could not be started
- *****************************************************************************
- */
- typedef BSIOStatus (*BSMappingPIFlush)(BSStorePtr ioStore, BSIORequestBlockPtr parentRequest, BSErrorList **errors);
- /*
- ******************************************************************************
- BSMappingPIAddComponent - Notifies Plug-in about new components to be added
- to it
-
- Inputs: destStore - the Store the blocks are to be mapped into
- newComponent - the new Component to be mapped in
-
- Outputs: storeNewInfo - the new information about the Store
-
-
- Returns: E_BSSuccess if successful
- E_BSMPITooManyMappings if no more mappings can be handled
- E_BSMPIOutOfStoreBounds if the start of the destination blocks
- would cause a gap in the Store
-
- *****************************************************************************
- */
- typedef OSStatus (*BSMappingPIAddComponent)(BSStorePtr destStore, BSStoreMPIComponent *newComponent, BSStoreInfo *storeNewInfo);
- /*
- ******************************************************************************
- BSMappingPIGoToState - Requests plug-in to take Store to the specified
- accessibility state.
-
- Inputs: theStore - Store to take to the state
- gotoState - what state to go to (possible states defined above)
-
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSMappingPIGoToState)(BSStorePtr theStore, BSAccessibilityState gotoState);
- /*
- ******************************************************************************
- BSMappingPIFormatMedia - tells plug-in to do a low-level format of the media
-
- Inputs: formatStore - Store to format
-
- Outputs: <none>
-
- Returns: E_BSSuccessful if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSMappingPIFormatMedia)(BSStorePtr formatStore, BSFormatIndex formatType);
- /*
- ******************************************************************************
- BSMappingPIGetInfo - gets information about the device and the plug-in
-
- Inputs: formatStore - Store to format
-
- Outputs: info - the filled in information
-
- Returns: E_BSSuccessful if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSMappingPIGetInfo)(BSStorePtr infoStore, BSStoreMPIInfo *info);
- /*
- ******************************************************************************
- BSMappingIOCompletion - I/O completion routine for a mapping plug-in
-
- Inputs: theStore: - A pointer to the Store in question
- finishedPrivateData - A pointer to the private data the Mapping
- plug-in associated with this I/O
- returnedBSErrorList - A pointer to a BSErrorList if the
- triggering event came from another BS plug-in
- returnedStatus - The OSStatus returned by the other family or
- plug-in that was called
- Outputs: errorListPtrPtr - A pointer to a pointer to a BSErrorList.
- The BSErrorList is allocated and filled in by the completion
- routine if the I/O has failed. It should be allocated using
- BSErrorListAllocate and will be deallocated by the family code.
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSMappingIOCompletion)(BSStorePtr theStore, void *finishedPrivateData, BSErrorListPtr returnedBSErrorList, OSStatus returnedStatus, BSErrorListPtr *errorListPtrPtr);
- struct BlockStoragePlugInInfo {
- UInt32 version;
- UInt32 reserved1;
- UInt32 reserved2;
- UInt32 reserved3;
- };
- typedef struct BlockStoragePlugInInfo BlockStoragePlugInInfo;
-
- struct BSStoreMappingOps {
- BlockStoragePlugInInfo header;
- BSMappingPIExamine DeviceExamine;
- BSMappingPIInit Init;
- BSMappingPICleanup Cleanup;
- BSMappingPIIO IO;
- BSMappingPIFlush Flush;
- BSMappingPIAddComponent AddComponent;
- BSMappingPIGoToState GotoState;
- BSMappingPIFormatMedia Format;
- BSMappingPIGetInfo GetInfo;
- BSMappingIOCompletion ioCompletion;
- };
- typedef struct BSStoreMappingOps BSStoreMappingOps;
-
- typedef BSStoreMappingOps *BSStoreMappingOpsPtr;
- /*
- ******************************************************************************
-
- BSMPIBackgroundTask - a background task entry point for a Mapping plug-in.
- BSMPIStartBackgroundTask may be used by the Mapping plug-in to
- start one of these. The task will be automatically terminated
- after the Cleanup routine is executed
-
- Inputs: theStore - the Store this is running for
- theArg - the argument passed to BSMPIStartBackgroundTask
-
- Outputs: <none>
-
- Returns: Errors are ignored but will be logged.
- *****************************************************************************
- */
- typedef OSStatus (*BSMPIBackgroundTask)(BSStorePtr theStore, void *theArg);
- /*
- ******************************************************************************
- *******************************************************************************
-
- Partitioning Plug-In Interface
-
- *******************************************************************************
- *****************************************************************************
- */
- /*
- ******************************************************************************
- BSPartitioningPIExamine - Plug-in's opportunity to examine a Store and
- determine if it's the right plug-in for it
-
- Inputs: readStoreConn - a connection to the Store to be examined
-
- Outputs: certainty - 0 if the plug-in did not recognize the partition
- map format
- otherwise the number of bytes read
-
- Returns: E_BSSuccess if no errors occured
- E_BSPPIOutOfResources if memory or other resource couldn't
- be allocated
- otherwise the Block Storage error from the I/O
-
- *****************************************************************************
- */
- typedef OSStatus (*BSPartitioningPIExamine)(BSStoreConnID readStoreConn, UInt32 *certainty);
- /*
- ******************************************************************************
- BSPartitioningPIInit - Plug-in's initialization routine. Called when
- plug-in is selected for a Store. Plug-in's opportunity to
- initialize device, allocate data structures, etc.
-
- Inputs: initStore - pointer to the Store the plug-in is being attached to
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSPartitioningPIInit)(BSStorePtr initStore);
- /*
- ******************************************************************************
-
- BSPartitioningPICleanup - Plug-in's dispose routine. Called when Store is
- being disposed of. Should dispose of any memory or data structures
- held for this Store and flush the partition map if necessary
-
- Inputs: cleanupStore - Store that is being disposed of
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef void (*BSPartitioningPICleanup)(BSStorePtr cleanupStore);
- /*
- ******************************************************************************
- BSPartitioningPIInitializeMap - lays down a new partition map on a Store (plug-in has
- already been attached)
-
- Inputs: initStore - the Store to be initialized
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
- otherwise, Block Storage error if I/O fails
-
- *****************************************************************************
- */
- typedef OSStatus (*BSPartitioningPIInitializeMap)(BSStorePtr initStore);
- /*
- ******************************************************************************
- BSPartitioningPIGetInfo - Gets information about the partition map and the
- partitioning plug-in
-
- Inputs: store - the Store to read from
-
- Outputs: info - the filled in information
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSPartitioningPIGetInfo)(BSStorePtr store, BSStorePPIInfo *info);
- /*
- ******************************************************************************
- BSPartitioningPIGetEntry - Get a particular partition map entry
-
- Inputs: readStore - the Store
- entryNum - which entry to read
-
- Outputs: retEntry - pointer to a BSPartitionDescriptor that's filled in
- with the entry
-
- Returns: E_BSSuccess if successful
- E_BSPPIPartitionNonExistant if that entry does not exist
- other Block Storage error if I/O problem
-
- *****************************************************************************
- */
- typedef OSStatus (*BSPartitioningPIGetEntry)(BSStorePtr readStore, ItemCount entryNum, BSPartitionDescriptor *retEntry);
- /*
- ******************************************************************************
- BSPartitioningSetEntry - Sets the information in a particular partition map
- entry
-
- Inputs:
-
- Outputs:
-
- Returns:
-
- *****************************************************************************
- */
- typedef OSStatus (*BSPartitioningPISetEntry)(BSStorePtr store, ItemCount partitionNum, BSPartitionDescriptor *partitionInfo);
- struct BSStorePartitioningOps {
- BlockStoragePlugInInfo header;
- BSPartitioningPIExamine Examine;
- BSPartitioningPIInit Init;
- BSPartitioningPICleanup Cleanup;
- BSPartitioningPIInitializeMap InitializeMap;
- BSPartitioningPIGetInfo GetInfo;
- BSPartitioningPIGetEntry GetEntry;
- BSPartitioningPISetEntry SetEntry;
- };
- typedef struct BSStorePartitioningOps BSStorePartitioningOps;
-
- typedef BSStorePartitioningOps *BSStorePartitioningOpsPtr;
- /*
- ******************************************************************************
- *******************************************************************************
-
- Container Plug-In Interface
-
- *******************************************************************************
- *****************************************************************************
- */
- /*
- ******************************************************************************
-
- BSContainerPIExamine - Called to allow the Container plug-in to verify
- that it is correct for the Container
-
- Inputs: initContainer - the Container in question
-
- Outputs: levelOfConfidence - how confident the plug-in is that it is the
- correct one
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSContainerPIExamine)(BSContainerPtr initContainer, BSCPIConfidenceLevel *levelOfConfidence);
- /*
- ******************************************************************************
-
- BSContainerPIInit - Plug-in's initialization routine. Called when
- plug-in is selected for a Container. Plug-in's opportunity to
- initialize device, allocate data structures, etc.
-
- Inputs: initContainer - a pointer to the Container this plug-in will
- be attached to
- Outputs: info - information about the new Container
- backgroundTask - if true, the BackgroundTask entry point will
- be invoked in its own private task.
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSContainerPIInit)(BSContainerPtr initContainer, BSContainerPIInfo *info, Boolean *backgroundTask);
- /*
- ******************************************************************************
-
- BSContainerPICleanup - cleans up plug-in state
-
- Inputs: container - the Container to clean up for
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSContainerPICleanup)(BSContainerPtr container);
- /*
- ******************************************************************************
-
- BSContainerPIGoToState - Tells the Container to go the specified state
-
- Inputs: container - the Container to take to the state
- accessState - the state to go to
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSContainerPIGoToState)(BSContainerPtr container, UInt32 accessState);
- /*
- ******************************************************************************
-
- BSContainerPIAddContainer - Informs the Container of a new sub-Container
- being added
-
- Inputs: destContainer - the Container we're adding to
- addedContainer - the Container being added
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSContainerPIAddContainer)(BSContainerPtr destContainer, BSContainerPtr addedContainer);
- /*
- ******************************************************************************
-
- BSContainerPIGetInfo - Gets information about a Container
-
- Inputs: infoContainer - the Container to get information about
-
- Outputs: info - the filled in information buffer
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSContainerPIGetInfo)(BSContainerPtr infoContainer, BSContainerPIInfo *info);
- /*
- ******************************************************************************
-
- BSContainerPIBackgroundTask - an optional entry point that will be executed
- within its own task context if the backgroundTask flag is set on exit
- from the Container Plug-in's init routine
-
- Inputs: container - the Container the Background Task is being invoked
- on behalf of
-
- Outputs: <none>
-
- Returns: E_BSSuccessful if successful
-
- *****************************************************************************
- */
- typedef OSStatus (*BSContainerPIBackgroundTask)(BSContainerPtr container);
- struct BSContainerPolicyOps {
- BlockStoragePlugInInfo header;
- BSContainerPIExamine Examine;
- BSContainerPIInit Init;
- BSContainerPICleanup Cleanup;
- BSContainerPIGoToState GoToState;
- BSContainerPIAddContainer AddContainer;
- BSContainerPIGetInfo GetInfo;
- BSContainerPIBackgroundTask BackgroundTask;
- };
- typedef struct BSContainerPolicyOps BSContainerPolicyOps;
-
- typedef BSContainerPolicyOps *BSContainerPolicyOpsPtr;
- /*
- ******************************************************************************
-
- BSCPIBackgroundTask - a background task entry point for a Container plug-in.
- BSCPIStartBackgroundTask may be used by the Container plug-in to
- start one of these. The task will be automatically terminated
- after the Cleanup routine is executed
-
- Inputs: theContainer - the Container this is running for
- theArg - the argument passed to BSMPIStartBackgroundTask
-
- Outputs: <none>
-
- Returns: Errors are ignored but will be logged.
- *****************************************************************************
- */
- typedef OSStatus (*BSCPIBackgroundTask)(BSContainerPtr theContainer, void *theArg);
- /*
- ******************************************************************************
- *******************************************************************************
- *******************************************************************************
-
- Block Storage Family Services
-
- *******************************************************************************
- *******************************************************************************
- *****************************************************************************
- */
- /*
- ******************************************************************************
- BSStoreRW - Request I/O from another Store. Used by Mapping Plug-ins.
- Not for use by Partitioning Plug-ins!!
-
- Inputs: rwStore - the Store to do I/O with
- blocks - the blocks for the transfer
- memory - the memory for the transfer
- parentRequest - the BSIORequestPtr that the requestor was called
- with
- privateData - pointer to be given to the completion routine
- when it is called
- options - read/write
-
- Outputs: errors - where errors occurred, if any occurred
-
- Returns: return code from other plug-in
-
- *****************************************************************************
- */
- extern BSIOStatus BSStoreRW(BSStorePtr rwStore, BSBlockListDescriptorRef blocks, MemListDescriptorRef memory, BSIORequestBlockPtr parentRequest, void *privateData, OptionBits options, BSErrorListPtr *errors);
-
- /*
- ******************************************************************************
- BSStoreFlush - Request another Store to flush its caches. Used by Mapping Plug-ins.
- Not for use by Partitioning Plug-ins!!
-
- Inputs: flushStore - the Store to flush
- parentRequest - the BSIORequestPtr that the requestor was called
- with
- privateData - pointer to be given to the completion routine
- when it is called
-
- Outputs: errors - where errors occurred, if any occurred
-
- Returns: return code from other plug-in
-
- *****************************************************************************
- */
- extern BSIOStatus BSStoreFlush(BSStorePtr flushStore, BSIORequestBlockPtr parentRequest, void *privateData, BSErrorListPtr *errors);
-
- /*
- ******************************************************************************
- BSTrackOtherFamilyRequest - informs the Block Storage family code what routine
- should be called when the other I/O family the request is being passed to
- notifies the Block Storage family of its completion. The Mapping plug-in's
- ioCompletion routine will be called when the notification of the request
- completion is received.
-
- Inputs: ioStore - Store I/O is taking place in
- curRequest - BSIORequestBlock for which this I/O is taking place.
- This was the BSIORequestBlockPtr passed into the R/W
- routine.
- privateData - Private data to be passed back when the completion routine
- is called.
- retNotify - Pointer to a kernel notification structure that will
- be filled in by BSTrackOtherFamilyRequest to be given
- to the other family in the async API call
-
- Outputs: <none>
-
- Returns: E_BSSuccess if able to track request
-
- *****************************************************************************
- */
- extern OSStatus BSTrackOtherFamilyRequest(BSStorePtr ioStore, BSIORequestBlockPtr curRequest, void *privateData, KernelNotificationPtr retNotify);
-
- /*
- ******************************************************************************
- BSMPIStartBackgroundTask - starts a background task for a Mapping Plug-in.
- The task will be terminated after the Cleanup routines for the Plug-in
- is called for this Store.
-
- Inputs: store - the Store the background task is being started for
- backgroundTask - the function to start
- arg - the argument to be passed to the function
-
- Outputs: taskID - the task ID of the new task
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSMPIStartBackgroundTask(BSStorePtr store, BSMPIBackgroundTask backgroundTask, void *arg, TaskID *taskID);
-
- /*
- ******************************************************************************
- BSCPIStartBackgroundTask - starts a background task for a Container Plug-in.
- The task will be terminated after the Cleanup routines for the Plug-in
- is called for this Container.
-
- Inputs: container - the Container the background task is being started for
- backgroundTask - the function to start
- arg - the argument to be passed to the function
-
- Outputs: taskID - the task ID of the new task
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSCPIStartBackgroundTask(BSContainerPtr container, BSCPIBackgroundTask backgroundTask, void *arg, TaskID *taskID);
-
- /*
- ******************************************************************************
- *******************************************************************************
-
- Store Accessor functions
-
- *******************************************************************************
- *****************************************************************************
- */
- /*
- ******************************************************************************
- BSGetMappingPIPrivateData - retrieves the Mapping Plug-in's private data
- from a Store
-
- Inputs: accessStore - the Store to retrieve the data from
-
- Outputs: <none>
-
- Returns: pointer to data
-
- *****************************************************************************
- */
- extern void *BSGetMappingPIPrivateData(BSStorePtr accessStore);
-
- /*
- ******************************************************************************
- BSSetMappingPIPrivateData - sets the Mapping Plug-in's private data
- for a Store
-
- Inputs: accessStore - the Store to set the data in
- privateData - pointer to the data
-
- Outputs: <none>
-
- Returns: <none>
-
- *****************************************************************************
- */
- extern void BSSetMappingPIPrivateData(BSStorePtr accessStore, void *privateData);
-
- /*
- ******************************************************************************
- BSGetPartitioningPIPrivateData - retrieves the Partitioning Plug-in's private
- data from a Store
-
- Inputs: accessStore - the Store to retrieve the data from
-
- Outputs: <none>
-
- Returns: pointer to data
-
- *****************************************************************************
- */
- extern void *BSGetPartitioningPIPrivateData(BSStorePtr accessStore);
-
- /*
- ******************************************************************************
- BSSetPartitioningPIPrivateData - sets the Partitioning Plug-in's private data
- for a Store
-
- Inputs: accessStore - the Store to set the data in
- privateData - pointer to the data
-
- Outputs: <none>
-
- Returns: <none>
-
- *****************************************************************************
- */
- extern void BSSetPartitioningPIPrivateData(BSStorePtr accessStore, void *privateData);
-
- /*
- ******************************************************************************
- BSStoreGetNumComponents - Gets the number of component Stores or Devices
- that have been put together into this Store
-
- Inputs: accessStore - the Store to get the number of components from
-
- Outputs: <none>
-
- Returns: number of components
-
- *****************************************************************************
- */
- extern ItemCount BSStoreGetNumComponents(BSStorePtr accessStore);
-
- /*
- ******************************************************************************
- BSStoreGetComponents - Gets the information about a particular component
- of a Store
-
- Inputs: accessStore - the Store to get the number of components from
- componentNum - which component to return
-
- Outputs: component - the BSStoreComponent buffer that is filled in
-
- Returns: E_BSSuccess if no problems
-
- *****************************************************************************
- */
- extern OSStatus BSStoreGetComponent(BSStorePtr accessStore, ItemCount componentNum, BSStoreMPIComponentPtr component);
-
- /*
- ******************************************************************************
- BSStoreSetNumPartitions - sets the number of partitions in the Store
-
- Inputs: accessStore - the Store to get the number of components from
- numPartitions - the new partition count
-
- Outputs: <none>
-
- Returns: <none>
-
- *****************************************************************************
- */
- extern void BSStoreSetNumPartitions(BSStorePtr accessStore, ItemCount numPartitions);
-
- /*
- ******************************************************************************
- BSStoreGetPPIConnection - Gets the Store connection for the partitioning
- plug-ins
-
- Inputs: accessStore - the Store to get connection from
-
- Outputs: <none>
-
- Returns: Connection to the Store (kInvalidID if none)
-
- *****************************************************************************
- */
- extern BSStoreConnID BSStoreGetPPIConnection(BSStorePtr accessStore);
-
- /*
- ******************************************************************************
- BSStoreGetAccessibilityState - Gets the current accessibility state of the Store
-
- Inputs: accessStore - the Store to get connection from
-
- Outputs: <none>
-
- Returns: Store's state
-
- *****************************************************************************
- */
- extern BSAccessibilityState BSStoreGetAccessibilityState(BSStorePtr accessStore);
-
- /*
- ******************************************************************************
- BSStoreSetAccessibilityState - Sets the current accessibility state of the Store
-
- Inputs: accessStore - the Store to get connection from
- setState - the state to set the Store to
-
- Outputs: <none>
-
- Returns: <none>
-
- *****************************************************************************
- */
- extern void BSStoreSetAccessibilityState(BSStorePtr accessStore, BSAccessibilityState setState);
-
- /*
- ******************************************************************************
- BSStoreGetMPIInfo - Calls the GetInfo routine of the Mapping plug-in
- attached to the Store
-
- Inputs: accessStore - the Store to get connection from
- info - a pointer to the buffer to put the returned info into
-
- Outputs: <none>
-
- Returns: <none>
-
- *****************************************************************************
- */
- extern OSStatus BSStoreGetMPIInfo(BSStorePtr accessStore, BSStoreMPIInfo *info);
-
- /*
- ******************************************************************************
- BSStoreGetPPIInfo - Calls the GetInfo routine of the Partitioning plug-in
- attached to the Store
-
- Inputs: accessStore - the Store to get connection from
- info - a pointer to the buffer to put the returned info into
-
- Outputs: <none>
-
- Returns: <none>
-
- *****************************************************************************
- */
- extern OSStatus BSStoreGetPPIInfo(BSStorePtr accessStore, BSStorePPIInfo *info);
-
- /*
- ******************************************************************************
-
- BSMPINotifyFamilyStoreChangedState - called from a Mapping Plug-in (typically
- in the BackgroundTask) to inform the Block Storage Family of an
- unexpected accessibility change, e.g. the media was removed or the disk
- spun down.
-
- Inputs: changedStore - the Store that changed
- newState - the state the Store is now in
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSMPINotifyFamilyStoreChangedState(BSStorePtr changedStore, BSAccessibilityState newState);
-
- /*
- ******************************************************************************
-
- BSMPIRequestStoreStateChange - requests a state change of the Store. This
- should be used, for example, if a device has an eject button that can
- be monitored by the Mapping Plug-in. If the eject button is pressed
- BSMPIRequestStoreStateChange should be used to notify the Family that
- an eject has been requested and the Family can then notify clients and
- flush data to the media properly. This call waits until permission is
- granted or denied by the Expert. The GoToState call of the plug-in
- will be invoked before this calls returns if permission is granted.
-
- Inputs: changeStore - the Store the state change will affect
- requestedState - the state the Store is being requested to go to
-
- Outputs: permission - true if permission was granted and the Store
- successfully went to the State requested.
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSMPIRequestStoreStateChange(BSStorePtr changeStore, BSAccessibilityState requestedState, Boolean *permission);
-
- /*
- ******************************************************************************
-
- BSCPINotifyFamilyContainerChangedState - called from a Container Plug-in
- (typically in the BackgroundTask) to inform the Block Storage Family of
- an unexpected accessibility change, e.g. the media was removed.
-
- Inputs: changedStore - the Store that changed
- newState - the state the Store is now in
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSCPINotifyFamilyContainerChangedState(BSContainerPtr changedContainer, BSAccessibilityState newState);
-
- /*
- ******************************************************************************
-
- BSCPIRequestContainerStateChange - requests a state change of the Container.
- This should be used, for example, if a device has an eject button that
- can be monitored by the Container Plug-in. If the eject button is pressed
- BSCPIRequestStoreStateChange should be used to notify the Family that
- an eject has been requested and the Family can then notify clients and
- flush data to the media properly. This call waits until permission is
- granted or denied by the Expert. The GoToState call of the plug-in
- will be invoked before this calls returns if permission is granted.
-
- Inputs: changeContainer - the Container the state change will affect
- requestedState - the state the Container is being requested to go to
-
- Outputs: permission - true if permission was granted and the Container
- successfully went to the State requested.
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSCPIRequestContainerStateChange(BSStorePtr changeContainer, BSAccessibilityState requestedState, Boolean *permission);
-
- #endif
-
- #pragma options align=reset
- #endif /* PRAGMA_ALIGN_SUPPORTED */
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __BLOCKSTORAGEPLUGIN__ */
-
-