gpfsGetDataBlkDiskIdx_t structure
Obtains the FPO data block location of a file.
Library
GPFS Library (libgpfs.a for AIX®, libgpfs.so for Linux®)
Structure
typedef struct {
int structLen;
int structType;
FilemapIn filemapIn;
FilemapOut filemapOut;
} gpfsGetDataBlkDiskIdx_t;
Description
The gpfsGetDataBlkDiskIdx_t structure is used to obtain a file's blocks on-disk or in-memory location information.
Members
- structLen
- Length of the gpfsGetDataBlkDiskIdx_t structure.
- structType
- The structure identifiers are GPFS_FCNTL_GET_DATABLKDISKIDX and GPFS_FCNTL_GET_DATABLKLOC. GPFS_FCNTL_GET_DATABLKDISKIDX can be used to retrieve the disk ID on which the data blocks are located. GPFS_FCNTL_GET_DATABLKLOC can be used to retrieve the disk ID on which the data blocks are located and the node ID on which data block buffers (in memory) are located.
- filemapIn
- Input
parameters:
struct FilemapIn { long long startOffset; long long skipfactor; long long length; int mreplicas; int reserved; } FilemapIn; - startOffset
- Start offset in bytes.
- skipfactor
- Number of bytes to skip before the next offset read. Could be 0 in which case the meta block size will be used as the skipfactor.
- length
- Number of bytes to read; startOffset + length / skipfactor = numBlksReturned
- mreplicas
- Number of replicas that the user wants.
0 - all; 1 - primary; 2 - primary and 1st replica; 3 - primary, 1st and 2nd replica
- reserved
- Reserved field that should not be used.
- filemapOut
- Output
data:
struct FilemapOut { int numReplicasReturned; int numBlksReturned; int blockSize; int blockSizeHigh; char buffer [GPFS_MAX_FCNTL_LENGTH-1024]; } FilemapOut; - numReplicasReturned
- Number of replicas returned.
- numBlksReturned
- Number of data blocks returned.
- blockSize
- Low 32bits of meta block size. Only valid if skipfactor in the input is 0. Otherwise, blockSize will be 0.
- blockSizeHigh
- High 32bits of meta block size. Only valid if structType is GPFS_FCNTL_GET_DATABLKLOC and skipfactor in the input is 0. Otherwise, blockSizeHigh will be 0.
- buffer [GPFS_MAX_FCNTL_LENGTH-1024]
- Buffer in which the disk ID and node ID are stored. If the buffer cannot store all of the requested information, you will have to calculate a new startOffset and length in the input data according to the output data and then repeat the call.
If structType is GPFS_FCNTL_GET_DATABLKDISKIDX, the format is:
If number of replicas returned is 1,
offset(64bits) disid1(32bits)
offset(64bits) diskid1(32bits)
...
If number of replicas returned is 2,
offset(64bits) diskid1(32bits) diskid2(32bits)
offset(64bits) diskid1(32bits) diskid2(32bits)
...
If number of replicas returned is 3,
offset(64bits) diskid1(32bits) diskid2(32bits) diskid3(32bits)
offset(64bits) diskid1(32bits) diskid2(32bits) diskid3(32bits)
...
If structType is GPFS_FCNTL_GET_DATABLKLOC, the format is:
If number of replicas returned is 1,
disid1(32bits) nodeid1(32bits)
disid1(32bits) nodeid1(32bits)
...
If number of replicas returned is 2,
disid1(32bits) diskid2(32bits) nodeid1(32bits) nodeid2(32bits)
disid1(32bits) diskid2(32bits) nodeid1(32bits) nodeid2(32bits)
...
If number of replicas returned is 3,
disid1(32bits) diskid2(32bits) diskid3(32bits) nodeid1(32bits) nodeid2(32bits)
nodeid3(32bits)
disid1(32bits) diskid2(32bits) diskid3(32bits) nodeid1(32bits) nodeid2(32bits)
nodeid3(32bits)
...
Location
/usr/lpp/mmfs/lib/libgpfs.a for AIX
/usr/lpp/mmfs/lib/libgpfs.so for Linux