diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-10-26 05:54:29 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-10-26 05:54:29 (GMT) |
commit | 305997501dd4c44cb46adfc0159489ae84c5fad4 (patch) | |
tree | 9be360975ec087d7aec751b22b336f79932dca26 /src/H5L.c | |
parent | 4a328957243ca7502a4c4966d6598498be43e3cd (diff) | |
download | hdf5-305997501dd4c44cb46adfc0159489ae84c5fad4.zip hdf5-305997501dd4c44cb46adfc0159489ae84c5fad4.tar.gz hdf5-305997501dd4c44cb46adfc0159489ae84c5fad4.tar.bz2 |
Updates after merging changes from develop.
Diffstat (limited to 'src/H5L.c')
-rw-r--r-- | src/H5L.c | 70 |
1 files changed, 50 insertions, 20 deletions
@@ -337,7 +337,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, vol_obj = (vol_obj1 ? vol_obj1 : vol_obj2); if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; } @@ -351,7 +351,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Lmove() */ @@ -438,7 +438,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, vol_obj = (vol_obj1 ? vol_obj1 : vol_obj2); if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; } @@ -452,7 +452,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Lcopy() */ @@ -531,7 +531,7 @@ H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name /* Set wrapper info in API context */ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Create the link */ @@ -542,7 +542,7 @@ H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_soft() */ @@ -722,7 +722,7 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, /* Set wrapper info in API context */ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Create external link */ @@ -733,7 +733,7 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_ud() */ @@ -787,7 +787,7 @@ H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) /* Set wrapper info in API context */ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Unlink */ @@ -798,7 +798,7 @@ H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Ldelete() */ @@ -893,6 +893,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, { H5VL_object_t *vol_obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; + hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -915,12 +916,21 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, if(NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Set wrapper info in API context */ + if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + vol_wrapper_set = TRUE; + /* Get the link value */ if(H5VL_link_get(vol_obj->data, loc_params, vol_obj->plugin->cls, H5VL_LINK_GET_VAL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, buf, size) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for '%s'", name) done: + /* Reset object wrapping info in API context */ + if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + FUNC_LEAVE_API(ret_value) } /* end H5Lget_val() */ @@ -1007,6 +1017,7 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) { H5VL_object_t *vol_obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; + hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1032,12 +1043,21 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) if(NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Set wrapper info in API context */ + if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + vol_wrapper_set = TRUE; + /* Check for the existence of the link */ if(H5VL_link_specific(vol_obj->data, loc_params, vol_obj->plugin->cls, H5VL_LINK_EXISTS, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: + /* Reset object wrapping info in API context */ + if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + FUNC_LEAVE_API(ret_value) } /* end H5Lexists() */ @@ -1087,7 +1107,7 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, /* Set wrapper info in API context */ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Get the link information */ @@ -1098,7 +1118,7 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info() */ @@ -1158,7 +1178,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, /* Set wrapper info in API context */ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Get the link information */ @@ -1169,7 +1189,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info_by_idx() */ @@ -1424,7 +1444,7 @@ H5Literate(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, /* Set wrapper info in API context */ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Iterate over the links */ @@ -1436,7 +1456,7 @@ H5Literate(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Literate() */ @@ -1471,6 +1491,7 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, { H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */ H5VL_loc_params_t loc_params; + hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1503,12 +1524,21 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, loc_params.loc_data.loc_by_name.name = group_name; loc_params.loc_data.loc_by_name.lapl_id = lapl_id; + /* Set wrapper info in API context */ + if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + vol_wrapper_set = TRUE; + /* Iterate over the links */ if((ret_value = H5VL_link_specific(vol_obj->data, loc_params, vol_obj->plugin->cls, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, FALSE, idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") done: + /* Reset object wrapping info in API context */ + if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + FUNC_LEAVE_API(ret_value) } /* end H5Literate_by_name() */ @@ -1575,7 +1605,7 @@ H5Lvisit(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, /* Set wrapper info in API context */ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Iterate over the links */ @@ -1587,7 +1617,7 @@ H5Lvisit(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit() */ @@ -1662,7 +1692,7 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, /* Set wrapper info in API context */ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Visit the links */ @@ -1674,7 +1704,7 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, done: /* Reset object wrapping info in API context */ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit_by_name() */ |