When processing a request described with a PVFS_Request the following structures are used to keep track of how much of the request has been processed.
typedef struct PINT_reqstack { int32_t el; /* number of element being processed */ int32_t maxel; /* total number of these elements to process */ PINT_Request *rq; /* pointer to request structure */ PINT_Request *rqbase; /* pointer to first request is sequence chain */ int32_t blk; /* number of block being processed */ PVFS_offset chunk_offset; /* offset of beginning of current contiguous chunk */ } PINT_reqstack; typedef struct PINT_Request_state { struct PINT_reqstack *cur; /* request element chain stack */ int32_t lvl; /* level in element chain */ PVFS_size bytes; /* bytes in current contiguous chunk processed */ PVFS_offset buf_offset; /* byte offset in user buffer */ } PINT_Request_state;
The PINT_Request_state utilizes a stack to keep up with each level in the element type chain. For each level, a stack element records which block and which element within the block is being processed as well as which PVFS_Request record in the sequence chain is being processed. The maxel and dtbase fields are used to reset each level each time it is entered. The PINT_Request_state records the level being processed and a function used to process each contiguous block of data. The bytes field is used to record the results of a partial processing of bytes so the processing can be paused and resumed later.