diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FF.c | 12 | ||||
-rw-r--r-- | src/H5FFpublic.h | 8 | ||||
-rw-r--r-- | src/H5VLdaosm.c | 42 |
3 files changed, 34 insertions, 28 deletions
@@ -570,12 +570,12 @@ H5Dwrite_ff(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") if(H5P_set(plist, H5VL_TRANS_ID, &trans_id) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for trans_id") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set property value for trans_id") /* Write the data through the VOL */ if((ret_value = H5VL_dataset_write(dset->vol_obj, dset->vol_info->vol_cls, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, H5_REQUEST_NULL)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data")= + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") done: FUNC_LEAVE_API(ret_value) @@ -597,7 +597,7 @@ done: */ herr_t H5Dread_ff(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t dxpl_id, void *buf, hid_t rcxt_id) + hid_t file_space_id, hid_t dxpl_id, void *buf, hid_t trans_id) { H5VL_object_t *dset = NULL; H5P_genplist_t *plist; /* Property list pointer */ @@ -605,7 +605,7 @@ H5Dread_ff(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, FUNC_ENTER_API(FAIL) H5TRACE7("e", "iiiii*xi", dset_id, mem_type_id, mem_space_id, file_space_id, - dxpl_id, buf, rcxt_id); + dxpl_id, buf, trans_id); if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") @@ -622,8 +622,8 @@ H5Dread_ff(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* store the transaction ID in the dxpl */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_set(plist, H5VL_CONTEXT_ID, &rcxt_id) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for rcxt_id") + if(H5P_set(plist, H5VL_TRANS_ID, &trans_id) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set property value for trans_id") /* Read the data through the VOL */ if((ret_value = H5VL_dataset_read(dset->vol_obj, dset->vol_info->vol_cls, mem_type_id, mem_space_id, diff --git a/src/H5FFpublic.h b/src/H5FFpublic.h index 4ccdb01..1208f62 100644 --- a/src/H5FFpublic.h +++ b/src/H5FFpublic.h @@ -50,15 +50,19 @@ extern "C" { /* API wrappers */ H5_DLL hid_t H5Fcreate_ff(const char *filename, unsigned flags, hid_t fcpl_id, - hid_t fapl_id, hid_t *trans_id); + hid_t fapl_id, hid_t *trans_id/*out*/); H5_DLL hid_t H5Fopen_ff(const char *filename, unsigned flags, hid_t fapl_id, - hid_t *trans_id); + hid_t *trans_id/*out*/); H5_DLL herr_t H5Fclose_ff(hid_t file_id, hid_t trans_id); H5_DLL hid_t H5Dcreate_ff(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id, hid_t trans_id); H5_DLL hid_t H5Dopen_ff(hid_t loc_id, const char *name, hid_t dapl_id, hid_t trans_id); +H5_DLL herr_t H5Dwrite_ff(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, + hid_t file_space_id, hid_t dxpl_id, const void *buf, hid_t trans_id); +H5_DLL herr_t H5Dread_ff(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, + hid_t file_space_id, hid_t dxpl_id, void *buf/*out*/, hid_t trans_id); H5_DLL herr_t H5Dclose_ff(hid_t dset_id, hid_t trans_id); #endif /* H5_HAVE_EFF */ diff --git a/src/H5VLdaosm.c b/src/H5VLdaosm.c index 4f53a5b..b32ce92 100644 --- a/src/H5VLdaosm.c +++ b/src/H5VLdaosm.c @@ -1588,7 +1588,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5VL_daos_dataset_read + * Function: H5VL_daosm_dataset_read * * Purpose: Reads raw data from a dataset into a buffer. * @@ -1601,7 +1601,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_iod_dataset_read(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_ATTR_UNUSED mem_space_id, +H5VL_daosm_dataset_read(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_ATTR_UNUSED mem_space_id, hid_t H5_ATTR_UNUSED file_space_id, hid_t dxpl_id, void *buf, void H5_ATTR_UNUSED **req) { @@ -1622,20 +1622,21 @@ H5VL_iod_dataset_read(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_AT size_t type_size; uint64_t chunk_size; uint8_t *p; + int ret; int i; - void *ret_value = NULL; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT /* get the transaction ID */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID"); + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(H5P_get(plist, H5VL_TRANS_ID, &trans_id) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get property value for trans_id"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for trans_id"); /* get the TR object */ if(NULL == (tr = (H5TR_t *)H5I_object_verify(trans_id, H5I_TR))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a Transaction ID") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a Transaction ID") /* Get dataspace extent */ if((ndims = H5Sget_simple_extent_ndims(dset->space_id)) < 0) @@ -1657,13 +1658,13 @@ H5VL_iod_dataset_read(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_AT * starting at 0. */ HDmemset(chunk_coords, 0, sizeof(chunk_coords)); //DSMINC p = dkey_buf; - *p++ == (uint8_t)'/'; + *p++ = (uint8_t)'/'; for(i = 0; i < ndims; i++) UINT64ENCODE(p, chunk_coords[i]) /* Set up operation to write data */ /* Set up dkey */ - daos_iov_set(&dkey, dkey_buf, (daos_size_t)(1 + (ndims * sizeof(chunk_coords[0])))); + daos_iov_set(&dkey, dkey_buf, (daos_size_t)(1 + ((size_t)ndims * sizeof(chunk_coords[0])))); /* Set up recx */ recx.rx_rsize = (uint64_t)type_size; @@ -1684,15 +1685,15 @@ H5VL_iod_dataset_read(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_AT /* Write data to dataset */ if(0 != (ret = daos_obj_fetch(dset->obj_oh, tr->epoch, &dkey, 1, &iod, &sgl, NULL /*maps*/, NULL /*event*/))) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, NULL, "can't read data from dataset: %d", ret) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data from dataset: %d", ret) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_iod_dataset_read() */ +} /* end H5VL_daosm_dataset_read() */ /*------------------------------------------------------------------------- - * Function: H5VL_daos_dataset_write + * Function: H5VL_daosm_dataset_write * * Purpose: Writes raw data from a buffer into a dataset. * @@ -1705,7 +1706,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_iod_dataset_write(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_ATTR_UNUSED mem_space_id, +H5VL_daosm_dataset_write(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_ATTR_UNUSED mem_space_id, hid_t H5_ATTR_UNUSED file_space_id, hid_t dxpl_id, const void *buf, void H5_ATTR_UNUSED **req) { @@ -1726,20 +1727,21 @@ H5VL_iod_dataset_write(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_A size_t type_size; uint64_t chunk_size; uint8_t *p; + int ret; int i; - void *ret_value = NULL; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT /* get the transaction ID */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID"); + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(H5P_get(plist, H5VL_TRANS_ID, &trans_id) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get property value for trans_id"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for trans_id"); /* get the TR object */ if(NULL == (tr = (H5TR_t *)H5I_object_verify(trans_id, H5I_TR))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a Transaction ID") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a Transaction ID") /* Get dataspace extent */ if((ndims = H5Sget_simple_extent_ndims(dset->space_id)) < 0) @@ -1761,13 +1763,13 @@ H5VL_iod_dataset_write(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_A * starting at 0. */ HDmemset(chunk_coords, 0, sizeof(chunk_coords)); //DSMINC p = dkey_buf; - *p++ == (uint8_t)'/'; + *p++ = (uint8_t)'/'; for(i = 0; i < ndims; i++) UINT64ENCODE(p, chunk_coords[i]) /* Set up operation to write data */ /* Set up dkey */ - daos_iov_set(&dkey, dkey_buf, (daos_size_t)(1 + (ndims * sizeof(chunk_coords[0])))); + daos_iov_set(&dkey, dkey_buf, (daos_size_t)(1 + ((size_t)ndims * sizeof(chunk_coords[0])))); /* Set up recx */ recx.rx_rsize = (uint64_t)type_size; @@ -1788,11 +1790,11 @@ H5VL_iod_dataset_write(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5_A /* Write data to dataset */ if(0 != (ret = daos_obj_update(dset->obj_oh, tr->epoch, &dkey, 1, &iod, &sgl, NULL /*event*/))) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, NULL, "can't write data to dataset: %d", ret) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data to dataset: %d", ret) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_iod_dataset_write() */ +} /* end H5VL_daosm_dataset_write() */ /*------------------------------------------------------------------------- |