diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-07-12 16:27:42 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-07-12 16:27:42 (GMT) |
commit | e3f35800977504c45ec2847f1f23b7f5ba48ad76 (patch) | |
tree | 5dffaf97d6109a20a0d3a5ad35ea1b785056aa87 /src/H5VLnative.c | |
parent | bef08a7c0ec8f1bdc6a2637401b99d3c2bbb0617 (diff) | |
download | hdf5-e3f35800977504c45ec2847f1f23b7f5ba48ad76.zip hdf5-e3f35800977504c45ec2847f1f23b7f5ba48ad76.tar.gz hdf5-e3f35800977504c45ec2847f1f23b7f5ba48ad76.tar.bz2 |
[svn-r22565] change OH id registration to original way, and re-register the ID with the VOL info on the upper level (API and iteration/visit routines)
- this fixes the bug exposed in H5Oopen with external log plugin
update the private VL registration routine to take an app_ref
update the datatype ID creation for the VOL to take an app_ref
Diffstat (limited to 'src/H5VLnative.c')
-rw-r--r-- | src/H5VLnative.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 3f77d84..cdcfc3d 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -343,6 +343,7 @@ hid_t H5VL_native_register(H5I_type_t type, void *obj, hbool_t app_ref) { H5VL_t *vol_plugin; /* VOL plugin information */ + H5T_t *dt = NULL; hid_t ret_value = FAIL; FUNC_ENTER_NOAPI_NOINIT @@ -355,12 +356,26 @@ H5VL_native_register(H5I_type_t type, void *obj, hbool_t app_ref) vol_plugin->cls = &H5VL_native_g; vol_plugin->nrefs = 1; - /* Get an atom for the file with the VOL information as the auxilary struct*/ + /* if this is a named datatype, we need to create the two-fold datatype + to be comaptible with the VOL */ + if(H5I_DATATYPE == type) { + /* Copy the dataset's datatype */ + if(NULL == (dt = H5T_copy((H5T_t *)obj, H5T_COPY_TRANSIENT))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy datatype") + + H5T_set_vol_object(dt, obj); + obj = (void *) dt; + } + + /* Get an atom for the object with the VOL information as the auxilary struct*/ if((ret_value = H5I_register2(type, obj, (void *)vol_plugin, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") + done: + if(ret_value < 0 && dt && H5T_close(dt) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") FUNC_LEAVE_NOAPI(ret_value) -} /* H5VL_native_register_with_aux */ +} /* H5VL_native_register */ /*------------------------------------------------------------------------- |