summaryrefslogtreecommitdiffstats
path: root/src/H5Rdeprec.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-09-05 21:36:55 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-09-05 21:36:55 (GMT)
commit05d51c036140f94a07efb75aab9675b3b4bd5ef0 (patch)
tree5fe046db1c355df5c771077164ba6d6c1f272866 /src/H5Rdeprec.c
parentf2e6cec0728a75f5982e3b6d91f0ce823d1206a6 (diff)
downloadhdf5-05d51c036140f94a07efb75aab9675b3b4bd5ef0.zip
hdf5-05d51c036140f94a07efb75aab9675b3b4bd5ef0.tar.gz
hdf5-05d51c036140f94a07efb75aab9675b3b4bd5ef0.tar.bz2
[svn-r25575] cleanup H5I usage in VOL by removing the use of the aux pointer and
make a higher level wrapper object around all VOL objects that includes the VOL information.
Diffstat (limited to 'src/H5Rdeprec.c')
-rw-r--r--src/H5Rdeprec.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c
index 1f95827..1a01e07 100644
--- a/src/H5Rdeprec.c
+++ b/src/H5Rdeprec.c
@@ -159,8 +159,7 @@ H5R__term_deprec_interface(void)
H5G_obj_t
H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
{
- void *obj = NULL; /* object token of loc_id */
- H5VL_t *vol_plugin; /* VOL plugin information */
+ H5VL_object_t *obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
H5O_type_t obj_type; /* Object type */
H5G_obj_t ret_value; /* Return value */
@@ -178,14 +177,11 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
loc_params.obj_type = H5I_get_type(id);
/* get the vol object */
- if(NULL == (obj = (void *)H5VL_get_object(id)))
+ if(NULL == (obj = H5VL_get_object(id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
- /* get the plugin pointer */
- if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
/* get the object type through the VOL */
- if((ret_value = H5VL_object_get(obj, loc_params, vol_plugin->cls, H5VL_REF_GET_TYPE,
+ if((ret_value = H5VL_object_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_REF_GET_TYPE,
H5AC_ind_dxpl_id, H5_REQUEST_NULL, &obj_type, ref_type, ref)) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info")
@@ -222,12 +218,11 @@ done:
hid_t
H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref)
{
- void *obj = NULL; /* object token of loc_id */
- H5VL_t *vol_plugin; /* VOL plugin information */
- H5I_type_t opened_type;
- void *opened_obj = NULL;
+ H5VL_object_t *obj = NULL; /* object token of loc_id */
+ H5I_type_t opened_type;
+ void *opened_obj = NULL;
H5VL_loc_params_t loc_params;
- hid_t ret_value;
+ hid_t ret_value = FAIL;
FUNC_ENTER_API(FAIL)
H5TRACE3("i", "iRt*x", obj_id, ref_type, _ref);
@@ -239,11 +234,8 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer")
/* get the vol object */
- if(NULL == (obj = (void *)H5VL_get_object(obj_id)))
+ if(NULL == (obj = H5VL_get_object(obj_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
- /* get the plugin pointer */
- if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(obj_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
loc_params.type = H5VL_OBJECT_BY_REF;
loc_params.loc_data.loc_by_ref.ref_type = ref_type;
@@ -252,13 +244,13 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref)
loc_params.obj_type = H5I_get_type(obj_id);
/* Open the object through the VOL */
- if(NULL == (opened_obj = H5VL_object_open(obj, loc_params, vol_plugin->cls, &opened_type,
+ if(NULL == (opened_obj = H5VL_object_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, &opened_type,
H5AC_dxpl_id, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open object")
/* Get an atom for the object */
- if ((ret_value = H5VL_object_register(opened_obj, opened_type, vol_plugin, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle")
+ if((ret_value = H5VL_register_id(opened_type, opened_obj, obj->vol_info, TRUE)) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object handle")
done:
FUNC_LEAVE_API(ret_value)