diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-04 08:09:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-04 08:09:27 (GMT) |
commit | afd54bbe5ce6568e0e010bbce145dfe9a60de2bf (patch) | |
tree | 69be8441b3d42dcf8546ed73b90db07d1cd25ba3 /src | |
parent | 1daa7b830ac9ce6028c21f22fddaa67bd4dc8d96 (diff) | |
download | hdf5-afd54bbe5ce6568e0e010bbce145dfe9a60de2bf.zip hdf5-afd54bbe5ce6568e0e010bbce145dfe9a60de2bf.tar.gz hdf5-afd54bbe5ce6568e0e010bbce145dfe9a60de2bf.tar.bz2 |
Remove most debugging shims & scaffolding.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Aint.c | 16 | ||||
-rw-r--r-- | src/H5Dint.c | 8 | ||||
-rw-r--r-- | src/H5Dvirtual.c | 8 | ||||
-rw-r--r-- | src/H5Fint.c | 176 | ||||
-rw-r--r-- | src/H5Fpkg.h | 16 | ||||
-rw-r--r-- | src/H5G.c | 10 | ||||
-rw-r--r-- | src/H5Gint.c | 16 | ||||
-rw-r--r-- | src/H5Gtraverse.c | 8 | ||||
-rw-r--r-- | src/H5L.c | 106 | ||||
-rw-r--r-- | src/H5Lexternal.c | 8 | ||||
-rw-r--r-- | src/H5Ocopy.c | 10 | ||||
-rw-r--r-- | src/H5Oint.c | 8 | ||||
-rw-r--r-- | src/H5VLnative.c | 110 |
13 files changed, 141 insertions, 359 deletions
diff --git a/src/H5Aint.c b/src/H5Aint.c index 8d90cf9..f8efd26 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -923,14 +923,6 @@ H5A__get_type(H5A_t *attr) * two level IDs, where the VOL object is a copy of the * returned datatype */ -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if ((ret_value = H5VL_wrap_register(H5I_DATATYPE, dt, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle") } @@ -2655,14 +2647,6 @@ H5A__iterate(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5 HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open object"); /* Get an ID for the object */ -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if((obj_loc_id = H5VL_wrap_register(obj_type, temp_obj, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype"); diff --git a/src/H5Dint.c b/src/H5Dint.c index 67889e6..d5ac251 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -3398,14 +3398,6 @@ H5D__get_type(const H5D_t *dset) * two-level IDs, where the VOL object is a copy of the * returned datatype. */ -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if((ret_value = H5VL_wrap_register(H5I_DATATYPE, dt, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") } /* end if */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 3dc44c5..feb836d 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -2972,14 +2972,6 @@ H5D__virtual_refresh_source_dset(H5D_t **dset) HDassert(dset && *dset); /* Get a temporary identifier for this source dataset */ -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if((temp_id = H5VL_wrap_register(H5I_DATASET, *dset, FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register (temporary) source dataset ID") diff --git a/src/H5Fint.c b/src/H5Fint.c index 6e8f073..c085e83 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -2176,14 +2176,6 @@ H5F_get_id(H5F_t *file) if(H5I_find_id(file, H5I_FILE, &ret_value) < 0 || H5I_INVALID_HID == ret_value) { /* resurrect the ID - Register an ID with the native connector */ -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if((ret_value = H5VL_wrap_register(H5I_FILE, file, FALSE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group") file->id_exists = TRUE; @@ -3244,7 +3236,6 @@ H5F__start_swmr_write(H5F_t *f) size_t u; /* Local index variable */ hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ H5VL_t *vol_connector = NULL; /* VOL connector for the file */ - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3316,11 +3307,6 @@ H5F__start_swmr_write(H5F_t *f) if(NULL == (vol_obj = H5VL_vol_object(obj_ids[0]))) HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "invalid object identifier") - /* Set wrapper info in API context */ - if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set VOL wrapper info") - vol_wrapper_set = TRUE; - /* Get the (top) connector for the ID */ vol_connector = vol_obj->connector; } /* end if */ @@ -3396,10 +3382,6 @@ H5F__start_swmr_write(H5F_t *f) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to unlock the file") done: - /* Reset object wrapping info in API context */ - if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't reset VOL wrapper info") - if(ret_value < 0 && setup) { /* Re-enable accumulator */ @@ -3504,10 +3486,79 @@ done: } /* H5F__format_convert() */ +/*--------------------------------------------------------------------------- + * Function: H5F__get_file + * + * Purpose: Utility routine to get file struct for an object + * + * Returns: SUCCESS: A pointer to the H5F_t struct for the file + * associated with the object. + * FAILURE: NULL + * + *--------------------------------------------------------------------------- + */ +H5F_t * +H5F__get_file(void *obj, H5I_type_t type) +{ + H5F_t *ret_value = NULL; /* File pointer */ + H5O_loc_t *oloc = NULL; /* Object location for ID */ + + FUNC_ENTER_PACKAGE + + switch(type) { + case H5I_FILE: + ret_value = (H5F_t *)obj; + break; + + case H5I_GROUP: + oloc = H5G_oloc((H5G_t *)obj); + break; + + case H5I_DATATYPE: + oloc = H5T_oloc((H5T_t *)obj); + break; + + case H5I_DATASET: + oloc = H5D_oloc((H5D_t *)obj); + break; + + case H5I_ATTR: + oloc = H5A_oloc((H5A_t *)obj); + 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, NULL, "not a file or file object") + } /* end switch */ + + /* Set return value for objects (not files) */ + if(oloc) + ret_value = oloc->file; + + /* Couldn't find a file struct */ + if(!ret_value) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "object is not associated with a file") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F__get_file */ + + /*------------------------------------------------------------------------- - * Function: H5F_get_file_id + * Function: H5F__get_file_id * - * Purpose: The private version of H5Iget_file_id(), obtains the file + * Purpose: The package version of H5Iget_file_id(), obtains the file * ID given an object ID. * * Return: Success: The file ID associated with the object @@ -3516,58 +3567,71 @@ done: *------------------------------------------------------------------------- */ hid_t -H5F_get_file_id(hid_t obj_id, H5I_type_t type) +H5F__get_file_id(H5F_t *file) { - H5VL_object_t *vol_obj; - void *file = NULL; - hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ - - FUNC_ENTER_NOAPI(H5I_INVALID_HID) - - /* Get the object pointer */ - if(NULL == (vol_obj = H5VL_vol_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid identifier") + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - /* Get the file through the VOL */ - if(H5VL_file_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_FILE_GET_FILE, type, &file) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to get file") - if(NULL == file) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to get the file through the VOL") + FUNC_ENTER_PACKAGE /* Check if the file's ID already exists */ - if(H5I_find_id(file, H5I_FILE, &ret_value) < 0) + if(H5I_find_id(file, H5I_FILE, &file_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "getting file ID failed") /* If the ID does not exist, register it with the VOL connector */ - if(H5I_INVALID_HID == ret_value) { - /* Set wrapper info in API context */ - if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") - vol_wrapper_set = TRUE; - -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} - if ((ret_value = H5VL_wrap_register(H5I_FILE, file, TRUE)) < 0) + if(H5I_INVALID_HID == file_id) { + if((file_id = H5VL_wrap_register(H5I_FILE, file, TRUE)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle") + file->id_exists = TRUE; } /* end if */ else { /* Increment ref count on existing ID */ - if(H5I_inc_ref(ret_value, TRUE) < 0) + if(H5I_inc_ref(file_id, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "incrementing file ID failed") } /* end else */ + /* Set return value */ + ret_value = file_id; + done: - /* Reset object wrapping info in API context */ - if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info") + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__get_file_id() */ + +/*------------------------------------------------------------------------- + * Function: H5F_get_file_id + * + * Purpose: The private version of H5Iget_file_id(), obtains the file + * ID given an object ID. + * + * Return: Success: The file ID associated with the object + * Failure: H5I_INVALID_HID + * + *------------------------------------------------------------------------- + */ +hid_t +H5F_get_file_id(hid_t obj_id, H5I_type_t type) +{ + H5VL_object_t *vol_obj; /* File info */ + hid_t file_id = H5I_INVALID_HID; /* File ID for object */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_NOAPI(H5I_INVALID_HID) + + /* Get the object pointer */ + if(NULL == (vol_obj = H5VL_vol_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid identifier") + + /* Get the file through the VOL */ + if(H5VL_file_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_FILE_GET_FILE_ID, type, &file_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to get file ID") + if(H5I_INVALID_HID == file_id) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to get the file ID through the VOL") + + /* Set return value */ + ret_value = file_id; + +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_file_id() */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index ea5d5e8..990a6b9 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -383,14 +383,14 @@ typedef enum H5VL_file_optional_t { H5VL_FILE_CLEAR_ELINK_CACHE, /* Clear external link cache */ H5VL_FILE_GET_FILE_IMAGE, /* file image */ H5VL_FILE_GET_FREE_SECTIONS, /* file free selections */ - H5VL_FILE_GET_FREE_SPACE, /* file freespace */ - H5VL_FILE_GET_INFO, /* file info */ + H5VL_FILE_GET_FREE_SPACE, /* file freespace */ + H5VL_FILE_GET_INFO, /* file info */ H5VL_FILE_GET_MDC_CONF, /* file metadata cache configuration */ - H5VL_FILE_GET_MDC_HR, /* file metadata cache hit rate */ - H5VL_FILE_GET_MDC_SIZE, /* file metadata cache size */ - H5VL_FILE_GET_SIZE, /* file size */ - H5VL_FILE_GET_VFD_HANDLE, /* file VFD handle */ - H5VL_FILE_GET_FILE, /* retrieve or resurrect file of object */ + H5VL_FILE_GET_MDC_HR, /* file metadata cache hit rate */ + H5VL_FILE_GET_MDC_SIZE, /* file metadata cache size */ + H5VL_FILE_GET_SIZE, /* file size */ + H5VL_FILE_GET_VFD_HANDLE, /* file VFD handle */ + H5VL_FILE_GET_FILE_ID, /* retrieve or resurrect file ID of object */ H5VL_FILE_RESET_MDC_HIT_RATE, /* get metadata cache hit rate */ H5VL_FILE_SET_MDC_CONFIG, /* set metadata cache configuration */ H5VL_FILE_GET_METADATA_READ_RETRY_INFO, @@ -448,6 +448,8 @@ H5_DLL herr_t H5F__format_convert(H5F_t *f); H5_DLL herr_t H5F__start_swmr_write(H5F_t *f); H5_DLL herr_t H5F__close(H5F_t *f); H5_DLL herr_t H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high); +H5_DLL H5F_t *H5F__get_file(void *obj, H5I_type_t type); +H5_DLL hid_t H5F__get_file_id(H5F_t *file); /* File mount related routines */ H5_DLL herr_t H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id); @@ -797,7 +797,6 @@ herr_t H5Grefresh(hid_t group_id) { H5VL_object_t *vol_obj; /* Group for this operation */ - 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) @@ -811,20 +810,11 @@ H5Grefresh(hid_t group_id) if(H5CX_set_loc(group_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Set wrapper info in API context */ - if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set VOL wrapper info") - vol_wrapper_set = TRUE; - /* Refresh group's metadata */ if(H5VL_group_specific(vol_obj, H5VL_GROUP_REFRESH, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, group_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to refresh group") done: - /* Reset object wrapping info in API context */ - if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't reset VOL wrapper info") - FUNC_LEAVE_API(ret_value) } /* H5Grefresh */ diff --git a/src/H5Gint.c b/src/H5Gint.c index 8f9e908..049c696 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -807,14 +807,6 @@ H5G_iterate(H5G_loc_t *loc, const char *group_name, */ if(NULL == (grp = H5G__open_name(loc, group_name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if((gid = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") @@ -1076,14 +1068,6 @@ H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, if(NULL == (grp = H5G__open_name(loc, group_name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} /* Register an ID for the starting group */ if((gid = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index eb8c778..2d8de99 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -198,14 +198,6 @@ H5G__traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, /* Create a group ID to pass to the user-defined callback */ if(NULL == (grp = H5G_open(&grp_loc_copy))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if((cur_grp = H5VL_wrap_register(H5I_GROUP, grp, FALSE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "unable to register group") @@ -710,7 +710,6 @@ H5Ldelete(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 */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -734,20 +733,11 @@ H5Ldelete(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->connector) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") - vol_wrapper_set = TRUE; - /* Unlink */ if(H5VL_link_specific(vol_obj, loc_params, H5VL_LINK_DELETE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") 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 H5Ldelete() */ @@ -840,7 +830,6 @@ 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) @@ -863,20 +852,11 @@ 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->connector) < 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, loc_params, 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() */ @@ -962,7 +942,6 @@ 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) @@ -988,20 +967,11 @@ 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->connector) < 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, loc_params, 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() */ @@ -1026,7 +996,6 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, { 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) @@ -1049,20 +1018,11 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, 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->connector) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") - vol_wrapper_set = TRUE; - /* Get the link information */ if(H5VL_link_get(vol_obj, loc_params, H5VL_LINK_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, linfo) < 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 H5Lget_info() */ @@ -1088,7 +1048,6 @@ H5Lget_info_by_idx(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 = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1119,20 +1078,11 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, 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->connector) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") - vol_wrapper_set = TRUE; - /* Get the link information */ if(H5VL_link_get(vol_obj, loc_params, H5VL_LINK_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, linfo) < 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 H5Lget_info_by_idx() */ @@ -1358,7 +1308,6 @@ H5Literate(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */ H5VL_loc_params_t loc_params; H5I_type_t id_type; /* Type of ID */ - 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) @@ -1383,20 +1332,11 @@ H5Literate(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(group_id); - /* Set wrapper info in API context */ - if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 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, loc_params, 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() */ @@ -1430,7 +1370,6 @@ 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) @@ -1463,20 +1402,11 @@ 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->connector) < 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, loc_params, 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() */ @@ -1516,7 +1446,6 @@ H5Lvisit(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */ H5VL_loc_params_t loc_params; H5I_type_t id_type; /* Type of ID */ - 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) @@ -1541,20 +1470,11 @@ H5Lvisit(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, if(NULL == (vol_obj = (H5VL_object_t *)H5I_object(group_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->connector) < 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, loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, TRUE, idx_type, order, NULL, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation 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 H5Lvisit() */ @@ -1593,7 +1513,6 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, { 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) @@ -1626,20 +1545,11 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, 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->connector) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") - vol_wrapper_set = TRUE; - /* Visit the links */ if((ret_value = H5VL_link_specific(vol_obj, loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, TRUE, idx_type, order, NULL, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation 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 H5Lvisit_by_name() */ @@ -2014,14 +1924,6 @@ H5L__link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATT /* Set up location for user-defined callback */ if(NULL == (grp = H5G_open(&temp_loc))) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group") -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if((grp_id = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register ID for group") @@ -2807,14 +2709,6 @@ H5L__move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, /* Set up location for user-defined callback */ if(NULL == (grp = H5G_open(&temp_loc))) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group") -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if((grp_id = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register group ID") diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 3cacdf5..ad0344e 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -242,14 +242,6 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, if(NULL == (ext_obj = H5O_open_name(&root_loc, obj_name, &opened_type))) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} /* Get an ID for the external link's object */ if((ext_obj_id = H5VL_wrap_register(opened_type, ext_obj, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register external link object") diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index cc1680d..213a697 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -204,7 +204,6 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5VL_loc_params_t loc_params1; H5VL_object_t *vol_obj2 = NULL; /* object token of dst_id */ H5VL_loc_params_t loc_params2; - 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) @@ -247,20 +246,11 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, loc_params2.type = H5VL_OBJECT_BY_SELF; loc_params2.obj_type = H5I_get_type(dst_loc_id); - /* Set wrapper info in API context */ - if(H5VL_set_vol_wrapper(vol_obj1->data, vol_obj1->connector) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info") - vol_wrapper_set = TRUE; - /* Copy the object */ if(H5VL_object_copy(vol_obj1, loc_params1, src_name, vol_obj2, loc_params2, dst_name, ocpypl_id, lcpl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") 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") - FUNC_LEAVE_API(ret_value) } /* end H5Ocopy() */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 2b40d64..3a60d9d 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -2658,14 +2658,6 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") /* Get an ID for the visited object */ -{ -void *vol_wrap_ctx = NULL; /* Object wrapping context */ - -/* Retrieve the VOL object wrap context */ -if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") -HDassert(vol_wrap_ctx); -} if((obj_id = H5VL_wrap_register(opened_type, obj, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register visited object") diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 12dbcdb..7b15828 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -50,7 +50,6 @@ static hid_t H5VL_NATIVE_ID_g = H5I_INVALID_HID; /* Prototypes */ -static H5F_t *H5VL__native_get_file(void *obj, H5I_type_t type); static herr_t H5VL__native_term(void); /* Atrribute callbacks */ @@ -284,92 +283,6 @@ done: } /* end H5Pset_fapl_native() */ -/*--------------------------------------------------------------------------- - * Function: H5VL__native_get_file - * - * Purpose: Utility routine to get file struct for an object via the - * native VOL connector. - * - * Returns: SUCCESS: A pointer to the H5F_t struct for the file - * associated with the object. - * FAILURE: NULL - * - *--------------------------------------------------------------------------- - */ -static H5F_t * -H5VL__native_get_file(void *obj, H5I_type_t type) -{ - H5F_t *ret_value = NULL; /* File pointer */ - H5O_loc_t *oloc = NULL; /* Object location for ID */ - - FUNC_ENTER_STATIC - - switch(type) { - case H5I_FILE: - ret_value = (H5F_t *)obj; - break; - - case H5I_GROUP: - { - H5G_t *grp; - grp = (H5G_t *)obj; - oloc = H5G_oloc(grp); - break; - } - - case H5I_DATATYPE: - { - H5T_t *dt; - dt = (H5T_t *)obj; - oloc = H5T_oloc(dt); - break; - } - - case H5I_DATASET: - { - H5D_t *dset; - dset = (H5D_t *)obj; - oloc = H5D_oloc(dset); - break; - } - - case H5I_ATTR: - { - H5A_t *attr; - attr = (H5A_t *)obj; - oloc = H5A_oloc(attr); - 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, NULL, "not a file or file object") - } - - if(!ret_value) { - if (!oloc) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "object is not assocated with a file") - ret_value = oloc->file; - } - if(!ret_value) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "object is not associated with a file") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5VL__native_get_file */ - - /*------------------------------------------------------------------------- * Function: H5VL__native_attr_create * @@ -1484,8 +1397,8 @@ H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t /* Create the file */ if(NULL == (new_file = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create file") - new_file->id_exists = TRUE; + ret_value = (void *)new_file; done: @@ -1520,8 +1433,8 @@ H5VL__native_file_open(const char *name, unsigned flags, hid_t fapl_id, /* Open the file */ if(NULL == (new_file = H5F_open(name, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") - new_file->id_exists = TRUE; + ret_value = (void *)new_file; done: @@ -1659,7 +1572,7 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, ssize_t *ret = va_arg(arguments, ssize_t *); size_t len; - if(NULL == (f = H5VL__native_get_file(obj, type))) + if(NULL == (f = H5F__get_file(obj, type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") len = HDstrlen(H5F_OPEN_NAME(f)); @@ -1710,7 +1623,7 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type, H5F_t *f = NULL; /* File to flush */ /* Get the file for the object */ - if(NULL == (f = H5VL__native_get_file(obj, type))) + if(NULL == (f = H5F__get_file(obj, type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Nothing to do if the file is read only. This determination is @@ -1745,6 +1658,7 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type, if(NULL == (new_file = H5F__reopen((H5F_t *)obj))) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") new_file->id_exists = TRUE; + *ret = (void *)new_file; break; } @@ -1894,7 +1808,7 @@ H5VL__native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR /* Get the file struct. This call is careful to not return the file pointer * for the top file in a mount hierarchy. */ - if(NULL == (f = H5VL__native_get_file(obj, type))) + if(NULL == (f = H5F__get_file(obj, type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get a file struct") /* Get the file info */ @@ -1958,15 +1872,15 @@ H5VL__native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR } /* H5Iget_file_id */ - case H5VL_FILE_GET_FILE: + case H5VL_FILE_GET_FILE_ID: { H5I_type_t type = va_arg(arguments, H5I_type_t); - void **ret = va_arg(arguments, void **); + hid_t *file_id = va_arg(arguments, hid_t *); - if(NULL == (f = H5VL__native_get_file(obj, type))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - f->id_exists = TRUE; - *ret = (void*)f; + if(NULL == (f = H5F__get_file(obj, type))) + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file or file object") + if((*file_id = H5F__get_file_id(f)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file ID") break; } |