summaryrefslogtreecommitdiffstats
path: root/src/H5VLcallback.c
diff options
context:
space:
mode:
authorSongyu Lu <songyulu@hdfgroup.org>2019-04-04 18:16:27 (GMT)
committerSongyu Lu <songyulu@hdfgroup.org>2019-04-04 18:16:27 (GMT)
commit5e7cccb5a2813c203fc9493a2c0d42c9f666d5af (patch)
tree257600fe3193e2f324d8dd8fe193a14e23a186e8 /src/H5VLcallback.c
parent50d9a397ab4bcbeaa6466eabe1c2ec6e2cf61f89 (diff)
parentaa696a47715c3dd9c068f71915c6dcf23745441c (diff)
downloadhdf5-5e7cccb5a2813c203fc9493a2c0d42c9f666d5af.zip
hdf5-5e7cccb5a2813c203fc9493a2c0d42c9f666d5af.tar.gz
hdf5-5e7cccb5a2813c203fc9493a2c0d42c9f666d5af.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~songyulu/hdf5_ray into HDFFV-10658-performance-drop-from-1-8
Diffstat (limited to 'src/H5VLcallback.c')
-rw-r--r--src/H5VLcallback.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c
index 5a5d9ee..03828fa 100644
--- a/src/H5VLcallback.c
+++ b/src/H5VLcallback.c
@@ -355,7 +355,7 @@ H5VL_copy_connector_info(const H5VL_class_t *connector, void **dst_info,
else if(connector->info_cls.size > 0) {
if(NULL == (new_connector_info = H5MM_malloc(connector->info_cls.size)))
HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, FAIL, "connector info allocation failed")
- HDmemcpy(new_connector_info, src_info, connector->info_cls.size);
+ H5MM_memcpy(new_connector_info, src_info, connector->info_cls.size);
} /* end else-if */
else
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "no way to copy connector info")
@@ -506,20 +506,25 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_free_connector_info(const H5VL_class_t *connector, void *info)
+H5VL_free_connector_info(hid_t connector_id, void *info)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_class_t *cls; /* VOL connector's class struct */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- /* Sanity checks */
- HDassert(connector);
+ /* Sanity check */
+ HDassert(connector_id > 0);
+
+ /* Check args and get class pointer */
+ if(NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
+ HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Only free info object, if it's non-NULL */
if(info) {
/* Allow the connector to free info or do it ourselves */
- if(connector->info_cls.free) {
- if((connector->info_cls.free)(info) < 0)
+ if(cls->info_cls.free) {
+ if((cls->info_cls.free)(info) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "connector info free request failed")
} /* end if */
else
@@ -544,18 +549,13 @@ done:
herr_t
H5VLfree_connector_info(hid_t connector_id, void *info)
{
- H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
H5TRACE2("e", "i*x", connector_id, info);
- /* Check args and get class pointer */
- if(NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
-
/* Free the VOL connector info object */
- if(H5VL_free_connector_info(cls, info) < 0)
+ if(H5VL_free_connector_info(connector_id, info) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release VOL connector info object")
done:
@@ -623,24 +623,9 @@ H5VLconnector_str_to_info(const char *str, hid_t connector_id, void **info)
FUNC_ENTER_API_NOINIT
H5TRACE3("e", "*si**x", str, connector_id, info);
- /* Only deserialize string, if it's non-NULL */
- if(str) {
- H5VL_class_t *cls; /* VOL connector's class struct */
-
- /* Check args and get class pointer */
- if(NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
-
- /* Allow the connector to deserialize info */
- if(cls->info_cls.from_str) {
- if((cls->info_cls.from_str)(str, info) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTUNSERIALIZE, FAIL, "can't deserialize connector info")
- } /* end if */
- else
- *info = NULL;
- } /* end if */
- else
- *info = NULL;
+ /* Call internal routine */
+ if(H5VL__connector_str_to_info(str, connector_id, info) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTDECODE, FAIL, "can't deserialize connector info")
done:
FUNC_LEAVE_API_NOINIT(ret_value)