diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-08-26 22:09:17 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-08-26 22:09:17 (GMT) |
commit | e271be083c2b7a542d282c52df41cd307c8e136f (patch) | |
tree | 66cb747bb72160e843ac93cbeea9300a8967a2b7 /src/H5G.c | |
parent | 39af44b6f2501df56998a2458db3551fc232a422 (diff) | |
download | hdf5-e271be083c2b7a542d282c52df41cd307c8e136f.zip hdf5-e271be083c2b7a542d282c52df41cd307c8e136f.tar.gz hdf5-e271be083c2b7a542d282c52df41cd307c8e136f.tar.bz2 |
[svn-r25555] - rework the public H5VL wrappers to not use H5VL_t* and use a plugin hid_t instead
- rework the private VL layer to use the class structure directly
- some bug fixes
Diffstat (limited to 'src/H5G.c')
-rw-r--r-- | src/H5G.c | 44 |
1 files changed, 24 insertions, 20 deletions
@@ -329,17 +329,17 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t g HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* Create the group through the VOL */ - if(NULL == (grp = H5VL_group_create(obj, loc_params, vol_plugin, name, gcpl_id, gapl_id, + if(NULL == (grp = H5VL_group_create(obj, loc_params, vol_plugin->cls, name, gcpl_id, gapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") - /* Get an atom for the group */ - if((ret_value = H5I_register2(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") + /* Get an atom for the group with the VOL information as the auxilary struct*/ + if((ret_value = H5VL_register_id(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize group handle") done: if (ret_value < 0 && grp) - if(H5VL_group_close (grp, vol_plugin, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_group_close (grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate2() */ @@ -418,17 +418,17 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* Create the group through the VOL */ - if(NULL == (grp = H5VL_group_create(obj, loc_params, vol_plugin, NULL, gcpl_id, gapl_id, + if(NULL == (grp = H5VL_group_create(obj, loc_params, vol_plugin->cls, NULL, gcpl_id, gapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") - /* Get an atom for the group */ - if((ret_value = H5I_register2(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") + /* Get an atom for the group with the VOL information as the auxilary struct*/ + if((ret_value = H5VL_register_id(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize group handle") done: if (ret_value < 0 && grp) - if(H5VL_group_close (grp, vol_plugin, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_group_close (grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate_anon() */ @@ -486,17 +486,17 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* Create the group through the VOL */ - if(NULL == (grp = H5VL_group_open(obj, loc_params, vol_plugin, name, gapl_id, + if(NULL == (grp = H5VL_group_open(obj, loc_params, vol_plugin->cls, name, gapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - /* Get an atom for the group */ - if((ret_value = H5I_register2(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") + /* Get an atom for the group with the VOL information as the auxilary struct*/ + if((ret_value = H5VL_register_id(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize group handle") done: if (ret_value < 0 && grp) - if(H5VL_group_close (grp, vol_plugin, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_group_close (grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_API(ret_value) } /* end H5Gopen2() */ @@ -536,7 +536,7 @@ H5Gget_create_plist(hid_t grp_id) if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(grp_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - if(H5VL_group_get(grp, vol_plugin, H5VL_GROUP_GET_GCPL, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_group_get(grp, vol_plugin->cls, H5VL_GROUP_GET_GCPL, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group creation properties") @@ -588,7 +588,7 @@ H5Gget_info(hid_t loc_id, H5G_info_t *grp_info) loc_params.obj_type = id_type; /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(obj, vol_plugin, H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, + if((ret_value = H5VL_group_get(obj, vol_plugin->cls, H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, grp_info)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") @@ -646,7 +646,7 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid group identifier") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(obj, vol_plugin, H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, + if((ret_value = H5VL_group_get(obj, vol_plugin->cls, H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, grp_info)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") @@ -713,7 +713,7 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid group identifier") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(obj, vol_plugin, H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, + if((ret_value = H5VL_group_get(obj, vol_plugin->cls, H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, grp_info)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") @@ -786,9 +786,13 @@ H5G_close_group(void *grp, H5VL_t *vol_plugin) FUNC_ENTER_NOAPI_NOINIT /* Close the group through the VOL*/ - if((ret_value = H5VL_group_close(grp, vol_plugin, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_group_close(grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to close group") + /* decrement ref count on VOL ID */ + if(H5VL_free_id(vol_plugin) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_close_group() */ |