summaryrefslogtreecommitdiffstats
path: root/src/H5VL.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-07-12 16:27:42 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-07-12 16:27:42 (GMT)
commite3f35800977504c45ec2847f1f23b7f5ba48ad76 (patch)
tree5dffaf97d6109a20a0d3a5ad35ea1b785056aa87 /src/H5VL.c
parentbef08a7c0ec8f1bdc6a2637401b99d3c2bbb0617 (diff)
downloadhdf5-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/H5VL.c')
-rw-r--r--src/H5VL.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/src/H5VL.c b/src/H5VL.c
index b0b15a9..acdfdaa 100644
--- a/src/H5VL.c
+++ b/src/H5VL.c
@@ -344,59 +344,22 @@ done:
*---------------------------------------------------------------------------
*/
hid_t
-H5VLregister_object(void *obj, H5I_type_t obj_type, const H5VL_class_t *cls)
+H5VLobject_register(void *obj, H5I_type_t obj_type, const H5VL_class_t *cls)
{
H5VL_t *vol_plugin; /* VOL plugin information */
hid_t ret_value = FAIL;
FUNC_ENTER_API(FAIL)
- /* Get an atom for the object */
- if((ret_value = H5I_register(obj_type, obj, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object")
-
/* Build the vol plugin struct */
if(NULL == (vol_plugin = (H5VL_t *)H5MM_calloc(sizeof(H5VL_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
vol_plugin->cls = cls;
vol_plugin->nrefs = 1;
- switch(obj_type) {
- case H5I_FILE:
- if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5F_close_file) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID")
- break;
- case H5I_GROUP:
- if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5G_close_group) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID")
- break;
- case H5I_DATATYPE:
- if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5T_close_datatype) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID")
- break;
- case H5I_DATASET:
- if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5D_close_dataset) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID")
- break;
- case H5I_ATTR:
- if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5A_close_attr) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID")
- break;
- case H5I_UNINIT:
- case H5I_BADID:
- case H5I_DATASPACE:
- case H5I_REFERENCE:
- case H5I_VFL:
- case H5I_VOL:
- case H5I_GENPROP_CLS:
- case H5I_GENPROP_LST:
- case H5I_ERROR_CLASS:
- case H5I_ERROR_MSG:
- case H5I_ERROR_STACK:
- case H5I_NTYPES:
- default:
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
- } /* end switch */
+ if ((ret_value = H5VL_object_register(obj, obj_type, vol_plugin, TRUE)) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle")
+
done:
FUNC_LEAVE_API(ret_value)
} /* H5VLregister_object */