ToiStorageDevice Interface Reference


Description

The ToiStorageDevice interface provides access to a storage device.

import "ToiStorageDevice.idl";

List of all members.

Public Member Functions

ToiStorageDeviceStorageInfo getStorageInfo ()
ToiStorageDevicePartitionInfo getPartitionInfo (in TToiPartitionId partitionId) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
void mountPartition (in ToiOperationManager::TToiOperationId operationId, in TToiPartitionId partitionId, in string mountPoint) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
void unmountPartition (in ToiOperationManager::TToiOperationId operationId, in TToiPartitionId partitionId) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
void reformat (in ToiOperationManager::TToiOperationId operationId) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException, TToiOperationNotSupportedException)
void scheduleReformatOnNextReboot (in TToiPartitionId partitionId) raises (TToiOperationNotSupportedException, TToiInvalidArgumentException)
void scheduleFileSystemRepairOnNextReboot (in TToiPartitionId partitionId) raises (TToiOperationNotSupportedException, TToiInvalidArgumentException)
void spinDown () raises (TToiInvalidPreconditionException)
void spinUp () raises (TToiInvalidPreconditionException)

Public Attributes

TToiFileSystemStatus

const TToiFileSystemStatus FS_STATUS_OK = 0
const TToiFileSystemStatus FS_STATUS_ERRORS_CORRECTED = 1
const TToiFileSystemStatus FS_STATUS_ERRORS_LEFT_UNCORRECTED = 2
const TToiFileSystemStatus FS_STATUS_MAJOR_FAILURE = 3

Public Types

typedef unsigned long TToiStorageDeviceId
typedef unsigned long TToiPartitionId
typedef sequence< TToiPartitionIdTToiPartitionIdSequence
typedef long TToiFileSystemStatus
typedef TToiFileSystemStatus TFileSystemStatus

Member Typedef Documentation

Typedef for backward compatibility when corrected naming typo of previous enum TFileSystemStatus.

The different kind of file system status values.

typedef unsigned long ToiStorageDevice::TToiPartitionId

Type for partition identifier.

The sequence of partition identifiers.

Type for storage identifier.


Member Function Documentation

ToiStorageDevicePartitionInfo ToiStorageDevice::getPartitionInfo ( in TToiPartitionId  partitionId  )  raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)

Returns partition info for a partition.

Parameters:
partitionId Partition identifier.
Return values:
info The partition info.
Exceptions:
TToiInvalidArgumentException Raised if the partitionId is wrong.
TToiInvalidPreconditionException Raised if the storage is disconnected.
ToiStorageDeviceStorageInfo ToiStorageDevice::getStorageInfo (  ) 

Returns storage info for this device.

Return values:
info The storage info.
void ToiStorageDevice::mountPartition ( in ToiOperationManager::TToiOperationId  operationId,
in TToiPartitionId  partitionId,
in string  mountPoint 
) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)

Mounts a partition at a specified path.

Parameters:
operationId Operation identifier for this operation.
partitionId Partition identifier.
mountPoint Mount point path.
Exceptions:
TToiInvalidArgumentException Raised if the operationId or partitionId is wrong.
TToiInvalidPreconditionException Raised if the partition is already mounted or the storage is disconnected.

Reformat a device. This operation is only supported for external storage devices.

Parameters:
operationId Operation identifier for this operation.
Exceptions:
TToiInvalidArgumentException Raised if the operationId is wrong.
TToiInvalidPreconditionException Raised if the storage is disconnected.
TToiOperationNotSupportedException Raised if the operation is not supported on this device.
void ToiStorageDevice::scheduleFileSystemRepairOnNextReboot ( in TToiPartitionId  partitionId  )  raises (TToiOperationNotSupportedException, TToiInvalidArgumentException)

Schedule a forced file system check of a partition and repair it at next reboot. This operation is only supported for internal storage devices.

Parameters:
partitionId The partition to be checked and repaired.
Exceptions:
TToiInvalidArgumentException Raised if the partition does not exist.
TToiOperationNotSupportedException Raised if the operation is not supported on this device.
void ToiStorageDevice::scheduleReformatOnNextReboot ( in TToiPartitionId  partitionId  )  raises (TToiOperationNotSupportedException, TToiInvalidArgumentException)

Schedule a reformat of a partition at next reboot. This operation is only supported for internal storage devices.

Parameters:
partitionId The partition to format.
Exceptions:
TToiInvalidArgumentException Raised if the partition does not exist.
TToiOperationNotSupportedException Raised if the operation is not supported on this device.
void ToiStorageDevice::spinDown (  )  raises (TToiInvalidPreconditionException)

Requests a spin down of a disk device. The platform may decide not to do this if the disk is used by platform.

Exceptions:
TToiInvalidPreconditionException Raised if the storage is disconnected, already in spindown mode or if the device is not approved.
void ToiStorageDevice::spinUp (  )  raises (TToiInvalidPreconditionException)

Spins up a disk device.

Exceptions:
TToiInvalidPreconditionException Raised if the storage is disconnected, already in spinup mode or if the device is not approved.
void ToiStorageDevice::unmountPartition ( in ToiOperationManager::TToiOperationId  operationId,
in TToiPartitionId  partitionId 
) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)

Unmounts a partition.

Parameters:
operationId Operation identifier for this operation.
partitionId Partition identifier.
Exceptions:
TToiInvalidArgumentException Raised if the operationId or partitionId is wrong.
TToiInvalidPreconditionException Raised if the partition has not been mounted or the storage is disconnected.

Member Data Documentation

The file system had errors but they have been corrected (jfs_fsck return code 1 or 2).

This constant can also be accessed from toi.consts.ToiStorageDevice.FS_STATUS_ERRORS_CORRECTED.

The file system had errors that could not be corrected (jfs_fsck return code 4). A reformat is required to get the file system working.

This constant can also be accessed from toi.consts.ToiStorageDevice.FS_STATUS_ERRORS_LEFT_UNCORRECTED.

The file system is completely broken (all other return codes from jfs_fsck). Could also be that the partition has another file system than jfs. If the internal storage device has this status is should be reformated to get it working.

This constant can also be accessed from toi.consts.ToiStorageDevice.FS_STATUS_MAJOR_FAILURE.

No errors discovered on the file system (jfs_fsck return code 0).

This constant can also be accessed from toi.consts.ToiStorageDevice.FS_STATUS_OK.