mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
Updated based on reviews and refactored test code
This commit is contained in:
parent
a633e33334
commit
b679d11bcc
@ -1167,7 +1167,7 @@ herr_t
|
||||
H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *offset, unsigned *filter_mask, haddr_t *addr, hsize_t *size)
|
||||
{
|
||||
H5VL_object_t *vol_obj = NULL; /* Dataset for this operation */
|
||||
hsize_t nchunks= 0;
|
||||
hsize_t nchunks = 0;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
@ -1186,7 +1186,7 @@ H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *of
|
||||
|
||||
/* Check range for chunk index */
|
||||
if(chk_index >= nchunks)
|
||||
HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "chunk index is out of range")
|
||||
HGOTO_ERROR(H5E_IO, H5E_DATASET, FAIL, "chunk index is out of range")
|
||||
|
||||
/* Call private function to get the chunk info given the chunk's index */
|
||||
if(H5VL_dataset_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX, fspace_id, chk_index, offset, filter_mask, addr, size) < 0)
|
||||
|
@ -7124,8 +7124,8 @@ H5D__get_chunk_info_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
|
||||
* Purpose: Iterate over the chunks in the dataset to get the info
|
||||
* of the desired chunk.
|
||||
*
|
||||
* Note: Currently, this function only gets the number of all written
|
||||
* chunks, regardless the dataspace.
|
||||
* Note: Currently, the domain of the index in this function is of all
|
||||
* the written chunks, regardless the dataspace.
|
||||
*
|
||||
* Return: Success: SUCCEED
|
||||
* Failure: FAIL
|
||||
@ -7293,7 +7293,6 @@ H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *offset, unsigned*
|
||||
HDassert(rdcc);
|
||||
HDassert(H5D_CHUNKED == layout->type);
|
||||
|
||||
/* Is this expensive? */
|
||||
/* Search for cached chunks that haven't been written out */
|
||||
for(ent = rdcc->head; ent; ent = ent->next)
|
||||
/* Flush the chunk out to disk, to make certain the size is correct later */
|
||||
|
@ -509,15 +509,12 @@ H5VL__native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id,
|
||||
dset = (H5D_t *)obj;
|
||||
HDassert(dset);
|
||||
HDassert(dset->shared);
|
||||
HDassert(dset->shared->space);
|
||||
|
||||
/* When default dataspace is given, use the dataset's dataspace */
|
||||
if(space_id == H5S_ALL)
|
||||
{
|
||||
space = dset->shared->space;
|
||||
if(NULL == space)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to obtain a dataspace")
|
||||
} /* otherwise, use the given space ID */
|
||||
else
|
||||
else /* otherwise, use the given space ID */
|
||||
if(NULL == (space = (const H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid dataspace ID")
|
||||
|
||||
|
1628
test/chunk_info.c
1628
test/chunk_info.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user