From e582da571d5ac665351768c9c4ae5fb3f863c9cc Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 9 Jul 2012 17:20:16 -0500 Subject: [svn-r22532] fix more named datatype issues. move the dataset ID registration to H5Dint where the term_interface func is located --- src/H5Aint.c | 2 +- src/H5D.c | 6 ++- src/H5Dint.c | 10 ++++- src/H5F.c | 7 ++-- src/H5Fint.c | 13 +++--- src/H5Gloc.c | 18 ++++++--- src/H5I.c | 44 +++++++++------------ src/H5T.c | 10 +---- src/H5Tcommit.c | 27 ++++++++----- src/H5Tdeprec.c | 118 ++++++++++++++++++++++++++++--------------------------- src/H5Toh.c | 2 +- src/H5Torder.c | 2 + src/H5Tprecis.c | 4 +- src/H5Tprivate.h | 2 +- src/H5VLnative.c | 2 +- 15 files changed, 143 insertions(+), 124 deletions(-) diff --git a/src/H5Aint.c b/src/H5Aint.c index cfe81dc..8d86931 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -779,7 +779,7 @@ H5A_get_type(H5A_t *attr) two level IDs, where the VOL object is a copy of the returned datatype */ /* Copy the dataset's datatype */ - if(NULL == (type = H5T_copy(dt, H5T_COPY_REOPEN))) + if(NULL == (type = H5T_copy(dt, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy datatype") H5T_set_vol_object(type, (void *)dt); diff --git a/src/H5D.c b/src/H5D.c index 7be906b..270befc 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -86,6 +86,10 @@ DESCRIPTION static herr_t H5D__init_pub_interface(void) { + FUNC_ENTER_STATIC_NOERR + + FUNC_LEAVE_NOAPI(H5D_init()) +#if 0 herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -97,6 +101,7 @@ H5D__init_pub_interface(void) ret_value = H5D_init(); done: FUNC_LEAVE_NOAPI(ret_value) +#endif } /* H5D__init_pub_interface() */ @@ -197,7 +202,6 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, /* Get an atom for the dataset */ if((ret_value = H5I_register2(H5I_DATASET, dset, vol_plugin, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") - vol_plugin->nrefs ++; done: diff --git a/src/H5Dint.c b/src/H5Dint.c index 285ee9f..59a2015 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -162,6 +162,11 @@ H5D__init_interface(void) FUNC_ENTER_STATIC + /* Initialize the atom group for the dataset IDs */ + if(H5I_register_type2(H5I_DATASET, (size_t)H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, + NULL, (H5I_free2_t)H5D_close_dataset)oloc = H5T_oloc((H5T_t *)obj))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of datatype") - if(NULL == (loc->path = H5T_nameof((H5T_t *)obj))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of datatype") - break; + { + H5T_t *dt = NULL; + + /* Get the actual datatype object if the VOL object is set */ + if(NULL == (dt = (H5T_t *)H5T_get_named_type((const H5T_t *)obj))) + dt = (H5T_t *) obj; + + if(NULL == (loc->oloc = H5T_oloc(dt))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of datatype") + if(NULL == (loc->path = H5T_nameof(dt))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path of datatype") + break; + } case H5I_DATASET: if(NULL == (loc->oloc = H5D_oloc((H5D_t *)obj))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of dataset") diff --git a/src/H5I.c b/src/H5I.c index bf01a4f..97ba5fe 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -578,6 +578,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) for(cur = type_ptr->id_list[i]; cur; cur = next) { hbool_t delete_node; /* Flag to indicate node should be removed from linked list */ + herr_t result1 = SUCCEED, result2 = SUCCEED; /* * Do nothing to the object if the reference count is larger than @@ -590,9 +591,11 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) /* Check for a 'free' function and call it, if it exists */ /* (Casting away const OK -QAK) */ - if((cur->aux_ptr && type_ptr->free_aux && (type_ptr->free_aux)((void *)cur->obj_ptr, (void *)cur->aux_ptr) < 0) || - (type_ptr->free_func && (type_ptr->free_func)((void *)cur->obj_ptr) < 0)) { - //if(type_ptr->free_func && (type_ptr->free_func)((void *)cur->obj_ptr) < 0) { + if(cur->aux_ptr && type_ptr->free_aux) + result1 = (type_ptr->free_aux)((void *)cur->obj_ptr, (void *)cur->aux_ptr); + if(type_ptr->free_func) + result2 = (type_ptr->free_func)((void *)cur->obj_ptr); + if(result1 < 0 || result2 < 0) { if(force) { #ifdef H5I_DEBUG if(H5DEBUG(I)) { @@ -1344,7 +1347,8 @@ H5I_dec_ref(hid_t id) */ if(1 == id_ptr->count) { /* (Casting away const OK -QAK) */ - if((!id_ptr->aux_ptr || !type_ptr->free_aux || (type_ptr->free_aux)((void *)id_ptr->obj_ptr, (void *)id_ptr->aux_ptr) >= 0) && + if((!type_ptr->free_aux || !id_ptr->aux_ptr || + (type_ptr->free_aux)((void *)id_ptr->obj_ptr, (void *)id_ptr->aux_ptr) >= 0) && (!type_ptr->free_func || (type_ptr->free_func)((void *)id_ptr->obj_ptr) >= 0)) { H5I_remove(id); ret_value = 0; @@ -2180,20 +2184,9 @@ H5Iget_name(hid_t id, char *name/*out*/, size_t size) FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "ixz", id, name, size); - /* add a workaround for named datatypes for now */ - if(H5I_TYPE(id) == H5I_DATATYPE) { - H5T_t *type = NULL, *dt = NULL; - - if(NULL == (dt = (H5T_t *)H5VL_get_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type") - if(H5G_loc_real((void *)dt, H5I_DATATYPE, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - } - else { - /* Get object location */ - if(H5G_loc(id, &loc) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") - } + /* Get object location */ + if(H5G_loc(id, &loc) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") /* Call internal group routine to retrieve object's name */ if((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0) @@ -2428,7 +2421,6 @@ H5I_register_type2(H5I_type_t type_id, size_t hash_size, unsigned reserved, type_ptr->nextid = reserved; type_ptr->free_func = free_func; type_ptr->free_aux = free_aux; - type_ptr->id_list = (H5I_id_info_t **)H5MM_calloc(hash_size * sizeof(H5I_id_info_t *)); if(NULL == type_ptr->id_list) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_BADID, "memory allocation failed") @@ -2563,7 +2555,7 @@ done: /*------------------------------------------------------------------------- * Function: H5I_register_aux * - * Purpose: increment the ref count on the high level ID given the low level ID + * Purpose: register an Auxilary object and a free func with an existing ID * * Return: Success: postive * Failure: FAIL @@ -2576,7 +2568,7 @@ done: herr_t H5I_register_aux(hid_t id, void *aux_ptr, H5I_free2_t free_func) { - H5I_id_type_t *type_ptr; /*ptr to the type*/ + H5I_id_type_t *type_ptr = NULL; /*ptr to the type*/ H5I_id_info_t *id_ptr = NULL; /*ptr to the id*/ H5I_type_t type; herr_t ret_value = SUCCEED; /*return value*/ @@ -2586,11 +2578,11 @@ H5I_register_aux(hid_t id, void *aux_ptr, H5I_free2_t free_func) /* Check arguments */ type = H5I_TYPE(id); if (type <= H5I_BADID || type >= H5I_next_type) - HGOTO_DONE(NULL); + HGOTO_DONE(FAIL); type_ptr = H5I_id_type_list_g[type]; if (!type_ptr || type_ptr->count <= 0) - HGOTO_DONE(NULL); + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "invalid type") type_ptr->free_aux = free_func; @@ -2598,6 +2590,7 @@ H5I_register_aux(hid_t id, void *aux_ptr, H5I_free2_t free_func) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "Invalid ID") id_ptr->aux_ptr = aux_ptr; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register_aux() */ @@ -2621,9 +2614,9 @@ void * H5I_get_aux(hid_t id) { H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ - void * ret_value = NULL; /*return value */ + void *ret_value = NULL; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(NULL) if(NULL != (id_ptr = H5I_find_id(id))) { ret_value = (void *)id_ptr->aux_ptr; @@ -2656,7 +2649,6 @@ H5I_get_id(void *object, H5I_type_t type) FUNC_ENTER_NOAPI(FAIL) type_ptr = H5I_id_type_list_g[type]; - if(type_ptr == NULL || type_ptr->count <= 0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") diff --git a/src/H5T.c b/src/H5T.c index f76b955..aa42be5 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -743,7 +743,7 @@ H5T_init_interface(void) /* Initialize the atom group for the file IDs */ if(H5I_register_type2(H5I_DATATYPE, (size_t)H5I_DATATYPEID_HASHSIZE, H5T_RESERVED_ATOMS, - (H5I_free_t)H5T_close, (H5I_free2_t)H5T_close_datatype)vol_obj) - dt = type; - else - dt = (H5T_t *)type->vol_obj; - /* Set return value */ - ret_value = H5T_committed(dt); + ret_value = H5T_committed(type); done: FUNC_LEAVE_API(ret_value) @@ -530,11 +530,18 @@ done: htri_t H5T_committed(const H5T_t *type) { + const H5T_t *dt; + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(type); - FUNC_LEAVE_NOAPI(H5T_STATE_OPEN == type->shared->state || H5T_STATE_NAMED == type->shared->state) + if (NULL == type->vol_obj) + dt = type; + else + dt = (const H5T_t *)type->vol_obj; + + FUNC_LEAVE_NOAPI(H5T_STATE_OPEN == dt->shared->state || H5T_STATE_NAMED == dt->shared->state) } /* end H5T_committed() */ @@ -923,7 +930,7 @@ H5T_update_shared(H5T_t *dt) *------------------------------------------------------------------------- */ void * -H5T_get_named_type(H5T_t *dt) +H5T_get_named_type(const H5T_t *dt) { void *ret_value = NULL; /* Return value */ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 32080fe..ce82b2d 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -47,7 +47,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Ppublic.h" /* Property Lists */ #include "H5Tpkg.h" /* Datatypes */ - +#include "H5VLprivate.h" /* VOL plugins */ #ifndef H5_NO_DEPRECATED_SYMBOLS /****************/ @@ -125,25 +125,49 @@ H5T_init_deprec_interface(void) herr_t H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) { - H5G_loc_t loc; /* Location to create datatype */ - H5T_t *type; /* Datatype for ID */ + void *dt = NULL; + H5T_t *type = NULL; + void *obj = NULL; /* object token of loc_id */ + H5VL_t *vol_plugin; /* VOL plugin information */ + H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*si", loc_id, name, type_id); /* Check arguments */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if (H5Tcommitted(type_id)) + HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed") if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - /* Commit the datatype to the file, using default property list values */ - if(H5T__commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, - H5P_DATATYPE_CREATE_DEFAULT, H5P_DATATYPE_ACCESS_DEFAULT, H5AC_dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") + loc_params.type = H5VL_OBJECT_BY_SELF; + loc_params.obj_type = H5I_get_type(loc_id); + + /* get the object from the loc_id */ + if(NULL == (obj = (void *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + + /* commit the datatype through the VOL */ + if (NULL == (dt = H5VL_datatype_commit(obj, loc_params, vol_plugin, name, type_id, + H5P_LINK_CREATE_DEFAULT, H5P_DATATYPE_CREATE_DEFAULT, + H5P_DATATYPE_ACCESS_DEFAULT, H5_REQUEST_NULL))) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to commit datatype") + + /* attach the vol object created using the commit call to the + library datatype structure */ + /* set the committed type object to the VOL pluging pointer in the H5T_t struct */ + type->vol_obj = dt; + + /* attach VOL information to the ID */ + if (H5I_register_aux(type_id, vol_plugin, (H5I_free2_t)H5T_close_datatype) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") + vol_plugin->nrefs ++; done: FUNC_LEAVE_API(ret_value) @@ -169,62 +193,42 @@ done: hid_t H5Topen1(hid_t loc_id, const char *name) { - H5T_t *type = NULL; - H5G_loc_t loc; - H5G_name_t path; /* Datatype group hier. path */ - H5O_loc_t oloc; /* Datatype object location */ - H5O_type_t obj_type; /* Type of object at location */ - H5G_loc_t type_loc; /* Group object for datatype */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ - hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datatype */ - hid_t ret_value = FAIL; + void *dt = NULL; /* datatype token from VOL plugin */ + void *obj = NULL; /* object token of loc_id */ + H5VL_t *vol_plugin; /* VOL plugin information */ + H5VL_loc_params_t loc_params; + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("i", "i*s", loc_id, name); + H5TRACE2("i", "i*si", loc_id, name); /* Check args */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!name || !*name) + if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Set up datatype location to fill in */ - type_loc.oloc = &oloc; - type_loc.path = &path; - H5G_loc_reset(&type_loc); - - /* - * Find the named datatype object header and read the datatype message - * from it. - */ - if(H5G_loc_find(&loc, name, &type_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") - obj_found = TRUE; - - /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_NAMED_DATATYPE) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a named datatype") - - /* Open it */ - if((type = H5T_open(&type_loc, dxpl_id)) == NULL) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") - - /* Register the type and return the ID */ - if((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named datatype") + loc_params.type = H5VL_OBJECT_BY_SELF; + loc_params.obj_type = H5I_get_type(loc_id); -done: - if(ret_value < 0) { - if(type != NULL) - H5T_close(type); - else { - if(obj_found && H5F_addr_defined(type_loc.oloc->addr)) - H5G_loc_free(&type_loc); - } /* end else */ - } /* end if */ + /* get the file object */ + if(NULL == (obj = (void *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + + /* Create the datatype through the VOL */ + if(NULL == (dt = H5VL_datatype_open(obj, loc_params, vol_plugin, name, + H5P_DATATYPE_ACCESS_DEFAULT, H5_REQUEST_NULL))) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open datatype") + /* Get an atom for the datatype */ + if ((ret_value = H5VL_create_datatype(dt, vol_plugin, H5_REQUEST_NULL)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize datatype handle") + +done: + if (ret_value < 0 && dt) + if(H5VL_datatype_close (dt, vol_plugin, H5_REQUEST_NULL) < 0) + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) } /* end H5Topen1() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Toh.c b/src/H5Toh.c index e90d22f..9c9313a 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -145,7 +145,7 @@ H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t UNUSED lapl_id, hid_t dxpl_id, hb HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open datatype") /* Copy the dataset's datatype */ - if(NULL == (type = H5T_copy(dt, H5T_COPY_REOPEN))) + if(NULL == (type = H5T_copy(dt, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy datatype") H5T_set_vol_object(type, (void *)dt); diff --git a/src/H5Torder.c b/src/H5Torder.c index 35be454..b807464 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -236,6 +236,8 @@ H5Tset_order(hid_t type_id, H5T_order_t order) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype") if(order < H5T_ORDER_LE || order > H5T_ORDER_NONE || order == H5T_ORDER_MIXED) HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "illegal byte order") + if (NULL != dt->vol_obj) + HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed") if(H5T_STATE_TRANSIENT != dt->shared->state) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype is read-only") diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index dd89b59..671ae2e 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -179,7 +179,9 @@ H5Tset_precision(hid_t type_id, size_t prec) if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (H5T_STATE_TRANSIENT!=dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is read-only") + HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is read-only") + if (NULL != dt->vol_obj) + HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is committed") if (prec == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "precision must be positive") if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0) diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 49674fd..f4df875 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -140,7 +140,7 @@ H5_DLL herr_t H5T_patch_file(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt); H5_DLL herr_t H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc); H5_DLL H5T_t *H5T_decode(const unsigned char *buf); -H5_DLL void * H5T_get_named_type(H5T_t *dt); +H5_DLL void * H5T_get_named_type(const H5T_t *dt); H5_DLL hid_t H5VL_create_datatype(void *dt_obj, H5VL_t *vol_plugin, hid_t req); H5_DLL herr_t H5T_set_vol_object(H5T_t *type, void *vol_obj); diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 28e8f9d..6bf8fc0 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -1004,7 +1004,7 @@ H5VL_native_datatype_commit(void *obj, H5VL_loc_params_t loc_params, const char /* Copy the datatype - the copied one will be the type that is committed, and attached to original datatype above the VOL layer*/ - if(NULL == (type = H5T_copy(dt, H5T_COPY_REOPEN))) + if(NULL == (type = H5T_copy(dt, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); if(NULL != name) { /* H5Tcommit */ -- cgit v0.12