gpfsSetReplication_t structure

Sets the replication factors of a file.

Library

GPFS Library (libgpfs.a for AIX®, libgpfs.so for Linux®)

Structure

typedef struct {
	int structLen;
	int structType;
	int metadataReplicas;
	int maxMetadataReplicas;
	int dataReplicas;
	int maxDataReplicas;
	int errReason;
	int errValue1;
	int errValue2;
	int reserved;
} gpfsSetReplication_t;

Description

The gpfsGetReplication_t structure is used to set a file's replication factors. However, the directive does not cause the file to be restriped immediately. Instead, the caller must append a gpfsRestripeData_t directive or invoke an explicit restripe using the mmrestripefs or mmrestripefile command.

Members

structLen
Length of the gpfsSetReplication_t structure.
structType
Structure identifier GPFS_FCNTL_SET_REPLICATION.
metadataReplicas
Specifies how many copies of the file system's metadata to create. Enter a value of 1 or 2, but not greater than the value of the maxMetadataReplicas attribute of the file. A value of 0 indicates not to change the current value.
maxMetadataReplicas
The maximum number of copies of indirect blocks for a file. Space is reserved in the inode for all possible copies of pointers to indirect blocks. Valid values are 1 and 2, but cannot be less than DefaultMetadataReplicas. The default is 1. A value of 0 indicates not to change the current value.
dataReplicas
Specifies how many copies of the file data to create. Enter a value of 1 or 2, but not greater than the value of the maxDataReplicas attribute of the file. A value of 0 indicates not to change the current value.
maxDataReplicas
The maximum number of copies of data blocks for a file. Space is reserved in the inode and indirect blocks for all possible copies of pointers to data blocks. Valid values are 1 and 2, but cannot be less than DefaultDataReplicas. The default is 1. A value of 0 indicates not to change the current value.
errReason
Reason code describing the failure. Possible codes are defined in Error status.
errValue1
Returned value depending upon errReason.
errValue2
Returned value depending upon errReason.
reserved
Unused, but should be set to 0.

Error status

These values are returned in the errReason field:
GPFS_FCNTL_ERR_NONE
Command was successful or no reason information was returned.
GPFS_FCNTL_ERR_METADATA_REPLICAS_RANGE
Field metadataReplicas is out of range. Fields errValue1 and errValue2 contain the valid lower and upper range boundaries.
GPFS_FCNTL_ERR_MAXMETADATA_REPLICAS_RANGE
Field maxMetadataReplicas is out of range. Fields errValue1 and errValue2 contain the valid lower and upper range boundaries.
GPFS_FCNTL_ERR_DATA_REPLICAS_RANGE
Field dataReplicas is out of range. Fields errValue1 and errValue2 contain the valid lower and upper range boundaries.
GPFS_FCNTL_ERR_MAXDATA_REPLICAS_RANGE
Field maxDataReplicas is out of range. Fields errValue1 and errValue2 contain the valid lower and upper range boundaries.
GPFS_FCNTL_ERR_FILE_NOT_EMPTY
An attempt to change maxMetadataReplicas or maxDataReplicas or both was made on a file that is not empty.
GPFS_FCNTL_ERR_REPLICAS_EXCEED_FGMAX
Field metadataReplicas, or dataReplicas, or both exceed the number of failure groups. Field errValue1 contains the maximum number of metadata failure groups. Field errValue2 contains the maximum number of data failure groups.

Location

/usr/lpp/mmfs/lib/libgpfs.a for AIX

/usr/lpp/mmfs/lib/libgpfs.so for Linux