diff options
Diffstat (limited to 'src/H5G.c')
-rw-r--r-- | src/H5G.c | 44 |
1 files changed, 20 insertions, 24 deletions
@@ -470,6 +470,7 @@ herr_t H5Gget_info(hid_t loc_id, H5G_info_t *grp_info) { H5I_type_t id_type; /* Type of ID */ + H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -482,8 +483,11 @@ H5Gget_info(hid_t loc_id, H5G_info_t *grp_info) if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") + loc_params.type = H5VL_OBJECT_LOOKUP_BY_ID; + loc_params.loc_data.loc_by_id.id = loc_id; + /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, H5_REQUEST_NULL, grp_info, NULL)) < 0) + if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, H5_REQUEST_NULL, grp_info, loc_params)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: @@ -508,8 +512,7 @@ herr_t H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, hid_t lapl_id) { - void *location = NULL; /* a pointer to VOL specific token that indicates - the location of the object */ + H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -526,20 +529,16 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, &location, H5_REQUEST_NULL, name, lapl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") + loc_params.type = H5VL_OBJECT_LOOKUP_BY_NAME; + loc_params.loc_data.loc_by_name.name = name; + loc_params.loc_data.loc_by_name.plist_id = lapl_id; /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, H5_REQUEST_NULL, grp_info, location)) < 0) + if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, H5_REQUEST_NULL, + grp_info, loc_params)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: - if (NULL != location) { - /* free the location token through the VOL */ - if(H5VL_object_free_loc (loc_id, location, H5_REQUEST_NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to free location token") - } FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_name() */ @@ -562,8 +561,7 @@ herr_t H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info, hid_t lapl_id) { - void *location = NULL; /* a pointer to VOL specific token that indicates - the location of the object */ + H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -585,21 +583,19 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup(loc_id, H5VL_OBJECT_LOOKUP_BY_IDX, &location, H5_REQUEST_NULL, group_name, - idx_type, order, n, lapl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") + loc_params.type = H5VL_OBJECT_LOOKUP_BY_IDX; + loc_params.loc_data.loc_by_idx.name = group_name; + loc_params.loc_data.loc_by_idx.idx_type = idx_type; + loc_params.loc_data.loc_by_idx.order = order; + loc_params.loc_data.loc_by_idx.n = n; + loc_params.loc_data.loc_by_idx.plist_id = lapl_id; /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, H5_REQUEST_NULL, grp_info, location)) < 0) + if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, H5_REQUEST_NULL, + grp_info, loc_params)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: - if (NULL != location) { - /* free the location token through the VOL */ - if(H5VL_object_free_loc (loc_id, location, H5_REQUEST_NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to free location token") - } FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_idx() */ |