From 5ef0958d32147de399d7e0762ca1c08c450627ce Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 7 May 2021 15:16:41 -0700 Subject: More normalization from develop --- src/H5F.c | 214 +++++++++++++++++++++------ src/H5FDpublic.h | 88 ++++++++++- src/H5Faccum.c | 8 +- src/H5Fcwfs.c | 2 +- src/H5Fdeprec.c | 6 +- src/H5Fefc.c | 2 +- src/H5Ffake.c | 2 - src/H5Fio.c | 18 ++- src/H5Fmodule.h | 30 +++- src/H5Fmount.c | 127 +--------------- src/H5Fsfile.c | 30 +++- src/H5Gbtree2.c | 154 ++++++++----------- src/H5Gdense.c | 169 ++++++++------------- src/H5Glink.c | 48 +++--- src/H5Gloc.c | 17 ++- src/H5Gmodule.h | 91 +++++++++++- src/H5Gname.c | 1 + src/H5Gnode.c | 102 ++++++------- src/H5Gstab.c | 30 ++-- src/H5Gtest.c | 1 + src/H5HF.c | 65 ++++---- src/H5HFcache.c | 48 +++--- src/H5HFdblock.c | 36 ++--- src/H5HFdtable.c | 50 +++---- src/H5HFhdr.c | 255 +++++++++++++++----------------- src/H5HFhuge.c | 54 +++---- src/H5HFiblock.c | 100 ++++++------- src/H5HFiter.c | 120 ++++++--------- src/H5HFman.c | 20 +-- src/H5HFpkg.h | 134 ++++++++--------- src/H5HFprivate.h | 17 ++- src/H5HFsection.c | 434 +++++++++++++++++++++++++----------------------------- src/H5HFspace.c | 22 +-- src/H5HFtest.c | 13 +- src/H5HFtiny.c | 74 +++++----- src/H5SMbtree2.c | 6 +- 36 files changed, 1315 insertions(+), 1273 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index 99e352e..19a115e 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -95,8 +95,8 @@ H5FL_EXTERN(H5VL_object_t); /*------------------------------------------------------------------------- * Function: H5Fget_create_plist * - * Purpose: Get an atom for a copy of the file-creation property list for - * this file. This function returns an atom with a copy of the + * Purpose: Get an ID for a copy of the file-creation property list for + * this file. This function returns an ID with a copy of the * properties used to create a file. * * Return: Success: Object ID for a copy of the file creation @@ -312,12 +312,12 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list) +H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list /*out*/) { ssize_t ret_value = 0; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE4("Zs", "iIuz*i", file_id, types, max_objs, oid_list); + H5TRACE4("Zs", "iIuzx", file_id, types, max_objs, oid_list); /* Check arguments */ if (0 == (types & H5F_OBJ_ALL)) @@ -391,13 +391,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle) +H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle /*out*/) { H5VL_object_t *vol_obj; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ii**x", file_id, fapl_id, file_handle); + H5TRACE3("e", "iix", file_id, fapl_id, file_handle); /* Check args */ if (!file_handle) @@ -704,7 +704,7 @@ done: herr_t H5Fclose(hid_t file_id) { - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); @@ -715,7 +715,7 @@ H5Fclose(hid_t file_id) /* Close the file */ if (H5I_dec_app_ref(file_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed") + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") done: FUNC_LEAVE_API(ret_value) @@ -747,19 +747,19 @@ H5Fdelete(const char *filename, hid_t fapl_id) /* Verify access property list and set up collective metadata if appropriate */ if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the VOL info from the fapl */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(fapl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") if (H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL connector info") + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get VOL connector info") /* Stash a copy of the "top-level" connector property, before any pass-through * connectors modify or unwrap it. */ if (H5CX_set_vol_connector_prop(&connector_prop) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL connector info in API context") + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set VOL connector info in API context") /* Make sure this is HDF5 storage for this VOL connector */ if (H5VL_file_specific(NULL, H5VL_FILE_IS_ACCESSIBLE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fapl_id, @@ -778,6 +778,121 @@ done: } /* end H5Fdelete() */ /*------------------------------------------------------------------------- + * Function: H5Fmount + * + * Purpose: Mount file CHILD_ID onto the group specified by LOC_ID and + * NAME using mount properties PLIST_ID. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) +{ + H5VL_object_t *loc_vol_obj = NULL; /* Parent object */ + H5VL_object_t *child_vol_obj = NULL; /* Child object */ + H5I_type_t loc_type; /* ID type of location */ + H5I_type_t child_type; /* ID type of child */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE4("e", "i*sii", loc_id, name, child_id, plist_id); + + /* Check arguments */ + loc_type = H5I_get_type(loc_id); + if (H5I_FILE != loc_type && H5I_GROUP != loc_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "loc_id parameter not a file or group ID") + if (!name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL") + if (!*name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be the empty string") + child_type = H5I_get_type(child_id); + if (H5I_FILE != child_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "child_id parameter not a file ID") + if (H5P_DEFAULT == plist_id) + plist_id = H5P_FILE_MOUNT_DEFAULT; + else if (TRUE != H5P_isa_class(plist_id, H5P_FILE_MOUNT)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "plist_id is not a file mount property list ID") + + /* Set up collective metadata if appropriate */ + if (H5CX_set_loc(loc_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Get the location object */ + if (NULL == (loc_vol_obj = (H5VL_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object") + + /* Get the child object */ + if (NULL == (child_vol_obj = (H5VL_object_t *)H5I_object(child_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get child object") + + /* Check if both objects are associated with the same VOL connector */ + if (loc_vol_obj->connector->cls->value != child_vol_obj->connector->cls->value) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL connector") + + /* Perform the mount operation */ + if (H5VL_file_specific(loc_vol_obj, H5VL_FILE_MOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, + (int)loc_type, name, child_vol_obj->data, plist_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Fmount() */ + +/*------------------------------------------------------------------------- + * Function: H5Funmount + * + * Purpose: Given a mount point, dissassociate the mount point's file + * from the file mounted there. Do not close either file. + * + * The mount point can either be the group in the parent or the + * root group of the mounted file (both groups have the same + * name). If the mount point was opened before the mount then + * it's the group in the parent, but if it was opened after the + * mount then it's the root group of the child. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5Funmount(hid_t loc_id, const char *name) +{ + H5VL_object_t *vol_obj = NULL; /* Parent object */ + H5I_type_t loc_type; /* ID type of location */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*s", loc_id, name); + + /* Check arguments */ + loc_type = H5I_get_type(loc_id); + if (H5I_FILE != loc_type && H5I_GROUP != loc_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "loc_id parameter not a file or group ID") + if (!name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL") + if (!*name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be the empty string") + + /* Set up collective metadata if appropriate */ + if (H5CX_set_loc(loc_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Get the location object */ + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object") + + /* Perform the unmount operation */ + if (H5VL_file_specific(vol_obj, H5VL_FILE_UNMOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, + (int)loc_type, name) < 0) + HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Funmount() */ + +/*------------------------------------------------------------------------- * Function: H5Freopen * * Purpose: Reopen a file. The new file handle which is returned points @@ -848,12 +963,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_intent(hid_t file_id, unsigned *intent_flags) +H5Fget_intent(hid_t file_id, unsigned *intent_flags /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", file_id, intent_flags); + H5TRACE2("e", "ix", file_id, intent_flags); /* If no intent flags were passed in, exit quietly */ if (intent_flags) { @@ -884,12 +999,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_fileno(hid_t file_id, unsigned long *fnumber) +H5Fget_fileno(hid_t file_id, unsigned long *fnumber /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Ul", file_id, fnumber); + H5TRACE2("e", "ix", file_id, fnumber); /* If no fnumber pointer was passed in, exit quietly */ if (fnumber) { @@ -952,13 +1067,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_filesize(hid_t file_id, hsize_t *size) +H5Fget_filesize(hid_t file_id, hsize_t *size /*out*/) { H5VL_object_t *vol_obj; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*h", file_id, size); + H5TRACE2("e", "ix", file_id, size); /* Check args */ if (!size) @@ -1013,13 +1128,13 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) +H5Fget_file_image(hid_t file_id, void *buf /*out*/, size_t buf_len) { H5VL_object_t *vol_obj; /* File object for file ID */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "i*xz", file_id, buf_ptr, buf_len); + H5TRACE3("Zs", "ixz", file_id, buf, buf_len); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1027,7 +1142,7 @@ H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) /* Get the file image */ if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_FILE_IMAGE, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, buf_ptr, &ret_value, buf_len) < 0) + H5_REQUEST_NULL, buf, &ret_value, buf_len) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get file image") done: @@ -1049,17 +1164,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) +H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config /*out*/) { H5VL_object_t *vol_obj = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Cc", file_id, config_ptr); + H5TRACE2("e", "ix", file_id, config); /* Check args */ - if ((NULL == config_ptr) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") + if ((NULL == config) || (config->version != H5AC__CURR_CACHE_CONFIG_VERSION)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config ptr") /* Get the file object */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) @@ -1067,7 +1182,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) /* Get the metadata cache configuration */ if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_CONF, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - config_ptr) < 0) + config) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get metadata cache configuration") done: @@ -1120,23 +1235,23 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr) +H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate /*out*/) { H5VL_object_t *vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*d", file_id, hit_rate_ptr); + H5TRACE2("e", "ix", file_id, hit_rate); /* Check args */ - if (NULL == hit_rate_ptr) + if (NULL == hit_rate) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL hit rate pointer") if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Get the current hit rate */ if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_HR, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - hit_rate_ptr) < 0) + hit_rate) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC hit rate") done: @@ -1157,14 +1272,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, - int *cur_num_entries_ptr) +H5Fget_mdc_size(hid_t file_id, size_t *max_size /*out*/, size_t *min_clean_size /*out*/, + size_t *cur_size /*out*/, int *cur_num_entries /*out*/) { H5VL_object_t *vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*z*z*z*Is", file_id, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr); + H5TRACE5("e", "ixxxx", file_id, max_size, min_clean_size, cur_size, cur_num_entries); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1172,7 +1287,7 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, /* Get the size data */ if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_SIZE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr) < 0) + max_size, min_clean_size, cur_size, cur_num_entries) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC size") done: @@ -1279,14 +1394,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) +H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo /*out*/) { H5VL_object_t *vol_obj = NULL; H5I_type_t type; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*FI", obj_id, finfo); + H5TRACE2("e", "ix", obj_id, finfo); /* Check args */ if (!finfo) @@ -1322,13 +1437,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info) +H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info /*out*/) { H5VL_object_t *vol_obj = NULL; /* File object for file ID */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*!", file_id, info); + H5TRACE2("e", "ix", file_id, info); /* Check args */ if (!info) @@ -1553,13 +1668,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled, hbool_t *is_currently_logging) +H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled /*out*/, hbool_t *is_currently_logging /*out*/) { H5VL_object_t *vol_obj; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*b*b", file_id, is_enabled, is_currently_logging); + H5TRACE3("e", "ixx", file_id, is_enabled, is_currently_logging); /* Sanity check */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1690,14 +1805,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2], unsigned misses[2], - unsigned evictions[2], unsigned bypasses[2]) +H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2] /*out*/, unsigned hits[2] /*out*/, + unsigned misses[2] /*out*/, unsigned evictions[2] /*out*/, + unsigned bypasses[2] /*out*/) { H5VL_object_t *vol_obj; /* File object */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "i*Iu*Iu*Iu*Iu*Iu", file_id, accesses, hits, misses, evictions, bypasses); + H5TRACE6("e", "ixxxxx", file_id, accesses, hits, misses, evictions, bypasses); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1728,13 +1844,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_len) +H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr /*out*/, hsize_t *image_len /*out*/) { H5VL_object_t *vol_obj; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*a*h", file_id, image_addr, image_len); + H5TRACE3("e", "ixx", file_id, image_addr, image_len); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1761,13 +1877,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_eoa(hid_t file_id, haddr_t *eoa) +H5Fget_eoa(hid_t file_id, haddr_t *eoa /*out*/) { H5VL_object_t *vol_obj; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*a", file_id, eoa); + H5TRACE2("e", "ix", file_id, eoa); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1827,13 +1943,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize) +H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize /*out*/) { H5VL_object_t *vol_obj = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", file_id, minimize); + H5TRACE2("e", "ix", file_id, minimize); if (NULL == minimize) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "out pointer 'minimize' cannot be NULL") diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 2f172e8..46f8803 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -334,29 +334,113 @@ struct H5FD_t { hbool_t paged_aggr; /* Paged aggregation for file space is enabled or not */ }; -/* Define enum for the source of file image callbacks */ +/** + * Define enum for the source of file image callbacks + */ +//! typedef enum { H5FD_FILE_IMAGE_OP_NO_OP, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + /**< Passed to the \p image_malloc and \p image_memcpy callbacks when a + * file image buffer is to be copied while being set in a file access + * property list (FAPL)*/ H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, + /**< Passed to the \p image_malloc and \p image_memcpy callbacks + * when a file image buffer is to be copied when a FAPL is copied*/ H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + /** -/* Define structure to hold file image callbacks */ +/** + * Define structure to hold file image callbacks + */ +//! typedef struct { + /** + * \param[in] size Size in bytes of the file image buffer to allocate + * \param[in] file_image_op A value from H5FD_file_image_op_t indicating + * the operation being performed on the file image + * when this callback is invoked + * \param[in] udata Value passed in in the H5Pset_file_image_callbacks + * parameter \p udata + */ + //! void *(*image_malloc)(size_t size, H5FD_file_image_op_t file_image_op, void *udata); + //! + /** + * \param[in] dest Address of the destination buffer + * \param[in] src Address of the source buffer + * \param[in] file_image_op A value from #H5FD_file_image_op_t indicating + * the operation being performed on the file image + * when this callback is invoked + * \param[in] udata Value passed in in the H5Pset_file_image_callbacks + * parameter \p udata + */ + //! void *(*image_memcpy)(void *dest, const void *src, size_t size, H5FD_file_image_op_t file_image_op, void *udata); + //! + /** + * \param[in] ptr Pointer to the buffer being reallocated + * \param[in] file_image_op A value from #H5FD_file_image_op_t indicating + * the operation being performed on the file image + * when this callback is invoked + * \param[in] udata Value passed in in the H5Pset_file_image_callbacks + * parameter \p udata + */ + //! void *(*image_realloc)(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *udata); + //! + /** + * \param[in] udata Value passed in in the H5Pset_file_image_callbacks + * parameter \p udata + */ + //! herr_t (*image_free)(void *ptr, H5FD_file_image_op_t file_image_op, void *udata); + //! + /** + * \param[in] udata Value passed in in the H5Pset_file_image_callbacks + * parameter \p udata + */ + //! void *(*udata_copy)(void *udata); + //! + /** + * \param[in] udata Value passed in in the H5Pset_file_image_callbacks + * parameter \p udata + */ + //! herr_t (*udata_free)(void *udata); + //! + /** + * \brief The final field in the #H5FD_file_image_callbacks_t struct, + * provides a pointer to user-defined data. This pointer will be + * passed to the image_malloc, image_memcpy, image_realloc, and + * image_free callbacks. Define udata as NULL if no user-defined + * data is provided. + */ void *udata; } H5FD_file_image_callbacks_t; +//! #ifdef __cplusplus extern "C" { diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 894da5e..aed5812 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -15,7 +15,7 @@ * * Created: H5Faccum.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File metadata "accumulator" routines. (Used to * cache small metadata I/Os and group them into a @@ -95,7 +95,6 @@ H5FL_BLK_DEFINE_STATIC(meta_accum); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -265,7 +264,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 11 2009 * *------------------------------------------------------------------------- @@ -407,7 +405,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -847,7 +844,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -1014,7 +1010,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -1057,7 +1052,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c index 073ccb2..d689737 100644 --- a/src/H5Fcwfs.c +++ b/src/H5Fcwfs.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 19, 2011 * * Purpose: Each file has a small cache of global heap collections called diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 0bd56b3..b482961 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Fdeprec.c * October 1 2009 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5F interface. These * functions are here for compatibility purposes and may be @@ -87,7 +87,7 @@ *------------------------------------------------------------------------- */ herr_t -H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) +H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo /*out*/) { H5VL_object_t *vol_obj = NULL; H5I_type_t type; @@ -95,7 +95,7 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*!", obj_id, finfo); + H5TRACE2("e", "ix", obj_id, finfo); /* Check args */ if (!finfo) diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 3909743..3f9a22f 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -15,7 +15,7 @@ * * Created: H5Defc.c * December 13, 2010 - * Neil Fortner + * Neil Fortner * * Purpose: External file caching routines - implements a * cache of external files to minimize the number of diff --git a/src/H5Ffake.c b/src/H5Ffake.c index c3e9257..1aae0fd 100644 --- a/src/H5Ffake.c +++ b/src/H5Ffake.c @@ -32,7 +32,6 @@ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 2, 2006 * *------------------------------------------------------------------------- @@ -76,7 +75,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 2, 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Fio.c b/src/H5Fio.c index 6265182..ca069e0 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -15,7 +15,7 @@ * * Created: H5Fio.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File I/O routines. * @@ -74,6 +74,10 @@ * address for the file. * * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Jul 10 1997 + * *------------------------------------------------------------------------- */ herr_t @@ -108,6 +112,10 @@ done: * address for the file. * * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Jul 10 1997 + * *------------------------------------------------------------------------- */ herr_t @@ -124,6 +132,10 @@ H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf / * address. * * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Jul 10 1997 + * *------------------------------------------------------------------------- */ herr_t @@ -159,6 +171,10 @@ done: * address. * * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Jul 10 1997 + * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index 33c302a..7f0299a 100644 --- a/src/H5Fmodule.h +++ b/src/H5Fmodule.h @@ -31,8 +31,34 @@ /** * \defgroup H5F H5F - * \brief File Interface - * \todo Describe concisely what the functions in this module are about. + * + * Use the functions in this module to manage HDF5 files. + * + * In the code snippets below, we show the skeletal life cycle of an HDF5 file, + * when creating a new file (left) or when opening an existing file (right). + * File creation is essentially controlled through \ref FCPL, and file access to + * new and existing files is controlled through \ref FAPL. The file \c name and + * creation or access \c mode control the interaction with the underlying + * storage such as file systems. + * + * \Emph{Proper error handling is part of the life cycle.} + * + * + * + * + * + * + *
CreateOpen
+ * \snippet H5F_examples.c life_cycle + * + * \snippet H5F_examples.c life_cycle_w_open + *
+ * + * In addition to general file management functions, there are three categories + * of functions that deal with advanced file management tasks and use cases: + * 1. The control of the HDF5 \ref MDC + * 2. The use of (MPI-) \ref PH5F HDF5 + * 3. The \ref SWMR pattern * * \defgroup MDC Metadata Cache * \ingroup H5F diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 5eeb341..f107c98 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -424,121 +424,6 @@ H5F_is_mount(const H5F_t *file) } /* end H5F_is_mount() */ /*------------------------------------------------------------------------- - * Function: H5Fmount - * - * Purpose: Mount file CHILD_ID onto the group specified by LOC_ID and - * NAME using mount properties PLIST_ID. - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) -{ - H5VL_object_t *loc_vol_obj = NULL; /* Parent object */ - H5VL_object_t *child_vol_obj = NULL; /* Child object */ - H5I_type_t loc_type; /* ID type of location */ - H5I_type_t child_type; /* ID type of child */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*sii", loc_id, name, child_id, plist_id); - - /* Check arguments */ - loc_type = H5I_get_type(loc_id); - if (H5I_FILE != loc_type && H5I_GROUP != loc_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "loc_id parameter not a file or group ID") - if (!name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL") - if (!*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be the empty string") - child_type = H5I_get_type(child_id); - if (H5I_FILE != child_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "child_id parameter not a file ID") - if (H5P_DEFAULT == plist_id) - plist_id = H5P_FILE_MOUNT_DEFAULT; - else if (TRUE != H5P_isa_class(plist_id, H5P_FILE_MOUNT)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "plist_id is not a file mount property list ID") - - /* Set up collective metadata if appropriate */ - if (H5CX_set_loc(loc_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") - - /* Get the location object */ - if (NULL == (loc_vol_obj = (H5VL_object_t *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object") - - /* Get the child object */ - if (NULL == (child_vol_obj = (H5VL_object_t *)H5I_object(child_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get child object") - - /* Check if both objects are associated with the same VOL connector */ - if (loc_vol_obj->connector->cls->value != child_vol_obj->connector->cls->value) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL connector") - - /* Perform the mount operation */ - if (H5VL_file_specific(loc_vol_obj, H5VL_FILE_MOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - (int)loc_type, name, child_vol_obj->data, plist_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Fmount() */ - -/*------------------------------------------------------------------------- - * Function: H5Funmount - * - * Purpose: Given a mount point, dissassociate the mount point's file - * from the file mounted there. Do not close either file. - * - * The mount point can either be the group in the parent or the - * root group of the mounted file (both groups have the same - * name). If the mount point was opened before the mount then - * it's the group in the parent, but if it was opened after the - * mount then it's the root group of the child. - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5Funmount(hid_t loc_id, const char *name) -{ - H5VL_object_t *vol_obj = NULL; /* Parent object */ - H5I_type_t loc_type; /* ID type of location */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*s", loc_id, name); - - /* Check arguments */ - loc_type = H5I_get_type(loc_id); - if (H5I_FILE != loc_type && H5I_GROUP != loc_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "loc_id parameter not a file or group ID") - if (!name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL") - if (!*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be the empty string") - - /* Set up collective metadata if appropriate */ - if (H5CX_set_loc(loc_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") - - /* Get the location object */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object") - - /* Perform the unmount operation */ - if (H5VL_file_specific(vol_obj, H5VL_FILE_UNMOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - (int)loc_type, name) < 0) - HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Funmount() */ - -/*------------------------------------------------------------------------- * Function: H5F__mount_count_ids_recurse * * Purpose: Helper routine for counting number of open IDs in mount @@ -621,7 +506,7 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) } /* end H5F__mount_count_ids() */ /*------------------------------------------------------------------------- - * Function: H5F_flush_mounts_recurse + * Function: H5F__flush_mounts_recurse * * Purpose: Flush a mount hierarchy, recursively * @@ -633,20 +518,20 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) *------------------------------------------------------------------------- */ static herr_t -H5F_flush_mounts_recurse(H5F_t *f) +H5F__flush_mounts_recurse(H5F_t *f) { unsigned nerrors = 0; /* Errors from recursive flushes */ unsigned u; /* Index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); /* Flush all child files, not stopping for errors */ for (u = 0; u < f->shared->mtab.nmounts; u++) - if (H5F_flush_mounts_recurse(f->shared->mtab.child[u].file) < 0) + if (H5F__flush_mounts_recurse(f->shared->mtab.child[u].file) < 0) nerrors++; /* Call the "real" flush routine, for this file */ @@ -659,7 +544,7 @@ H5F_flush_mounts_recurse(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_flush_mounts_recurse() */ +} /* end H5F__flush_mounts_recurse() */ /*------------------------------------------------------------------------- * Function: H5F_flush_mounts @@ -688,7 +573,7 @@ H5F_flush_mounts(H5F_t *f) f = f->parent; /* Flush the mounted file hierarchy */ - if (H5F_flush_mounts_recurse(f) < 0) + if (H5F__flush_mounts_recurse(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") done: diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index 34bd1b4..be45e78 100644 --- a/src/H5Fsfile.c +++ b/src/H5Fsfile.c @@ -135,14 +135,28 @@ done: H5F_shared_t * H5F__sfile_search(H5FD_t *lf) { - H5F_sfile_node_t *curr; - - for (curr = H5F_sfile_head_g; curr != NULL; curr = curr->next) { - if (curr->shared->lf == lf) - return curr->shared; - } - return NULL; -} + H5F_sfile_node_t *curr; /* Current shared file node */ + H5F_shared_t * ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_NOERR + + /* Sanity check */ + HDassert(lf); + + /* Iterate through low-level files for matching low-level file info */ + curr = H5F_sfile_head_g; + while (curr) { + /* Check for match */ + if (0 == H5FD_cmp(curr->shared->lf, lf)) + HGOTO_DONE(curr->shared) + + /* Advance to next shared file node */ + curr = curr->next; + } /* end while */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__sfile_search() */ /*------------------------------------------------------------------------- * Function: H5F__sfile_remove diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 747abe7..dd147ae 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -15,7 +15,7 @@ * * Created: H5Gbtree2.c * Sep 9 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: v2 B-tree callbacks for indexing fields on links * @@ -70,23 +70,23 @@ typedef struct H5G_fh_ud_cmp_t { /* v2 B-tree function callbacks */ /* v2 B-tree driver callbacks for 'creation order' index */ -static herr_t H5G_dense_btree2_corder_store(void *native, const void *udata); -static herr_t H5G_dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result); -static herr_t H5G_dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx); -static herr_t H5G_dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *record, - const void *_udata); +static herr_t H5G__dense_btree2_corder_store(void *native, const void *udata); +static herr_t H5G__dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result); +static herr_t H5G__dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx); +static herr_t H5G__dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx); +static herr_t H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *record, + const void *_udata); /* v2 B-tree driver callbacks for 'name' index */ -static herr_t H5G_dense_btree2_name_store(void *native, const void *udata); +static herr_t H5G__dense_btree2_name_store(void *native, const void *udata); static herr_t H5G__dense_btree2_name_compare(const void *rec1, const void *rec2, int *result); -static herr_t H5G_dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx); -static herr_t H5G_dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *record, - const void *_udata); +static herr_t H5G__dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx); +static herr_t H5G__dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx); +static herr_t H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *record, + const void *_udata); /* Fractal heap function callbacks */ -static herr_t H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); +static herr_t H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); /*********************/ /* Package Variables */ @@ -99,11 +99,11 @@ const H5B2_class_t H5G_BT2_NAME[1] = {{ sizeof(H5G_dense_bt2_name_rec_t), /* Size of native record */ NULL, /* Create client callback context */ NULL, /* Destroy client callback context */ - H5G_dense_btree2_name_store, /* Record storage callback */ + H5G__dense_btree2_name_store, /* Record storage callback */ H5G__dense_btree2_name_compare, /* Record comparison callback */ - H5G_dense_btree2_name_encode, /* Record encoding callback */ - H5G_dense_btree2_name_decode, /* Record decoding callback */ - H5G_dense_btree2_name_debug /* Record debugging callback */ + H5G__dense_btree2_name_encode, /* Record encoding callback */ + H5G__dense_btree2_name_decode, /* Record decoding callback */ + H5G__dense_btree2_name_debug /* Record debugging callback */ }}; /* v2 B-tree class for indexing 'creation order' field of links */ @@ -114,11 +114,11 @@ const H5B2_class_t H5G_BT2_CORDER[1] = {{ sizeof(H5G_dense_bt2_corder_rec_t), /* Size of native record */ NULL, /* Create client callback context */ NULL, /* Destroy client callback context */ - H5G_dense_btree2_corder_store, /* Record storage callback */ - H5G_dense_btree2_corder_compare, /* Record comparison callback */ - H5G_dense_btree2_corder_encode, /* Record encoding callback */ - H5G_dense_btree2_corder_decode, /* Record decoding callback */ - H5G_dense_btree2_corder_debug /* Record debugging callback */ + H5G__dense_btree2_corder_store, /* Record storage callback */ + H5G__dense_btree2_corder_compare, /* Record comparison callback */ + H5G__dense_btree2_corder_encode, /* Record encoding callback */ + H5G__dense_btree2_corder_decode, /* Record decoding callback */ + H5G__dense_btree2_corder_debug /* Record debugging callback */ }}; /*****************************/ @@ -130,7 +130,7 @@ const H5B2_class_t H5G_BT2_CORDER[1] = {{ /*******************/ /*------------------------------------------------------------------------- - * Function: H5G_dense_fh_name_cmp + * Function: H5G__dense_fh_name_cmp * * Purpose: Compares the name of a link in a fractal heap to another * name @@ -138,19 +138,18 @@ const H5B2_class_t H5G_BT2_CORDER[1] = {{ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) +H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_cmp_t *udata = (H5G_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */ H5O_link_t * lnk; /* Pointer to link created from heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if (NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, @@ -171,10 +170,10 @@ H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_fh_name_cmp() */ +} /* end H5G__dense_fh_name_cmp() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_store + * Function: H5G__dense_btree2_name_store * * Purpose: Store user information into native record for v2 B-tree * @@ -187,19 +186,19 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_store(void *_nrecord, const void *_udata) +H5G__dense_btree2_name_store(void *_nrecord, const void *_udata) { const H5G_bt2_ud_ins_t * udata = (const H5G_bt2_ud_ins_t *)_udata; H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Copy user information info native record */ nrecord->hash = udata->common.name_hash; H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_store() */ +} /* H5G__dense_btree2_name_store() */ /*------------------------------------------------------------------------- * Function: H5G__dense_btree2_name_compare @@ -228,17 +227,6 @@ H5G__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int HDassert(bt2_udata); HDassert(bt2_rec); -#ifdef QAK - { - unsigned u; - - HDfprintf(stderr, "%s: bt2_udata = {'%s', %x}\n", "H5G__dense_btree2_name_compare", bt2_udata->name, - (unsigned)bt2_udata->name_hash); - HDfprintf(stderr, "%s: bt2_rec = {%x, ", "H5G__dense_btree2_name_compare", (unsigned)bt2_rec->hash); - for (u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) - HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); - } -#endif /* QAK */ /* Check hash value */ if (bt2_udata->name_hash < bt2_rec->hash) *result = (-1); @@ -261,7 +249,7 @@ H5G__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int fh_udata.cmp = 0; /* Check if the user's link and the B-tree's link have the same name */ - if (H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G_dense_fh_name_cmp, &fh_udata) < 0) + if (H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G__dense_fh_name_cmp, &fh_udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") /* Callback will set comparison value */ @@ -273,7 +261,7 @@ done: } /* H5G__dense_btree2_name_compare() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_encode + * Function: H5G__dense_btree2_name_encode * * Purpose: Encode native information into raw form for storing on disk * @@ -286,21 +274,21 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Encode the record's fields */ UINT32ENCODE(raw, nrecord->hash) H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_encode() */ +} /* H5G__dense_btree2_name_encode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_decode + * Function: H5G__dense_btree2_name_decode * * Purpose: Decode raw disk form of record into native form * @@ -313,21 +301,21 @@ H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Decode the record's fields */ UINT32DECODE(raw, nrecord->hash) H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_decode() */ +} /* H5G__dense_btree2_name_decode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_debug + * Function: H5G__dense_btree2_name_debug * * Purpose: Debug native form of record * @@ -340,23 +328,23 @@ H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_nrecord, + const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDfprintf(stream, "%*s%-*s {%x, ", indent, "", fwidth, "Record:", (unsigned)nrecord->hash); for (u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_debug() */ +} /* H5G__dense_btree2_name_debug() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_store + * Function: H5G__dense_btree2_corder_store * * Purpose: Store user information into native record for v2 B-tree * @@ -369,22 +357,22 @@ H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_n *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata) +H5G__dense_btree2_corder_store(void *_nrecord, const void *_udata) { const H5G_bt2_ud_ins_t * udata = (const H5G_bt2_ud_ins_t *)_udata; H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Copy user information info native record */ nrecord->corder = udata->common.corder; H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_store() */ +} /* H5G__dense_btree2_corder_store() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_compare + * Function: H5G__dense_btree2_corder_compare * * Purpose: Compare two native information records, according to some key * @@ -398,29 +386,17 @@ H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result) +H5G__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result) { const H5G_bt2_ud_common_t * bt2_udata = (const H5G_bt2_ud_common_t *)_bt2_udata; const H5G_dense_bt2_corder_rec_t *bt2_rec = (const H5G_dense_bt2_corder_rec_t *)_bt2_rec; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(bt2_udata); HDassert(bt2_rec); -#ifdef QAK - { - unsigned u; - - HDfprintf(stderr, "%s: bt2_udata->corder = %Hd\n", "H5G_dense_btree2_corder_compare", - (hsize_t)bt2_udata->corder); - HDfprintf(stderr, "%s: bt2_rec = {%Hu, ", "H5G_dense_btree2_corder_compare", - (hsize_t)bt2_rec->corder); - for (u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) - HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); - } -#endif /* QAK */ /* Check creation order value */ if (bt2_udata->corder < bt2_rec->corder) *result = -1; @@ -430,10 +406,10 @@ H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, in *result = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_compare() */ +} /* H5G__dense_btree2_corder_compare() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_encode + * Function: H5G__dense_btree2_corder_encode * * Purpose: Encode native information into raw form for storing on disk * @@ -446,21 +422,21 @@ H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, in *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Encode the record's fields */ INT64ENCODE(raw, nrecord->corder) H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_encode() */ +} /* H5G__dense_btree2_corder_encode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_decode + * Function: H5G__dense_btree2_corder_decode * * Purpose: Decode raw disk form of record into native form * @@ -473,21 +449,21 @@ H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Decode the record's fields */ INT64DECODE(raw, nrecord->corder) H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_decode() */ +} /* H5G__dense_btree2_corder_decode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_debug + * Function: H5G__dense_btree2_corder_debug * * Purpose: Debug native form of record * @@ -500,17 +476,17 @@ H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *_nrecord, + const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDfprintf(stream, "%*s%-*s {%llu, ", indent, "", fwidth, "Record:", (unsigned long long)nrecord->corder); for (u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_debug() */ +} /* H5G__dense_btree2_corder_debug() */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 84df574..171df9e 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -15,7 +15,7 @@ * * Created: H5Gdense.c * Sep 9 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for operating on "dense" link storage for a * group in a file. @@ -241,7 +241,6 @@ typedef struct { * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2006 * *------------------------------------------------------------------------- @@ -285,17 +284,11 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline) /* Retrieve the heap's address in the file */ if (H5HF_get_heap_addr(fheap, &(linfo->fheap_addr)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get fractal heap address") -#ifdef QAK - HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr); -#endif /* QAK */ /* Retrieve the heap's ID length in the file */ if (H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") HDassert(fheap_id_len == H5G_DENSE_FHEAP_ID_LEN); -#ifdef QAK - HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); -#endif /* QAK */ /* Create the name index v2 B-tree */ HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam)); @@ -312,9 +305,6 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline) /* Retrieve the v2 B-tree's address in the file */ if (H5B2_get_addr(bt2_name, &(linfo->name_bt2_addr)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index") -#ifdef QAK - HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr); -#endif /* QAK */ /* Check if we should create a creation order index v2 B-tree */ if (linfo->index_corder) { @@ -333,10 +323,7 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline) /* Retrieve the v2 B-tree's address in the file */ if (H5B2_get_addr(bt2_corder, &(linfo->corder_bt2_addr)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index") -#ifdef QAK - HDfprintf(stderr, "%s: linfo->corder_bt2_addr = %a\n", FUNC, linfo->corder_bt2_addr); -#endif /* QAK */ - } /* end if */ + } /* end if */ done: /* Close the open objects */ @@ -358,7 +345,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- @@ -384,18 +370,10 @@ H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk) HDassert(f); HDassert(linfo); HDassert(lnk); -#ifdef QAK - HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr); - HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr); -#endif /* QAK */ /* Find out the size of buffer needed for serialized link */ if ((link_size = H5O_msg_raw_size(f, H5O_LINK_ID, FALSE, lnk)) == 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size") -#ifdef QAK - HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDstrlen(lnk->name), - link_size); -#endif /* QAK */ /* Wrap the local buffer for serialized link */ if (NULL == (wb = H5WB_wrap(link_buf, sizeof(link_buf)))) @@ -462,26 +440,25 @@ done: } /* end H5G__dense_insert() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_cb + * Function: H5G__dense_lookup_cb * * Purpose: Callback when a link is located in an index * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk) +H5G__dense_lookup_cb(const void *_lnk, void *_user_lnk) { const H5O_link_t *lnk = (const H5O_link_t *)_lnk; /* Record from B-tree */ H5O_link_t * user_lnk = (H5O_link_t *)_user_lnk; /* User data from v2 B-tree link lookup */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -495,17 +472,16 @@ H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_cb() */ +} /* end H5G__dense_lookup_cb() */ /*------------------------------------------------------------------------- * Function: H5G__dense_lookup * * Purpose: Look up a link within a group that uses dense link storage * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- @@ -541,7 +517,7 @@ H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, H5O_link udata.fheap = fheap; udata.name = name; udata.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0); - udata.found_op = H5G_dense_lookup_cb; /* v2 B-tree comparison callback */ + udata.found_op = H5G__dense_lookup_cb; /* v2 B-tree comparison callback */ udata.found_op_data = lnk; /* Find & copy the named link in the 'name' index */ @@ -559,7 +535,7 @@ done: } /* end H5G__dense_lookup() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_by_idx_fh_cb + * Function: H5G__dense_lookup_by_idx_fh_cb * * Purpose: Callback for fractal heap operator, to make copy of link when * when lookup up a link by index @@ -567,19 +543,18 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_lbi_t *udata = (H5G_fh_ud_lbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t * tmp_lnk = NULL; /* Temporary pointer to link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information & keep a copy */ if (NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, @@ -596,30 +571,29 @@ done: H5O_msg_free(H5O_LINK_ID, tmp_lnk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_by_idx_fh_cb() */ +} /* end H5G__dense_lookup_by_idx_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_by_idx_bt2_cb + * Function: H5G__dense_lookup_by_idx_bt2_cb * * Purpose: v2 B-tree callback for dense link storage lookup by index * * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_lbi_t * bt2_udata = (H5G_bt2_ud_lbi_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_lbi_t fh_udata; /* User data for fractal heap 'op' callback */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Prepare user data for callback */ /* down */ @@ -627,12 +601,12 @@ H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.lnk = bt2_udata->lnk; /* Call fractal heap 'op' routine, to copy the link information */ - if (H5HF_op(bt2_udata->fheap, record->id, H5G_dense_lookup_by_idx_fh_cb, &fh_udata) < 0) + if (H5HF_op(bt2_udata->fheap, record->id, H5G__dense_lookup_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "link found callback failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_by_idx_bt2_cb() */ +} /* end H5G__dense_lookup_by_idx_bt2_cb() */ /*------------------------------------------------------------------------- * Function: H5G__dense_lookup_by_idx @@ -643,7 +617,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- @@ -713,7 +686,7 @@ H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type udata.lnk = lnk; /* Find & copy the link in the appropriate index */ - if (H5B2_index(bt2, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0) + if (H5B2_index(bt2, order, n, H5G__dense_lookup_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in index") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ @@ -743,7 +716,7 @@ done: } /* end H5G__dense_lookup_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_build_table_cb + * Function: H5G__dense_build_table_cb * * Purpose: Callback routine for building table of links from dense * link storage. @@ -752,18 +725,17 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 25 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata) +H5G__dense_build_table_cb(const H5O_link_t *lnk, void *_udata) { H5G_dense_bt_ud_t *udata = (H5G_dense_bt_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(lnk); @@ -779,7 +751,7 @@ H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_build_table_cb() */ +} /* end H5G__dense_build_table_cb() */ /*------------------------------------------------------------------------- * Function: H5G__dense_build_table @@ -828,7 +800,7 @@ H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, /* Iterate over the links in the group, building a table of the link messages */ if (H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, - H5G_dense_build_table_cb, &udata) < 0) + H5G__dense_build_table_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Sort link table in correct iteration order */ @@ -843,7 +815,7 @@ done: } /* end H5G__dense_build_table() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_iterate_fh_cb + * Function: H5G__dense_iterate_fh_cb * * Purpose: Callback for fractal heap operator, to make user's callback * when iterating over links @@ -851,18 +823,17 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_it_t *udata = (H5G_fh_ud_it_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information & keep a copy */ /* (we make a copy instead of calling the user/library callback directly in @@ -877,29 +848,28 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_iterate_fh_cb() */ +} /* end H5G__dense_iterate_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_iterate_bt2_cb + * Function: H5G__dense_iterate_bt2_cb * * Purpose: v2 B-tree callback for dense link storage iterator * * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_it_t * bt2_udata = (H5G_bt2_ud_it_t *)_bt2_udata; /* User data for callback */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check for skipping links */ if (bt2_udata->skip > 0) @@ -912,7 +882,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.f = bt2_udata->f; /* Call fractal heap 'op' routine, to copy the link information */ - if (H5HF_op(bt2_udata->fheap, record->id, H5G_dense_iterate_fh_cb, &fh_udata) < 0) + if (H5HF_op(bt2_udata->fheap, record->id, H5G__dense_iterate_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "heap op callback failed") /* Make the callback */ @@ -932,7 +902,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_iterate_bt2_cb() */ +} /* end H5G__dense_iterate_bt2_cb() */ /*------------------------------------------------------------------------- * Function: H5G__dense_iterate @@ -942,7 +912,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- @@ -1019,7 +988,7 @@ H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_i /* Iterate over the records in the v2 B-tree's "native" order */ /* (by hash of name) */ - if ((ret_value = H5B2_iterate(bt2, H5G_dense_iterate_bt2_cb, &udata)) < 0) + if ((ret_value = H5B2_iterate(bt2, H5G__dense_iterate_bt2_cb, &udata)) < 0) HERROR(H5E_SYM, H5E_BADITER, "link iteration failed"); /* Update the last link examined, if requested */ @@ -1049,7 +1018,7 @@ done: } /* end H5G__dense_iterate() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_get_name_by_idx_fh_cb + * Function: H5G__dense_get_name_by_idx_fh_cb * * Purpose: Callback for fractal heap operator, to retrieve name according * to an index @@ -1057,19 +1026,18 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 19 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_gnbi_t *udata = (H5G_fh_ud_gnbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t * lnk; /* Pointer to link created from heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if (NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, @@ -1091,30 +1059,29 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_get_name_by_idx_fh_cb() */ +} /* end H5G__dense_get_name_by_idx_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_get_name_by_idx_bt2_cb + * Function: H5G__dense_get_name_by_idx_bt2_cb * * Purpose: v2 B-tree callback for dense link storage 'get name by idx' call * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 19 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_gnbi_t * bt2_udata = (H5G_bt2_ud_gnbi_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_gnbi_t fh_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Prepare user data for callback */ /* down */ @@ -1123,7 +1090,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.name_size = bt2_udata->name_size; /* Call fractal heap 'op' routine, to perform user callback */ - if (H5HF_op(bt2_udata->fheap, record->id, H5G_dense_get_name_by_idx_fh_cb, &fh_udata) < 0) + if (H5HF_op(bt2_udata->fheap, record->id, H5G__dense_get_name_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link found callback failed") /* Set the name's full length to return */ @@ -1131,7 +1098,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_get_name_by_idx_bt2_cb() */ +} /* end H5G__dense_get_name_by_idx_bt2_cb() */ /*------------------------------------------------------------------------- * Function: H5G__dense_get_name_by_idx @@ -1142,7 +1109,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 19 2006 * *------------------------------------------------------------------------- @@ -1212,7 +1178,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, H5 udata.name_size = size; /* Retrieve the name according to the v2 B-tree's index order */ - if (H5B2_index(bt2, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0) + if (H5B2_index(bt2, order, n, H5G__dense_get_name_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLIST, FAIL, "can't locate object in v2 B-tree") /* Set return value */ @@ -1251,27 +1217,26 @@ done: } /* end H5G__dense_get_name_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_fh_cb + * Function: H5G__dense_remove_fh_cb * * Purpose: Callback for fractal heap operator when removing links * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rm_t *udata = (H5G_fh_ud_rm_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t * lnk = NULL; /* Pointer to link created from heap object */ H5B2_t * bt2 = NULL; /* v2 B-tree handle for index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if (NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, @@ -1314,30 +1279,29 @@ done: H5O_msg_free(H5O_LINK_ID, lnk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_fh_cb() */ +} /* end H5G__dense_remove_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_bt2_cb + * Function: H5G__dense_remove_bt2_cb * * Purpose: v2 B-tree callback for dense link storage record removal * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_remove_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_rm_t * bt2_udata = (H5G_bt2_ud_rm_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_rm_t fh_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->common.f; @@ -1346,7 +1310,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.replace_names = bt2_udata->replace_names; /* Call fractal heap 'op' routine, to perform user callback */ - if (H5HF_op(bt2_udata->common.fheap, record->id, H5G_dense_remove_fh_cb, &fh_udata) < 0) + if (H5HF_op(bt2_udata->common.fheap, record->id, H5G__dense_remove_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") /* Remove record from fractal heap, if requested */ @@ -1356,7 +1320,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_bt2_cb() */ +} /* end H5G__dense_remove_bt2_cb() */ /*------------------------------------------------------------------------- * Function: H5G__dense_remove @@ -1366,7 +1330,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- @@ -1409,7 +1372,7 @@ H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_ udata.replace_names = TRUE; /* Remove the record from the name index v2 B-tree */ - if (H5B2_remove(bt2, &udata, H5G_dense_remove_bt2_cb, &udata) < 0) + if (H5B2_remove(bt2, &udata, H5G__dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from name index v2 B-tree") done: @@ -1423,25 +1386,24 @@ done: } /* end H5G__dense_remove() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_by_idx_fh_cb + * Function: H5G__dense_remove_by_idx_fh_cb * * Purpose: Callback for fractal heap operator when removing links by index * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 15 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rmbi_t *udata = (H5G_fh_ud_rmbi_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if (NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, @@ -1452,23 +1414,22 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_by_idx_fh_cb() */ +} /* end H5G__dense_remove_by_idx_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_by_idx_bt2_cb + * Function: H5G__dense_remove_by_idx_bt2_cb * * Purpose: v2 B-tree callback for dense link storage record removal by index * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 15 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) { H5G_bt2_ud_rmbi_t *bt2_udata = (H5G_bt2_ud_rmbi_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_rmbi_t fh_udata; /* User data for fractal heap 'op' callback */ @@ -1476,7 +1437,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) const uint8_t * heap_id; /* Heap ID for link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Determine the index being used */ if (bt2_udata->idx_type == H5_INDEX_NAME) { @@ -1499,7 +1460,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.lnk = NULL; /* Call fractal heap 'op' routine, to perform user callback */ - if (H5HF_op(bt2_udata->fheap, heap_id, H5G_dense_remove_by_idx_fh_cb, &fh_udata) < 0) + if (H5HF_op(bt2_udata->fheap, heap_id, H5G__dense_remove_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") HDassert(fh_udata.lnk); @@ -1559,7 +1520,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for 'other' index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_by_idx_bt2_cb() */ +} /* end H5G__dense_remove_by_idx_bt2_cb() */ /*------------------------------------------------------------------------- * Function: H5G__dense_remove_by_idx @@ -1570,7 +1531,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 14 2006 * *------------------------------------------------------------------------- @@ -1641,7 +1601,7 @@ H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_ful udata.grp_full_path_r = grp_full_path_r; /* Remove the record from the name index v2 B-tree */ - if (H5B2_remove_by_idx(bt2, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0) + if (H5B2_remove_by_idx(bt2, order, n, H5G__dense_remove_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from indexed v2 B-tree") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ @@ -1678,7 +1638,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- @@ -1721,7 +1680,7 @@ H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link) udata.replace_names = FALSE; /* Delete the name index, adjusting the ref. count on links removed */ - if (H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G_dense_remove_bt2_cb, &udata) < 0) + if (H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G__dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index") /* Close the fractal heap */ diff --git a/src/H5Glink.c b/src/H5Glink.c index 61a8ae9..629cb11 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -58,10 +58,10 @@ /* Local Prototypes */ /********************/ -static int H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2); -static int H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2); -static int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2); -static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2); /*********************/ /* Package Variables */ @@ -76,7 +76,7 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); /*******************/ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_name_inc + * Function: H5G__link_cmp_name_inc * * Purpose: Callback routine for comparing two link names, in * increasing alphabetic order @@ -93,15 +93,15 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); *------------------------------------------------------------------------- */ static int -H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2) +H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk1)->name, ((const H5O_link_t *)lnk2)->name)) -} /* end H5G_link_cmp_name_inc() */ +} /* end H5G__link_cmp_name_inc() */ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_name_dec + * Function: H5G__link_cmp_name_dec * * Purpose: Callback routine for comparing two link names, in * decreasing alphabetic order @@ -118,15 +118,15 @@ H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ static int -H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) +H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk2)->name, ((const H5O_link_t *)lnk1)->name)) -} /* end H5G_link_cmp_name_dec() */ +} /* end H5G__link_cmp_name_dec() */ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_corder_inc + * Function: H5G__link_cmp_corder_inc * * Purpose: Callback routine for comparing two link creation orders, in * increasing order @@ -142,11 +142,11 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ static int -H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) +H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2) { int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if (((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder) ret_value = -1; @@ -156,10 +156,10 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) ret_value = 0; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_cmp_corder_inc() */ +} /* end H5G__link_cmp_corder_inc() */ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_corder_dec + * Function: H5G__link_cmp_corder_dec * * Purpose: Callback routine for comparing two link creation orders, in * decreasing order @@ -175,11 +175,11 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ static int -H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) +H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2) { int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if (((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder) ret_value = 1; @@ -189,7 +189,7 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) ret_value = 0; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_cmp_corder_dec() */ +} /* end H5G__link_cmp_corder_dec() */ /*------------------------------------------------------------------------- * Function: H5G__ent_to_link @@ -417,18 +417,18 @@ H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, H5_iter_orde /* Pick appropriate sorting routine */ if (idx_type == H5_INDEX_NAME) { if (order == H5_ITER_INC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_inc); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_inc); else if (order == H5_ITER_DEC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_dec); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_dec); else HDassert(order == H5_ITER_NATIVE); } /* end if */ else { HDassert(idx_type == H5_INDEX_CRT_ORDER); if (order == H5_ITER_INC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_inc); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_inc); else if (order == H5_ITER_DEC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_dec); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_dec); else HDassert(order == H5_ITER_NATIVE); } /* end else */ diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 15d3cf2..7d08b54 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -235,6 +235,9 @@ H5G_loc_real(void *obj, H5I_type_t type, H5G_loc_t *loc) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of a dataspace selection iterator") + case H5I_EVENTSET: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of a event set") + case H5I_UNINIT: case H5I_BADID: case H5I_NTYPES: @@ -597,7 +600,7 @@ done: } /* end H5G__loc_insert() */ /*------------------------------------------------------------------------- - * Function: H5G_loc_exists_cb + * Function: H5G__loc_exists_cb * * Purpose: Callback for checking if an object exists * @@ -609,13 +612,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name, - const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/, - H5G_own_loc_t *own_loc /*out*/) +H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name, + const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/, + H5G_own_loc_t *own_loc /*out*/) { H5G_loc_exists_t *udata = (H5G_loc_exists_t *)_udata; /* User data passed in */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check if the name in this group resolved to a valid object */ if (obj_loc == NULL) @@ -631,7 +634,7 @@ H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_U *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_loc_exists_cb() */ +} /* end H5G__loc_exists_cb() */ /*------------------------------------------------------------------------- * Function: H5G_loc_exists @@ -662,7 +665,7 @@ H5G_loc_exists(const H5G_loc_t *loc, const char *name) udata.exists = FALSE; /* Traverse group hierarchy to locate object */ - if (H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G_loc_exists_cb, &udata) < 0) + if (H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G__loc_exists_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't check if object exists") /* Set return value */ diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h index 219342d..fe26bd2 100644 --- a/src/H5Gmodule.h +++ b/src/H5Gmodule.h @@ -31,9 +31,94 @@ /** * \defgroup H5G H5G - * \brief Group Interface - * \details The HDF5 Group Interface, H5G, provides a mechanism for managing - * HDF5 groups and their members, which are other HDF5 objects. + * + * \details \Bold{Groups in HDF5:} A group associates names with objects and + * provides a mechanism for mapping a name to an object. Since all + * objects appear in at least one group (with the possible exception of + * the root object) and since objects can have names in more than one + * group, the set of all objects in an HDF5 file is a directed + * graph. The internal nodes (nodes with out-degree greater than zero) + * must be groups while the leaf nodes (nodes with out-degree zero) are + * either empty groups or objects of some other type. Exactly one + * object in every non-empty file is the root object. The root object + * always has a positive in-degree because it is pointed to by the file + * super block. + * + * \Bold{Locating objects in the HDF5 file hierarchy:} An object name + * consists of one or more components separated from one another by + * slashes. An absolute name begins with a slash and the object is + * located by looking for the first component in the root object, then + * looking for the second component in the first object, etc., until + * the entire name is traversed. A relative name does not begin with a + * slash and the traversal begins at the location specified by the + * create or access function. + * + * \Bold{Group implementations in HDF5:} The original HDF5 group + * implementation provided a single indexed structure for link + * storage. A new group implementation, in HDF5 Release 1.8.0, enables + * more efficient compact storage for very small groups, improved link + * indexing for large groups, and other advanced features. + * + * \li The \Emph{original indexed} format remains the default. Links + * are stored in a B-tree in the group’s local heap. + * \li Groups created in the new \Emph{compact-or-indexed} format, the + * implementation introduced with Release 1.8.0, can be tuned for + * performance, switching between the compact and indexed formats + * at thresholds set in the user application. + * - The \Emph{compact} format will conserve file space and processing + * overhead when working with small groups and is particularly + * valuable when a group contains no links. Links are stored + * as a list of messages in the group’s header. + * - The \Emph{indexed} format will yield improved + * performance when working with large groups, e.g., groups + * containing thousands to millions of members. Links are stored in + * a fractal heap and indexed with an improved B-tree. + * \li The new implementation also enables the use of link names consisting of + * non-ASCII character sets (see H5Pset_char_encoding()) and is + * required for all link types other than hard or soft links, e.g., + * external and user-defined links (see the \ref H5L APIs). + * + * The original group structure and the newer structures are not + * directly interoperable. By default, a group will be created in the + * original indexed format. An existing group can be changed to a + * compact-or-indexed format if the need arises; there is no capability + * to change back. As stated above, once in the compact-or-indexed + * format, a group can switch between compact and indexed as needed. + * + * Groups will be initially created in the compact-or-indexed format + * only when one or more of the following conditions is met: + * \li The low version bound value of the library version bounds property + * has been set to Release 1.8.0 or later in the file access property + * list (see H5Pset_libver_bounds()). Currently, that would require an + * H5Pset_libver_bounds() call with the low parameter set to + * #H5F_LIBVER_LATEST.\n When this property is set for an HDF5 file, + * all objects in the file will be created using the latest available + * format; no effort will be made to create a file that can be read by + * older libraries. + * \li The creation order tracking property, #H5P_CRT_ORDER_TRACKED, has been + * set in the group creation property list (see H5Pset_link_creation_order()). + * + * An existing group, currently in the original indexed format, will be + * converted to the compact-or-indexed format upon the occurrence of + * any of the following events: + * \li An external or user-defined link is inserted into the group. + * \li A link named with a string composed of non-ASCII characters is + * inserted into the group. + * + * The compact-or-indexed format offers performance improvements that + * will be most notable at the extremes, i.e., in groups with zero + * members and in groups with tens of thousands of members. But + * measurable differences may sometimes appear at a threshold as low as + * eight group members. Since these performance thresholds and criteria + * differ from application to application, tunable settings are + * provided to govern the switch between the compact and indexed + * formats (see H5Pset_link_phase_change()). Optimal thresholds will + * depend on the application and the operating environment. + * + * Future versions of HDF5 will retain the ability to create, read, + * write, and manipulate all groups stored in either the original + * indexed format or the compact-or-indexed format. + * */ #endif /* H5Gmodule_H */ diff --git a/src/H5Gname.c b/src/H5Gname.c index fd63cbb..2465f01 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -729,6 +729,7 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_ERROR_MSG: case H5I_ERROR_STACK: case H5I_SPACE_SEL_ITER: + case H5I_EVENTSET: case H5I_NTYPES: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object") diff --git a/src/H5Gnode.c b/src/H5Gnode.c index fb4cd48..9a7da0f 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -70,20 +70,20 @@ typedef struct H5G_node_key_t { /********************/ /* B-tree callbacks */ -static H5UC_t * H5G_node_get_shared(const H5F_t *f, const void *_udata); +static H5UC_t * H5G__node_get_shared(const H5F_t *f, const void *_udata); static herr_t H5G__node_create(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p /*out*/); -static int H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key); -static int H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key); -static htri_t H5G_node_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata); +static int H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key); +static int H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key); +static htri_t H5G__node_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata); static H5B_ins_t H5G__node_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node_p /*out*/); -static H5B_ins_t H5G_node_remove(H5F_t *f, haddr_t addr, void *lt_key, hbool_t *lt_key_changed, void *udata, - void *rt_key, hbool_t *rt_key_changed); -static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); -static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); -static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata); +static H5B_ins_t H5G__node_remove(H5F_t *f, haddr_t addr, void *lt_key, hbool_t *lt_key_changed, void *udata, + void *rt_key, hbool_t *rt_key_changed); +static herr_t H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); +static herr_t H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); +static herr_t H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata); /*********************/ /* Package Variables */ @@ -93,19 +93,19 @@ static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, const H5B_class_t H5B_SNODE[1] = {{ H5B_SNODE_ID, /*id */ sizeof(H5G_node_key_t), /*sizeof_nkey */ - H5G_node_get_shared, /*get_shared */ + H5G__node_get_shared, /*get_shared */ H5G__node_create, /*new */ - H5G_node_cmp2, /*cmp2 */ - H5G_node_cmp3, /*cmp3 */ - H5G_node_found, /*found */ + H5G__node_cmp2, /*cmp2 */ + H5G__node_cmp3, /*cmp3 */ + H5G__node_found, /*found */ H5G__node_insert, /*insert */ TRUE, /*follow min branch? */ TRUE, /*follow max branch? */ H5B_RIGHT, /*critical key */ - H5G_node_remove, /*remove */ - H5G_node_decode_key, /*decode */ - H5G_node_encode_key, /*encode */ - H5G_node_debug_key /*debug */ + H5G__node_remove, /*remove */ + H5G__node_decode_key, /*decode */ + H5G__node_encode_key, /*encode */ + H5G__node_debug_key /*debug */ }}; /* Declare a free list to manage the H5G_node_t struct */ @@ -123,7 +123,7 @@ H5FL_SEQ_DEFINE(H5G_entry_t); /*******************/ /*------------------------------------------------------------------------- - * Function: H5G_node_get_shared + * Function: H5G__node_get_shared * * Purpose: Returns the shared B-tree info for the specified UDATA. * @@ -137,18 +137,18 @@ H5FL_SEQ_DEFINE(H5G_entry_t); *------------------------------------------------------------------------- */ static H5UC_t * -H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) +H5G__node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); /* Return the pointer to the ref-count object */ FUNC_LEAVE_NOAPI(H5F_GRP_BTREE_SHARED(f)) -} /* end H5G_node_get_shared() */ +} /* end H5G__node_get_shared() */ /*------------------------------------------------------------------------- - * Function: H5G_node_decode_key + * Function: H5G__node_decode_key * * Purpose: Decodes a raw key into a native key. * @@ -160,11 +160,11 @@ H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) *------------------------------------------------------------------------- */ static herr_t -H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) +H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { H5G_node_key_t *key = (H5G_node_key_t *)_key; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(shared); HDassert(raw); @@ -173,10 +173,10 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) H5F_DECODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_decode_key() */ +} /* end H5G__node_decode_key() */ /*------------------------------------------------------------------------- - * Function: H5G_node_encode_key + * Function: H5G__node_encode_key * * Purpose: Encodes a native key into a raw key. * @@ -188,11 +188,11 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) *------------------------------------------------------------------------- */ static herr_t -H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) +H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) { const H5G_node_key_t *key = (const H5G_node_key_t *)_key; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(shared); HDassert(raw); @@ -201,10 +201,10 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) H5F_ENCODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_encode_key() */ +} /* end H5G__node_encode_key() */ /*------------------------------------------------------------------------- - * Function: H5G_node_debug_key + * Function: H5G__node_debug_key * * Purpose: Prints a key. * @@ -216,12 +216,12 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) *------------------------------------------------------------------------- */ static herr_t -H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata) +H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata) { const H5G_node_key_t * key = (const H5G_node_key_t *)_key; const H5G_bt_common_t *udata = (const H5G_bt_common_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(key); @@ -239,7 +239,7 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Cannot get name; heap address not specified\n"); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_debug_key() */ +} /* end H5G__node_debug_key() */ /*------------------------------------------------------------------------- * Function: H5G__node_free @@ -342,7 +342,7 @@ done: } /* end H5G__node_create() */ /*------------------------------------------------------------------------- - * Function: H5G_node_cmp2 + * Function: H5G__node_cmp2 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY). * The UDATA pointer supplies extra data not contained in the @@ -362,7 +362,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) +H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key) { H5G_bt_common_t *udata = (H5G_bt_common_t *)_udata; H5G_node_key_t * lt_key = (H5G_node_key_t *)_lt_key; @@ -370,7 +370,7 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) const char * s1, *s2; int ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(udata && udata->heap); @@ -388,10 +388,10 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_node_cmp2() */ +} /* H5G__node_cmp2() */ /*------------------------------------------------------------------------- - * Function: H5G_node_cmp3 + * Function: H5G__node_cmp3 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY) * against another key (not necessarily the same type) @@ -415,7 +415,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) +H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key) { H5G_bt_common_t *udata = (H5G_bt_common_t *)_udata; H5G_node_key_t * lt_key = (H5G_node_key_t *)_lt_key; @@ -423,7 +423,7 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) const char * s; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(udata && udata->heap); @@ -445,10 +445,10 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_cmp3() */ +} /* end H5G__node_cmp3() */ /*------------------------------------------------------------------------- - * Function: H5G_node_found + * Function: H5G__node_found * * Purpose: The B-tree search engine has found the symbol table node * which contains the requested symbol if the symbol exists. @@ -473,7 +473,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata) +H5G__node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata) { H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; H5G_node_t * sn = NULL; @@ -482,7 +482,7 @@ H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void const char * s; htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -526,7 +526,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_found() */ +} /* end H5G__node_found() */ /*------------------------------------------------------------------------- * Function: H5G__node_insert @@ -693,7 +693,7 @@ done: } /* end H5G__node_insert() */ /*------------------------------------------------------------------------- - * Function: H5G_node_remove + * Function: H5G__node_remove * * Purpose: The B-tree removal engine has found the symbol table node * which should contain the name which is being removed. This @@ -721,9 +721,9 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*in,out*/, - hbool_t H5_ATTR_UNUSED *lt_key_changed /*out*/, void *_udata /*in,out*/, - void *_rt_key /*in,out*/, hbool_t *rt_key_changed /*out*/) +H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*in,out*/, + hbool_t H5_ATTR_UNUSED *lt_key_changed /*out*/, void *_udata /*in,out*/, + void *_rt_key /*in,out*/, hbool_t *rt_key_changed /*out*/) { H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; H5G_bt_rm_t * udata = (H5G_bt_rm_t *)_udata; @@ -733,7 +733,7 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*in int cmp = 1; H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(f); @@ -903,7 +903,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_remove() */ +} /* end H5G__node_remove() */ /*------------------------------------------------------------------------- * Function: H5G__node_iterate diff --git a/src/H5Gstab.c b/src/H5Gstab.c index d4a18b7..78981be 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -661,7 +661,7 @@ done: } /* end H5G__stab_bh_size() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_get_name_by_idx_cb + * Function: H5G__stab_get_name_by_idx_cb * * Purpose: Callback for B-tree iteration 'by index' info query to * retrieve the name of a link @@ -675,14 +675,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) +H5G__stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) { H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata; size_t name_off; /* Offset of name in heap */ const char * name; /* Pointer to name string in heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(ent); @@ -699,7 +699,7 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_get_name_by_idx_cb */ +} /* end H5G__stab_get_name_by_idx_cb */ /*------------------------------------------------------------------------- * Function: H5G__stab_get_name_by_idx @@ -754,7 +754,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t /* Set iteration information */ udata.common.idx = n; udata.common.num_objs = 0; - udata.common.op = H5G_stab_get_name_by_idx_cb; + udata.common.op = H5G__stab_get_name_by_idx_cb; udata.heap = heap; udata.name = NULL; udata_valid = TRUE; @@ -790,7 +790,7 @@ done: } /* end H5G__stab_get_name_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_lookup_cb + * Function: H5G__stab_lookup_cb * * Purpose: B-tree 'find' callback to retrieve location for an object * @@ -804,12 +804,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata) +H5G__stab_lookup_cb(const H5G_entry_t *ent, void *_udata) { H5G_stab_fnd_ud_t *udata = (H5G_stab_fnd_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check for setting link info */ if (udata->lnk) @@ -819,7 +819,7 @@ H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_lookup_cb() */ +} /* end H5G__stab_lookup_cb() */ /*------------------------------------------------------------------------- * Function: H5G__stab_lookup @@ -865,7 +865,7 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk) /* Set up the user data for actual B-tree find operation */ bt_udata.common.name = name; bt_udata.common.heap = heap; - bt_udata.op = H5G_stab_lookup_cb; + bt_udata.op = H5G__stab_lookup_cb; bt_udata.op_data = &udata; /* Search the B-tree */ @@ -881,7 +881,7 @@ done: } /* end H5G__stab_lookup() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_lookup_by_idx_cb + * Function: H5G__stab_lookup_by_idx_cb * * Purpose: Callback for B-tree iteration 'by index' info query to * retrieve the link @@ -895,13 +895,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) +H5G__stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) { H5G_bt_it_lbi_t *udata = (H5G_bt_it_lbi_t *)_udata; const char * name; /* Pointer to name string in heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(ent); @@ -918,7 +918,7 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_lookup_by_idx_cb */ +} /* end H5G__stab_lookup_by_idx_cb */ /*------------------------------------------------------------------------- * Function: H5G__stab_lookup_by_idx @@ -969,7 +969,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ /* Set iteration information */ udata.common.idx = n; udata.common.num_objs = 0; - udata.common.op = H5G_stab_lookup_by_idx_cb; + udata.common.op = H5G__stab_lookup_by_idx_cb; udata.heap = heap; udata.lnk = lnk; udata.found = FALSE; diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 65a5743..9f0dca2 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -607,6 +607,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign case H5I_ERROR_MSG: case H5I_ERROR_STACK: case H5I_SPACE_SEL_ITER: + case H5I_EVENTSET: case H5I_NTYPES: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object type") diff --git a/src/H5HF.c b/src/H5HF.c index fb03c06..73281a4 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -15,7 +15,7 @@ * * Created: H5HF.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements a "fractal heap" for storing variable- * length objects in a file. @@ -78,52 +78,50 @@ hbool_t H5_PKG_INIT_VAR = FALSE; H5FL_DEFINE_STATIC(H5HF_t); /*------------------------------------------------------------------------- - * Function: H5HF_op_read + * Function: H5HF__op_read * * Purpose: Performs a 'read' operation for a heap 'op' callback * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_op_read(const void *obj, size_t obj_len, void *op_data) +H5HF__op_read(const void *obj, size_t obj_len, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Perform "read", using memcpy() */ H5MM_memcpy(op_data, obj, obj_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_op_read() */ +} /* end H5HF__op_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_op_write + * Function: H5HF__op_write * * Purpose: Performs a 'write' operation for a heap 'op' callback * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_op_write(const void *obj, size_t obj_len, void *op_data) +H5HF__op_write(const void *obj, size_t obj_len, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Perform "write", using memcpy() */ H5MM_memcpy((void *)obj, op_data, obj_len); /* Casting away const OK -QAK */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_op_write() */ +} /* end H5HF__op_write() */ /*------------------------------------------------------------------------- * Function: H5HF_create @@ -134,7 +132,6 @@ H5HF_op_write(const void *obj, size_t obj_len, void *op_data) * NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 24 2006 * *------------------------------------------------------------------------- @@ -156,7 +153,7 @@ H5HF_create(H5F_t *f, const H5HF_create_t *cparam) HDassert(cparam); /* Create shared fractal heap header */ - if (HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, cparam))) + if (HADDR_UNDEF == (fh_addr = H5HF__hdr_create(f, cparam))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header") /* Allocate fractal heap wrapper */ @@ -169,11 +166,11 @@ H5HF_create(H5F_t *f, const H5HF_create_t *cparam) /* Point fractal heap wrapper at header and bump it's ref count */ fh->hdr = hdr; - if (H5HF_hdr_incr(fh->hdr) < 0) + if (H5HF__hdr_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Increment # of files using this heap header */ - if (H5HF_hdr_fuse_incr(fh->hdr) < 0) + if (H5HF__hdr_fuse_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") /* Set file pointer for this heap open context */ @@ -201,7 +198,6 @@ done: * NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 18 2006 * *------------------------------------------------------------------------- @@ -235,11 +231,11 @@ H5HF_open(H5F_t *f, haddr_t fh_addr) /* Point fractal heap wrapper at header */ fh->hdr = hdr; - if (H5HF_hdr_incr(fh->hdr) < 0) + if (H5HF__hdr_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Increment # of files using this heap header */ - if (H5HF_hdr_fuse_incr(fh->hdr) < 0) + if (H5HF__hdr_fuse_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") /* Set file pointer for this heap open context */ @@ -266,7 +262,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -296,7 +291,6 @@ H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p) * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 18 2006 * *------------------------------------------------------------------------- @@ -327,7 +321,6 @@ H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr_p) * filled in), negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 24 2006 * *------------------------------------------------------------------------- @@ -365,7 +358,7 @@ H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id /*out*/) /* Check for 'tiny' object */ else if (size <= hdr->tiny_max_len) { /* Store 'tiny' object in heap */ - if (H5HF_tiny_insert(hdr, size, obj, id) < 0) + if (H5HF__tiny_insert(hdr, size, obj, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'tiny' object in fractal heap") } /* end if */ else { @@ -392,7 +385,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 9 2006 * *------------------------------------------------------------------------- @@ -425,7 +417,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) /* Check type of object in heap */ if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { - if (H5HF_man_get_obj_len(fh->hdr, id, obj_len_p) < 0) + if (H5HF__man_get_obj_len(fh->hdr, id, obj_len_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'managed' object's length") } /* end if */ else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { @@ -433,7 +425,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's length") } /* end if */ else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { - if (H5HF_tiny_get_obj_len(fh->hdr, id, obj_len_p) < 0) + if (H5HF__tiny_get_obj_len(fh->hdr, id, obj_len_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'tiny' object's length") } /* end if */ else { @@ -453,7 +445,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 20 2015 * *------------------------------------------------------------------------- @@ -514,7 +505,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 18 2006 * *------------------------------------------------------------------------- @@ -558,7 +548,7 @@ H5HF_read(H5HF_t *fh, const void *_id, void *obj /*out*/) } /* end if */ else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { /* Read 'tiny' object from file */ - if (H5HF_tiny_read(fh->hdr, id, obj) < 0) + if (H5HF__tiny_read(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read 'tiny' object from fractal heap") } /* end if */ else { @@ -590,7 +580,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- @@ -660,7 +649,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 11 2006 * *------------------------------------------------------------------------- @@ -704,7 +692,7 @@ H5HF_op(H5HF_t *fh, const void *_id, H5HF_operator_t op, void *op_data) } /* end if */ else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { /* Operate on 'tiny' object from file */ - if (H5HF_tiny_op(fh->hdr, id, op, op_data) < 0) + if (H5HF__tiny_op(fh->hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on 'tiny' object from fractal heap") } /* end if */ else { @@ -724,7 +712,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 15 2006 * *------------------------------------------------------------------------- @@ -768,7 +755,7 @@ H5HF_remove(H5HF_t *fh, const void *_id) } /* end if */ else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { /* Remove 'tiny' object from heap statistics */ - if (H5HF_tiny_remove(fh->hdr, id) < 0) + if (H5HF__tiny_remove(fh->hdr, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove 'tiny' object from fractal heap") } /* end if */ else { @@ -788,7 +775,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -808,7 +794,7 @@ H5HF_close(H5HF_t *fh) HDassert(fh); /* Decrement file reference & check if this is the last open fractal heap using the shared heap header */ - if (0 == H5HF_hdr_fuse_decr(fh->hdr)) { + if (0 == H5HF__hdr_fuse_decr(fh->hdr)) { /* Set the shared heap header's file context for this operation */ fh->hdr->f = fh->f; @@ -827,8 +813,8 @@ H5HF_close(H5HF_t *fh) * a reference loop and the objects couldn't be removed from * the metadata cache - QAK) */ - if (H5HF_man_iter_ready(&fh->hdr->next_block)) - if (H5HF_man_iter_reset(&fh->hdr->next_block) < 0) + if (H5HF__man_iter_ready(&fh->hdr->next_block)) + if (H5HF__man_iter_reset(&fh->hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") /* Shut down the huge object information */ @@ -850,10 +836,10 @@ H5HF_close(H5HF_t *fh) } /* end if */ /* Decrement the reference count on the heap header */ - /* (don't put in H5HF_hdr_fuse_decr() as the heap header may be evicted + /* (don't put in H5HF__hdr_fuse_decr() as the heap header may be evicted * immediately -QAK) */ - if (H5HF_hdr_decr(fh->hdr) < 0) + if (H5HF__hdr_decr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") /* Check for pending heap deletion */ @@ -884,7 +870,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 4 2006 * *------------------------------------------------------------------------- diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 7e9384d..ea5e730 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -15,7 +15,7 @@ * * Created: H5HFcache.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement fractal heap metadata cache methods. * @@ -212,7 +212,7 @@ H5HF__hdr_prefix_decode(H5HF_hdr_t *hdr, const uint8_t **image_ref) HDassert(image); /* Magic number */ - if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "wrong fractal heap header signature") image += H5_SIZEOF_MAGIC; @@ -241,7 +241,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- @@ -290,7 +289,6 @@ H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- @@ -337,7 +335,7 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) * * Note also that the value returned by this function presumes that * there is no I/O filtering data in the header. If there is, the - * size reported will be too small, and H5C_load_entry() + * size reported will be too small, and H5C__load_entry() * will have to make two tries to load the fractal heap header. * * Return: Success: SUCCEED @@ -487,7 +485,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_ HDassert(dirty); /* Allocate space for the fractal heap data structure */ - if (NULL == (hdr = H5HF_hdr_alloc(udata->f))) + if (NULL == (hdr = H5HF__hdr_alloc(udata->f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Deserialize the fractal heap header's prefix */ @@ -572,7 +570,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_ HDassert((size_t)(image - (const uint8_t *)_image) == hdr->heap_size); /* Finish initialization of heap header */ - if (H5HF_hdr_finish_init(hdr) < 0) + if (H5HF__hdr_finish_init(hdr) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, NULL, "can't finish initializing shared fractal heap header") /* Set return value */ @@ -580,7 +578,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_ done: if (!ret_value && hdr) - if (H5HF_hdr_free(hdr) < 0) + if (H5HF__hdr_free(hdr) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) @@ -856,7 +854,7 @@ H5HF__cache_hdr_free_icr(void *_thing) HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); HDassert(hdr->rc == 0); - if (H5HF_hdr_free(hdr) < 0) + if (H5HF__hdr_free(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "unable to release fractal heap header") done: @@ -982,7 +980,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED /* Share common heap information */ iblock->hdr = hdr; - if (H5HF_hdr_incr(hdr) < 0) + if (H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Set block's internal information */ @@ -997,7 +995,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED HDassert(iblock->size == len); /* Magic number */ - if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap indirect block signature") image += H5_SIZEOF_MAGIC; @@ -1022,7 +1020,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED iblock->par_entry = udata->par_info->entry; if (iblock->parent) { /* Share parent block */ - if (H5HF_iblock_incr(iblock->parent) < 0) + if (H5HF__iblock_incr(iblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") @@ -1121,7 +1119,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED done: if (!ret_value && iblock) - if (H5HF_man_iblock_dest(iblock) < 0) + if (H5HF__man_iblock_dest(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) @@ -1256,7 +1254,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5 hdr->man_dtable.table_addr = iblock_addr; /* Mark that heap header was modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ else { @@ -1271,7 +1269,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5 par_iblock->ents[par_entry].addr = iblock_addr; /* Mark that parent was modified */ - if (H5HF_iblock_dirty(par_iblock) < 0) + if (H5HF__iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ @@ -1534,7 +1532,7 @@ H5HF__cache_iblock_free_icr(void *thing) HDassert(iblock->hdr); /* Destroy fractal heap indirect block */ - if (H5HF_man_iblock_dest(iblock) < 0) + if (H5HF__man_iblock_dest(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") done: @@ -1764,7 +1762,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo /* Share common heap information */ dblock->hdr = hdr; - if (H5HF_hdr_incr(hdr) < 0) + if (H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Set block's internal information */ @@ -1836,7 +1834,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo image = dblock->blk; /* Magic number */ - if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap direct block signature") image += H5_SIZEOF_MAGIC; @@ -1858,7 +1856,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo dblock->par_entry = par_info->entry; if (dblock->parent) { /* Share parent block */ - if (H5HF_iblock_incr(dblock->parent) < 0) + if (H5HF__iblock_incr(dblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") } /* end if */ @@ -1889,7 +1887,7 @@ done: /* Cleanup on error */ if (!ret_value && dblock) - if (H5HF_man_dblock_dest(dblock) < 0) + if (H5HF__man_dblock_dest(dblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) @@ -2244,7 +2242,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le /* Check if heap header was modified */ if (hdr_changed) - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ else { /* the direct block's parent is an indirect block */ @@ -2299,7 +2297,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le /* Check if parent was modified */ if (par_changed) - if (H5HF_iblock_dirty(par_iblock) < 0) + if (H5HF__iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end else */ } /* end if */ @@ -2337,7 +2335,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le hdr->man_dtable.table_addr = dblock_addr; /* Mark that heap header was modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ else { /* the direct block's parent is an indirect block */ @@ -2351,7 +2349,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le par_iblock->ents[par_entry].addr = dblock_addr; /* Mark that parent was modified */ - if (H5HF_iblock_dirty(par_iblock) < 0) + if (H5HF__iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end else */ } /* end if */ @@ -2551,7 +2549,7 @@ H5HF__cache_dblock_free_icr(void *_thing) HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); /* Destroy fractal heap direct block */ - if (H5HF_man_dblock_dest(dblock) < 0) + if (H5HF__man_dblock_dest(dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") done: diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 657306b..628dcc4 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -109,7 +109,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p /* Share common heap information */ dblock->hdr = hdr; - if (H5HF_hdr_incr(hdr) < 0) + if (H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") /* Set info for direct block */ @@ -155,7 +155,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p /* Attach to parent indirect block, if there is one */ dblock->parent = par_iblock; if (dblock->parent) { - if (H5HF_man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0) + if (H5HF__man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach direct block to parent indirect block") dblock->fd_parent = par_iblock; } /* end if */ @@ -164,8 +164,8 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p dblock->par_entry = par_entry; /* Create a new 'single' section for the free space in the block */ - if (NULL == (sec_node = H5HF_sect_single_new((dblock->block_off + H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)), - free_space, dblock->parent, dblock->par_entry))) + if (NULL == (sec_node = H5HF__sect_single_new((dblock->block_off + H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)), + free_space, dblock->parent, dblock->par_entry))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create section for new direct block's free space") /* Check what to do with section node */ @@ -183,7 +183,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add fractal heap direct block to cache") /* Increase the allocated heap size */ - if (H5HF_hdr_inc_alloc(hdr, dblock->size) < 0) + if (H5HF__hdr_inc_alloc(hdr, dblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size") /* Set the address of of direct block, if requested */ @@ -193,7 +193,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p done: if (ret_value < 0) if (dblock) - if (H5HF_man_dblock_dest(dblock) < 0) + if (H5HF__man_dblock_dest(dblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) @@ -262,7 +262,7 @@ H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, haddr_t dblock_ HDassert(hdr->man_dtable.cparam.start_block_size == dblock->size); /* Sanity check block iterator */ - HDassert(!H5HF_man_iter_ready(&hdr->next_block)); + HDassert(!H5HF__man_iter_ready(&hdr->next_block)); /* Reset header information back to "empty heap" state */ if (H5HF__hdr_empty(hdr) < 0) @@ -370,8 +370,8 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_ } /* end if */ /* Extend heap to cover new direct block */ - if (H5HF_hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, - (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) + if (H5HF__hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, + (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") } /* end if */ /* Root entry already exists, allocate direct block from root indirect block */ @@ -387,7 +387,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_ HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "unable to update block iterator") /* Retrieve information about current iterator position */ - if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") HDassert(next_row < iblock->nrows); H5_CHECKED_ASSIGN(next_size, size_t, hdr->man_dtable.row_block_size[next_row], hsize_t); @@ -402,7 +402,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_ } /* end if */ /* Advance "next block" iterator to next direct block entry */ - if (H5HF_hdr_inc_iter(hdr, (hsize_t)next_size, 1) < 0) + if (H5HF__hdr_inc_iter(hdr, (hsize_t)next_size, 1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment 'next block' iterator") /* Create new direct block at current location*/ @@ -533,7 +533,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_ HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Look up row & column for object */ - if (H5HF_dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0) + if (H5HF__dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object") /* Set initial indirect block info */ @@ -584,7 +584,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_ did_protect = new_did_protect; /* Look up row & column in new indirect block for object */ - if (H5HF_dtable_lookup(&hdr->man_dtable, (obj_off - iblock->block_off), &row, &col) < 0) + if (H5HF__dtable_lookup(&hdr->man_dtable, (obj_off - iblock->block_off), &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object") HDassert(row < iblock->nrows); /* child must be smaller than parent */ } /* end while */ @@ -668,7 +668,7 @@ done: } /* end H5HF__man_dblock_delete() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_dest + * Function: H5HF__man_dblock_dest * * Purpose: Destroys a fractal heap direct block in memory. * @@ -680,11 +680,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_dest(H5HF_direct_t *dblock) +H5HF__man_dblock_dest(H5HF_direct_t *dblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -693,7 +693,7 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock) /* Decrement reference count on shared fractal heap info */ HDassert(dblock->hdr != NULL); - if (H5HF_hdr_decr(dblock->hdr) < 0) + if (H5HF__hdr_decr(dblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if (dblock->parent) if (H5HF__iblock_decr(dblock->parent) < 0) @@ -708,4 +708,4 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_dest() */ +} /* end H5HF__man_dblock_dest() */ diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index 8ceab53..5a1f950 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -66,7 +66,7 @@ /*******************/ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_init + * Function: H5HF__dtable_init * * Purpose: Initialize values for doubling table * @@ -78,14 +78,14 @@ *------------------------------------------------------------------------- */ herr_t -H5HF_dtable_init(H5HF_dtable_t *dtable) +H5HF__dtable_init(H5HF_dtable_t *dtable) { hsize_t tmp_block_size; /* Temporary block size */ hsize_t acc_block_off; /* Accumulated block offset */ size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -126,10 +126,10 @@ H5HF_dtable_init(H5HF_dtable_t *dtable) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_dtable_init() */ +} /* end H5HF__dtable_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_lookup + * Function: H5HF__dtable_lookup * * Purpose: Compute the row & col of an offset in a doubling-table * @@ -141,9 +141,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col) +H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -166,10 +166,10 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_lookup() */ +} /* end H5HF__dtable_lookup() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_dest + * Function: H5HF__dtable_dest * * Purpose: Release information for doubling table * @@ -181,9 +181,9 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi *------------------------------------------------------------------------- */ herr_t -H5HF_dtable_dest(H5HF_dtable_t *dtable) +H5HF__dtable_dest(H5HF_dtable_t *dtable) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -203,10 +203,10 @@ H5HF_dtable_dest(H5HF_dtable_t *dtable) H5MM_xfree(dtable->row_max_dblock_free); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_dest() */ +} /* end H5HF__dtable_dest() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_size_to_row + * Function: H5HF__dtable_size_to_row * * Purpose: Compute row that can hold block of a certain size * @@ -218,11 +218,11 @@ H5HF_dtable_dest(H5HF_dtable_t *dtable) *------------------------------------------------------------------------- */ unsigned -H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) +H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) { unsigned row = 0; /* Row where block will fit */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -237,10 +237,10 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) 1; FUNC_LEAVE_NOAPI(row) -} /* end H5HF_dtable_size_to_row() */ +} /* end H5HF__dtable_size_to_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_size_to_rows + * Function: H5HF__dtable_size_to_rows * * Purpose: Compute # of rows of indirect block of a given size * @@ -252,11 +252,11 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) *------------------------------------------------------------------------- */ unsigned -H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) +H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) { unsigned rows = 0; /* # of rows required for indirect block */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -266,10 +266,10 @@ H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1; FUNC_LEAVE_NOAPI(rows) -} /* end H5HF_dtable_size_to_rows() */ +} /* end H5HF__dtable_size_to_rows() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_span_size + * Function: H5HF__dtable_span_size * * Purpose: Compute the size covered by a span of entries * @@ -281,8 +281,8 @@ H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) *------------------------------------------------------------------------- */ hsize_t -H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col, - unsigned num_entries) +H5HF__dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col, + unsigned num_entries) { unsigned start_entry; /* Entry for first block covered */ unsigned end_row; /* Row for last block covered */ @@ -290,7 +290,7 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned unsigned end_entry; /* Entry for last block covered */ hsize_t acc_span_size = 0; /* Accumulated span size */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -334,4 +334,4 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned } /* end else */ FUNC_LEAVE_NOAPI(acc_span_size) -} /* end H5HF_sect_indirect_span_size() */ +} /* end H5HF__dtable_span_size() */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 84d7d45..cd5ba23 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -15,7 +15,7 @@ * * Created: H5HFhdr.c * Apr 10 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Heap header routines for fractal heaps. * @@ -85,25 +85,24 @@ H5FL_DEFINE_STATIC(H5HF_hdr_t); /*******************/ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_alloc + * Function: H5HF__hdr_alloc * * Purpose: Allocate shared fractal heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ H5HF_hdr_t * -H5HF_hdr_alloc(H5F_t *f) +H5HF__hdr_alloc(H5F_t *f) { H5HF_hdr_t *hdr = NULL; /* Shared fractal heap header */ H5HF_hdr_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -124,7 +123,7 @@ H5HF_hdr_alloc(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_alloc() */ +} /* end H5HF__hdr_alloc() */ /*------------------------------------------------------------------------- * Function: H5HF_hdr_free_space @@ -135,13 +134,12 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) +H5HF__hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) { hsize_t acc_heap_size; /* Accumumated heap space */ hsize_t iblock_size; /* Size of indirect block to calculate for */ @@ -150,7 +148,7 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) unsigned curr_row; /* Current row in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -177,27 +175,26 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) hdr->man_dtable.row_max_dblock_free[iblock_row] = max_dblock_free; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_compute_free_space() */ +} /* end H5HF__hdr_compute_free_space() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_finish_init_phase1 + * Function: H5HF__hdr_finish_init_phase1 * * Purpose: First phase to finish initializing info in shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) +H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -206,7 +203,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* Compute/cache some values */ hdr->heap_off_size = (uint8_t)H5HF_SIZEOF_OFFSET_BITS(hdr->man_dtable.cparam.max_index); - if (H5HF_dtable_init(&hdr->man_dtable) < 0) + if (H5HF__dtable_init(&hdr->man_dtable) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info") /* Set the size of heap IDs */ @@ -215,28 +212,27 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_finish_init_phase1() */ +} /* end H5HF__hdr_finish_init_phase1() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_finish_init_phase2 + * Function: H5HF__hdr_finish_init_phase2 * * Purpose: Second phase to finish initializing info in shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr) +H5HF__hdr_finish_init_phase2(H5HF_hdr_t *hdr) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -251,46 +247,45 @@ H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr) H5_CHECKED_ASSIGN(hdr->man_dtable.row_max_dblock_free[u], size_t, hdr->man_dtable.row_tot_dblock_free[u], hsize_t); } /* end if */ - else if (H5HF_hdr_compute_free_space(hdr, u) < 0) + else if (H5HF__hdr_compute_free_space(hdr, u) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize direct block free space for indirect block") } /* end for */ /* Initialize the block iterator for searching for free space */ - if (H5HF_man_iter_init(&hdr->next_block) < 0) + if (H5HF__man_iter_init(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize space search block iterator") /* Initialize the information for tracking 'huge' objects */ - if (H5HF_huge_init(hdr) < 0) + if (H5HF__huge_init(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize info for tracking huge objects") /* Initialize the information for tracking 'tiny' objects */ - if (H5HF_tiny_init(hdr) < 0) + if (H5HF__tiny_init(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize info for tracking tiny objects") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_finish_init_phase2() */ +} /* end H5HF__hdr_finish_init_phase2() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_finish_init + * Function: H5HF__hdr_finish_init * * Purpose: Finish initializing info in shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_finish_init(H5HF_hdr_t *hdr) +H5HF__hdr_finish_init(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -298,38 +293,37 @@ H5HF_hdr_finish_init(H5HF_hdr_t *hdr) HDassert(hdr); /* First phase of header final initialization */ - if (H5HF_hdr_finish_init_phase1(hdr) < 0) + if (H5HF__hdr_finish_init_phase1(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #1 of header final initialization") /* Second phase of header final initialization */ - if (H5HF_hdr_finish_init_phase2(hdr) < 0) + if (H5HF__hdr_finish_init_phase2(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #2 of header final initialization") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_finish_init() */ +} /* end H5HF__hdr_finish_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_create + * Function: H5HF__hdr_create * * Purpose: Create new fractal heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ haddr_t -H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) +H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam) { H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */ size_t dblock_overhead; /* Direct block's overhead */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -363,7 +357,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) #endif /* NDEBUG */ /* Allocate & basic initialization for the shared header */ - if (NULL == (hdr = H5HF_hdr_alloc(f))) + if (NULL == (hdr = H5HF__hdr_alloc(f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "can't allocate space for shared heap info") #ifndef NDEBUG @@ -387,7 +381,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) /* First phase of header final initialization */ /* (doesn't need ID length set up) */ - if (H5HF_hdr_finish_init_phase1(hdr) < 0) + if (H5HF__hdr_finish_init_phase1(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #1 of header final initialization") @@ -475,7 +469,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) /* Second phase of header final initialization */ /* (needs ID and filter lengths set up) */ - if (H5HF_hdr_finish_init_phase2(hdr) < 0) + if (H5HF__hdr_finish_init_phase2(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #2 of header final initialization") @@ -499,11 +493,11 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) done: if (!H5F_addr_defined(ret_value) && hdr) - if (H5HF_hdr_free(hdr) < 0) + if (H5HF__hdr_free(hdr) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, HADDR_UNDEF, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_create() */ +} /* end H5HF__hdr_create() */ /*------------------------------------------------------------------------- * Function: H5HF__hdr_protect @@ -513,7 +507,6 @@ done: * Return: Pointer to indirect block on success, NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 5 2010 * *------------------------------------------------------------------------- @@ -555,24 +548,23 @@ done: } /* end H5HF__hdr_protect() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_incr + * Function: H5HF__hdr_incr * * Purpose: Increment component reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_incr(H5HF_hdr_t *hdr) +H5HF__hdr_incr(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -587,27 +579,26 @@ H5HF_hdr_incr(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_incr() */ +} /* end H5HF__hdr_incr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_decr + * Function: H5HF__hdr_decr * * Purpose: Decrement component reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_decr(H5HF_hdr_t *hdr) +H5HF__hdr_decr(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -625,25 +616,24 @@ H5HF_hdr_decr(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_decr() */ +} /* end H5HF__hdr_decr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_fuse_incr + * Function: H5HF__hdr_fuse_incr * * Purpose: Increment file reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 1 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr) +H5HF__hdr_fuse_incr(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(hdr); @@ -652,25 +642,24 @@ H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr) hdr->file_rc++; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_hdr_fuse_incr() */ +} /* end H5HF__hdr_fuse_incr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_fuse_decr + * Function: H5HF__hdr_fuse_decr * * Purpose: Decrement file reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 1 2006 * *------------------------------------------------------------------------- */ size_t -H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr) +H5HF__hdr_fuse_decr(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(hdr); @@ -680,36 +669,34 @@ H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr) hdr->file_rc--; FUNC_LEAVE_NOAPI(hdr->file_rc) -} /* end H5HF_hdr_fuse_decr() */ +} /* end H5HF__hdr_fuse_decr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_dirty + * Function: H5HF__hdr_dirty * * Purpose: Mark heap header as dirty * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_dirty(H5HF_hdr_t *hdr) +H5HF__hdr_dirty(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); /* Resize pinned header in cache if I/O filter is present. */ - if (hdr->filter_len > 0) { + if (hdr->filter_len > 0) if (H5AC_resize_entry(hdr, (size_t)hdr->heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize fractal heap header") - } /* end if */ /* Mark header as dirty in cache */ if (H5AC_mark_entry_dirty(hdr) < 0) @@ -717,27 +704,26 @@ H5HF_hdr_dirty(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_dirty() */ +} /* end H5HF__hdr_dirty() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_adj_free + * Function: H5HF__hdr_adj_free * * Purpose: Adjust the free space for a heap * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 9 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) +H5HF__hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -749,32 +735,31 @@ H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + amt); /* Mark heap header as modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_adj_free() */ +} /* end H5HF__hdr_adj_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_adjust_heap + * Function: H5HF__hdr_adjust_heap * * Purpose: Adjust heap space * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 10 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) +H5HF__hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -789,30 +774,29 @@ H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + extra_free); /* Mark heap header as modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_adjust_heap() */ +} /* end H5HF__hdr_adjust_heap() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_inc_alloc + * Function: H5HF__hdr_inc_alloc * * Purpose: Increase allocated size of heap * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 23 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) +H5HF__hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -824,27 +808,26 @@ H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) hdr->man_alloc_size += alloc_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_hdr_inc_alloc() */ +} /* end H5HF__hdr_inc_alloc() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_start_iter + * Function: H5HF__hdr_start_iter * * Purpose: Start "next block" iterator at an offset/entry in the heap * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 30 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry) +H5HF__hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -853,7 +836,7 @@ H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, HDassert(iblock); /* Set up "next block" iterator at correct location */ - if (H5HF_man_iter_start_entry(hdr, &hdr->next_block, iblock, curr_entry) < 0) + if (H5HF__man_iter_start_entry(hdr, &hdr->next_block, iblock, curr_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator") /* Set the offset of the iterator in the heap */ @@ -861,27 +844,26 @@ H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_start_iter() */ +} /* end H5HF__hdr_start_iter() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_reset_iter + * Function: H5HF__hdr_reset_iter * * Purpose: Reset "next block" iterator * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) +H5HF__hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -889,7 +871,7 @@ H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) HDassert(hdr); /* Reset "next block" iterator */ - if (H5HF_man_iter_reset(&hdr->next_block) < 0) + if (H5HF__man_iter_reset(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") /* Set the offset of the iterator in the heap */ @@ -897,7 +879,7 @@ H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_reset_iter() */ +} /* end H5HF__hdr_reset_iter() */ /*------------------------------------------------------------------------- * Function: H5HF__hdr_skip_blocks @@ -907,7 +889,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 3 2006 * *------------------------------------------------------------------------- @@ -931,11 +912,11 @@ H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_e /* Compute the span within the heap to skip */ row = start_entry / hdr->man_dtable.cparam.width; col = start_entry % hdr->man_dtable.cparam.width; - sect_size = H5HF_dtable_span_size(&hdr->man_dtable, row, col, nentries); + sect_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries); HDassert(sect_size > 0); /* Advance the new block iterator */ - if (H5HF_hdr_inc_iter(hdr, sect_size, nentries) < 0) + if (H5HF__hdr_inc_iter(hdr, sect_size, nentries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size") /* Add 'indirect' section for blocks skipped in this row */ @@ -958,7 +939,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 14 2006 * *------------------------------------------------------------------------- @@ -989,17 +969,17 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) unsigned min_dblock_row; /* Minimum row for direct block size request */ /* Compute min. row for direct block requested */ - min_dblock_row = H5HF_dtable_size_to_row(&hdr->man_dtable, min_dblock_size); + min_dblock_row = H5HF__dtable_size_to_row(&hdr->man_dtable, min_dblock_size); /* Initialize block iterator, if necessary */ - if (!H5HF_man_iter_ready(&hdr->next_block)) { + if (!H5HF__man_iter_ready(&hdr->next_block)) { /* Start iterator with previous offset of iterator */ if (H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") } /* end if */ /* Get information about current iterator location */ - if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") /* Check for skipping over blocks in the current block */ @@ -1019,7 +999,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") /* Get information about new iterator location */ - if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") } /* end if */ @@ -1037,17 +1017,17 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ else { /* Move iterator up one level */ - if (H5HF_man_iter_up(&hdr->next_block) < 0) + if (H5HF__man_iter_up(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Increment location of next block at this level */ - if (H5HF_man_iter_next(hdr, &hdr->next_block, 1) < 0) + if (H5HF__man_iter_next(hdr, &hdr->next_block, 1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't advance fractal heap block location") } /* end else */ /* Get information about new iterator location */ - if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") @@ -1064,7 +1044,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) /* Compute # of rows in next child indirect block to use */ child_nrows = - H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[next_row]); + H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[next_row]); /* Check for skipping over indirect blocks */ /* (that don't have direct blocks large enough to hold direct block size requested) */ @@ -1106,7 +1086,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) "unable to protect fractal heap indirect block") /* Move iterator down one level (pins indirect block) */ - if (H5HF_man_iter_down(&hdr->next_block, new_iblock) < 0) + if (H5HF__man_iter_down(&hdr->next_block, new_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") @@ -1130,7 +1110,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end else */ /* Get information about new iterator location */ - if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") @@ -1145,24 +1125,23 @@ done: } /* end H5HF__hdr_update_iter() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_inc_iter + * Function: H5HF__hdr_inc_iter * * Purpose: Advance "next block" iterator * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 23 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) +H5HF__hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1172,7 +1151,7 @@ H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) /* Advance the iterator for the current location within the indirect block */ if (hdr->next_block.curr) - if (H5HF_man_iter_next(hdr, &hdr->next_block, nentries) < 0) + if (H5HF__man_iter_next(hdr, &hdr->next_block, nentries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Increment the offset of the iterator in the heap */ @@ -1180,7 +1159,7 @@ H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_inc_iter() */ +} /* end H5HF__hdr_inc_iter() */ /*------------------------------------------------------------------------- * Function: H5HF__hdr_reverse_iter @@ -1191,7 +1170,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -1213,7 +1191,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) HDassert(hdr); /* Initialize block iterator, if necessary */ - if (!H5HF_man_iter_ready(&hdr->next_block)) + if (!H5HF__man_iter_ready(&hdr->next_block)) /* Start iterator with previous offset of iterator */ if (H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") @@ -1221,7 +1199,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) /* Walk backwards through heap, looking for direct block to place iterator after */ /* Get information about current iterator location */ - if (H5HF_man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) + if (H5HF__man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator information") /* Move current iterator position backwards once */ @@ -1246,12 +1224,12 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) /* Check for parent of current indirect block */ if (iblock->parent) { /* Move iterator to parent of current block */ - if (H5HF_man_iter_up(&hdr->next_block) < 0) + if (H5HF__man_iter_up(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to move current block iterator location up") /* Get information about current iterator location */ - if (H5HF_man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) + if (H5HF__man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator information") @@ -1266,7 +1244,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) hdr->man_iter_off = 0; /* Reset 'next block' iterator */ - if (H5HF_man_iter_reset(&hdr->next_block) < 0) + if (H5HF__man_iter_reset(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") } /* end else */ } /* end if */ @@ -1282,7 +1260,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) curr_entry++; /* Set the current location of the iterator to next entry after the existing direct block */ - if (H5HF_man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) + if (H5HF__man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "unable to set current block iterator location") /* Update iterator offset */ @@ -1298,7 +1276,8 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) unsigned child_nrows; /* # of rows in child block */ /* Compute # of rows in next child indirect block to use */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]); + child_nrows = + H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]); /* Lock child indirect block */ if (NULL == (child_iblock = H5HF__man_iblock_protect(hdr, iblock->ents[curr_entry].addr, @@ -1308,11 +1287,11 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) "unable to protect fractal heap indirect block") /* Set the current location of the iterator */ - if (H5HF_man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) + if (H5HF__man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "unable to set current block iterator location") /* Walk down into child indirect block (pins child block) */ - if (H5HF_man_iter_down(&hdr->next_block, child_iblock) < 0) + if (H5HF__man_iter_down(&hdr->next_block, child_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") @@ -1343,7 +1322,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 17 2006 * *------------------------------------------------------------------------- @@ -1359,10 +1337,9 @@ H5HF__hdr_empty(H5HF_hdr_t *hdr) HDassert(hdr); /* Reset block iterator, if necessary */ - if (H5HF_man_iter_ready(&hdr->next_block)) { - if (H5HF_man_iter_reset(&hdr->next_block) < 0) + if (H5HF__man_iter_ready(&hdr->next_block)) + if (H5HF__man_iter_reset(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") - } /* end if */ /* Shrink managed heap size */ hdr->man_size = 0; @@ -1379,7 +1356,7 @@ H5HF__hdr_empty(H5HF_hdr_t *hdr) hdr->total_man_free = 0; /* Mark heap header as modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark header as dirty") done: @@ -1387,24 +1364,23 @@ done: } /* end H5HF__hdr_empty() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_free + * Function: H5HF__hdr_free * * Purpose: Free shared fractal heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 27 2009 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_free(H5HF_hdr_t *hdr) +H5HF__hdr_free(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1412,7 +1388,7 @@ H5HF_hdr_free(H5HF_hdr_t *hdr) HDassert(hdr); /* Free the block size lookup table for the doubling table */ - if (H5HF_dtable_dest(&hdr->man_dtable) < 0) + if (H5HF__dtable_dest(&hdr->man_dtable) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap doubling table") /* Release any I/O pipeline filter information */ @@ -1425,7 +1401,7 @@ H5HF_hdr_free(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_free() */ +} /* end H5HF__hdr_free() */ /*------------------------------------------------------------------------- * Function: H5HF__hdr_delete @@ -1435,7 +1411,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 5 2007 * *------------------------------------------------------------------------- diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 11b790e..b1043a6 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -62,7 +62,7 @@ static herr_t H5HF__huge_bt2_create(H5HF_hdr_t *hdr); /* Local 'huge' object support routines */ -static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr); +static hsize_t H5HF__huge_new_id(H5HF_hdr_t *hdr); static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, H5HF_operator_t op, void *op_data); @@ -113,32 +113,32 @@ H5HF__huge_bt2_create(H5HF_hdr_t *hdr) if (hdr->huge_ids_direct) { if (hdr->filter_len > 0) { bt2_cparam.rrec_size = - (size_t)((unsigned)hdr->sizeof_addr /* Address of object */ - + (unsigned)hdr->sizeof_size /* Length of object */ - + (unsigned)4 /* Filter mask for filtered object */ - + (unsigned)hdr->sizeof_size); /* Size of de-filtered object in memory */ + (uint32_t)((unsigned)hdr->sizeof_addr /* Address of object */ + + (unsigned)hdr->sizeof_size /* Length of object */ + + (unsigned)4 /* Filter mask for filtered object */ + + (unsigned)hdr->sizeof_size); /* Size of de-filtered object in memory */ bt2_cparam.cls = H5HF_HUGE_BT2_FILT_DIR; } /* end if */ else { - bt2_cparam.rrec_size = (size_t)((unsigned)hdr->sizeof_addr /* Address of object */ - + (unsigned)hdr->sizeof_size); /* Length of object */ + bt2_cparam.rrec_size = (uint32_t)((unsigned)hdr->sizeof_addr /* Address of object */ + + (unsigned)hdr->sizeof_size); /* Length of object */ bt2_cparam.cls = H5HF_HUGE_BT2_DIR; } /* end else */ } /* end if */ else { if (hdr->filter_len > 0) { bt2_cparam.rrec_size = - (size_t)((unsigned)hdr->sizeof_addr /* Address of filtered object */ - + (unsigned)hdr->sizeof_size /* Length of filtered object */ - + (unsigned)4 /* Filter mask for filtered object */ - + (unsigned)hdr->sizeof_size /* Size of de-filtered object in memory */ - + (unsigned)hdr->sizeof_size); /* Unique ID for object */ + (uint32_t)((unsigned)hdr->sizeof_addr /* Address of filtered object */ + + (unsigned)hdr->sizeof_size /* Length of filtered object */ + + (unsigned)4 /* Filter mask for filtered object */ + + (unsigned)hdr->sizeof_size /* Size of de-filtered object in memory */ + + (unsigned)hdr->sizeof_size); /* Unique ID for object */ bt2_cparam.cls = H5HF_HUGE_BT2_FILT_INDIR; } /* end if */ else { - bt2_cparam.rrec_size = (size_t)((unsigned)hdr->sizeof_addr /* Address of object */ - + (unsigned)hdr->sizeof_size /* Length of object */ - + (unsigned)hdr->sizeof_size); /* Unique ID for object */ + bt2_cparam.rrec_size = (uint32_t)((unsigned)hdr->sizeof_addr /* Address of object */ + + (unsigned)hdr->sizeof_size /* Length of object */ + + (unsigned)hdr->sizeof_size); /* Unique ID for object */ bt2_cparam.cls = H5HF_HUGE_BT2_INDIR; } /* end else */ } /* end else */ @@ -160,7 +160,7 @@ done: } /* end H5HF__huge_bt2_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_init + * Function: H5HF__huge_init * * Purpose: Initialize information for tracking 'huge' objects * @@ -172,9 +172,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_init(H5HF_hdr_t *hdr) +H5HF__huge_init(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -225,10 +225,10 @@ H5HF_huge_init(H5HF_hdr_t *hdr) hdr->huge_bt2 = NULL; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_huge_init() */ +} /* end H5HF__huge_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_new_id + * Function: H5HF__huge_new_id * * Purpose: Determine a new ID for an indirectly accessed 'huge' object * (either filtered or not) @@ -241,12 +241,12 @@ H5HF_huge_init(H5HF_hdr_t *hdr) *------------------------------------------------------------------------- */ static hsize_t -H5HF_huge_new_id(H5HF_hdr_t *hdr) +H5HF__huge_new_id(H5HF_hdr_t *hdr) { hsize_t new_id; /* New object's ID */ hsize_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -272,7 +272,7 @@ H5HF_huge_new_id(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_new_id() */ +} /* end H5HF__huge_new_id() */ /*------------------------------------------------------------------------- * Function: H5HF__huge_insert @@ -415,7 +415,7 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id) hsize_t new_id; /* New ID for object */ /* Get new ID for object */ - if (0 == (new_id = H5HF_huge_new_id(hdr))) + if (0 == (new_id = H5HF__huge_new_id(hdr))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't generate new ID for object") if (hdr->filter_len > 0) { @@ -453,7 +453,7 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id) hdr->huge_nobjs++; /* Mark heap header as modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: @@ -1030,7 +1030,7 @@ H5HF__huge_remove(H5HF_hdr_t *hdr, const uint8_t *id) hdr->huge_nobjs--; /* Mark heap header as modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: @@ -1090,7 +1090,7 @@ H5HF__huge_term(H5HF_hdr_t *hdr) hdr->huge_ids_wrapped = FALSE; /* Mark heap header as modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 83a5593..9b69ec1 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -178,7 +178,7 @@ done: } /* end H5HF__iblock_unpin() */ /*------------------------------------------------------------------------- - * Function: H5HF_iblock_incr + * Function: H5HF__iblock_incr * * Purpose: Increment reference count on shared indirect block * @@ -190,11 +190,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_incr(H5HF_indirect_t *iblock) +H5HF__iblock_incr(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(iblock); @@ -210,7 +210,7 @@ H5HF_iblock_incr(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_incr() */ +} /* end H5HF__iblock_incr() */ /*------------------------------------------------------------------------- * Function: H5HF__iblock_decr @@ -283,7 +283,7 @@ H5HF__iblock_decr(H5HF_indirect_t *iblock) } /* end if */ else { /* Destroy the indirect block */ - if (H5HF_man_iblock_dest(iblock) < 0) + if (H5HF__man_iblock_dest(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") } /* end else */ } /* end if */ @@ -293,7 +293,7 @@ done: } /* end H5HF__iblock_decr() */ /*------------------------------------------------------------------------- - * Function: H5HF_iblock_dirty + * Function: H5HF__iblock_dirty * * Purpose: Mark indirect block as dirty * @@ -305,11 +305,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_dirty(H5HF_indirect_t *iblock) +H5HF__iblock_dirty(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(iblock); @@ -320,7 +320,7 @@ H5HF_iblock_dirty(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_dirty() */ +} /* end H5HF__iblock_dirty() */ /*------------------------------------------------------------------------- * Function: H5HF__man_iblock_root_create @@ -402,7 +402,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") dblock->fd_parent = iblock; - if (H5HF_man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0) + if (H5HF__man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach root direct block to parent indirect block") @@ -430,9 +430,9 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ /* Start iterator at correct location */ - if (H5HF_hdr_start_iter(hdr, iblock, - (hsize_t)(have_direct_block ? hdr->man_dtable.cparam.start_block_size : 0), - have_direct_block) < 0) + if (H5HF__hdr_start_iter(hdr, iblock, + (hsize_t)(have_direct_block ? hdr->man_dtable.cparam.start_block_size : 0), + have_direct_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator") /* Check for skipping over direct blocks, in order to get to large enough block */ @@ -443,7 +443,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") /* Mark indirect block as modified */ - if (H5HF_iblock_dirty(iblock) < 0) + if (H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Unprotect root indirect block (it's pinned by the iterator though) */ @@ -465,7 +465,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) acc_dblock_free -= hdr->man_dtable.row_tot_dblock_free[0]; /* Extend heap to cover new root indirect block */ - if (H5HF_hdr_adjust_heap(hdr, hdr->man_dtable.row_block_off[nrows], (hssize_t)acc_dblock_free) < 0) + if (H5HF__hdr_adjust_heap(hdr, hdr->man_dtable.row_block_off[nrows], (hssize_t)acc_dblock_free) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") done: @@ -505,7 +505,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) FUNC_ENTER_PACKAGE /* Get "new block" iterator information */ - if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") next_size = hdr->man_dtable.row_block_size[next_row]; @@ -525,7 +525,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) skip_direct_rows = TRUE; /* Make certain we allocate at least the required row for the block requested */ - min_nrows = 1 + H5HF_dtable_size_to_row(&hdr->man_dtable, min_dblock_size); + min_nrows = 1 + H5HF__dtable_size_to_row(&hdr->man_dtable, min_dblock_size); /* Set the information for the next block, of the appropriate size */ new_next_entry = (min_nrows - 1) * hdr->man_dtable.cparam.width; @@ -638,7 +638,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ /* Mark indirect block as dirty */ - if (H5HF_iblock_dirty(iblock) < 0) + if (H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Update other shared header info */ @@ -646,8 +646,8 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) hdr->man_dtable.table_addr = new_addr; /* Extend heap to cover new root indirect block */ - if (H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], - (hssize_t)acc_dblock_free) < 0) + if (H5HF__hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], + (hssize_t)acc_dblock_free) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") done: @@ -769,7 +769,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) } /* end if */ /* Mark indirect block as dirty */ - if (H5HF_iblock_dirty(iblock) < 0) + if (H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Update other shared header info */ @@ -777,8 +777,8 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) hdr->man_dtable.table_addr = new_addr; /* Shrink heap to only cover new root indirect block */ - if (H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], - -(hssize_t)acc_dblock_free) < 0) + if (H5HF__hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], + -(hssize_t)acc_dblock_free) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce space to cover root direct block") done: @@ -856,12 +856,12 @@ H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock) hdr->man_dtable.table_addr = dblock_addr; /* Reset 'next block' iterator */ - if (H5HF_hdr_reset_iter(hdr, (hsize_t)dblock_size) < 0) + if (H5HF__hdr_reset_iter(hdr, (hsize_t)dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") /* Extend heap to just cover first direct block */ - if (H5HF_hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, - (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) + if (H5HF__hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, + (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") /* Scan free space sections to reset any 'parent' pointers */ @@ -918,11 +918,11 @@ H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") /* Get a pointer to the indirect block covering the section */ - if (NULL == (iblock = H5HF_sect_row_get_iblock(old_sec_node))) + if (NULL == (iblock = H5HF__sect_row_get_iblock(old_sec_node))) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve indirect block for row section") /* Hold indirect block in memory, until direct block can point to it */ - if (H5HF_iblock_incr(iblock) < 0) + if (H5HF__iblock_incr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") iblock_held = TRUE; @@ -985,7 +985,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p /* Share common heap information */ iblock->hdr = hdr; - if (H5HF_hdr_incr(hdr) < 0) + if (H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") /* Set info for indirect block */ @@ -1054,7 +1054,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p iblock->par_entry = par_entry; if (iblock->parent) { /* Attach new block to parent */ - if (H5HF_man_iblock_attach(iblock->parent, par_entry, *addr_p) < 0) + if (H5HF__man_iblock_attach(iblock->parent, par_entry, *addr_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach indirect block to parent indirect block") @@ -1086,7 +1086,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p done: if (ret_value < 0) if (iblock) - if (H5HF_man_iblock_dest(iblock) < 0) + if (H5HF__man_iblock_dest(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) @@ -1272,7 +1272,7 @@ done: } /* end H5HF__man_iblock_unprotect() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_attach + * Function: H5HF__man_iblock_attach * * Purpose: Attach a child block (direct or indirect) to an indirect block * @@ -1284,11 +1284,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_addr) +H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_addr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1298,7 +1298,7 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad HDassert(!H5F_addr_defined(iblock->ents[entry].addr)); /* Increment the reference count on this indirect block */ - if (H5HF_iblock_incr(iblock) < 0) + if (H5HF__iblock_incr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Point at the child block */ @@ -1327,12 +1327,12 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad iblock->nchildren++; /* Mark indirect block as modified */ - if (H5HF_iblock_dirty(iblock) < 0) + if (H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_attach() */ +} /* end H5HF__man_iblock_attach() */ /*------------------------------------------------------------------------- * Function: H5HF__man_iblock_detach @@ -1449,7 +1449,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) /* If the indirect block wasn't removed already (by reverting it) */ if (!iblock->removed_from_cache) { /* Mark indirect block as modified */ - if (H5HF_iblock_dirty(iblock) < 0) + if (H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Check for last child being removed from indirect block */ @@ -1552,7 +1552,7 @@ done: } /* end H5HF__man_iblock_detach() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_entry_addr + * Function: H5HF__man_iblock_entry_addr * * Purpose: Retrieve the address of an indirect block's child * @@ -1564,9 +1564,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr) +H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -1578,7 +1578,7 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi *child_addr = iblock->ents[entry].addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iblock_entry_addr() */ +} /* end H5HF__man_iblock_entry_addr() */ /*------------------------------------------------------------------------- * Function: H5HF__man_iblock_delete @@ -1653,7 +1653,7 @@ H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nr row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row]; /* Compute # of rows in next child indirect block to use */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, row_block_size); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, row_block_size); /* Delete child indirect block */ if (H5HF__man_iblock_delete(hdr, iblock->ents[entry].addr, child_nrows, iblock, entry) < @@ -1803,7 +1803,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, hsize_t * HDassert(ret_entry); /* Look up row & column for object */ - if (H5HF_dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0) + if (H5HF__dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") /* Sanity check - first lookup must be an indirect block */ @@ -1827,7 +1827,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, hsize_t * prev_col = col; /* Look up row & column in new indirect block for object */ - if (H5HF_dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0) + if (H5HF__dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") } /* end while */ @@ -1844,7 +1844,7 @@ done: } /* end H5HF__man_iblock_par_info() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_dest + * Function: H5HF__man_iblock_dest * * Purpose: Destroys a fractal heap indirect block in memory. * @@ -1856,11 +1856,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_dest(H5HF_indirect_t *iblock) +H5HF__man_iblock_dest(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1870,7 +1870,7 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock) /* Decrement reference count on shared info */ HDassert(iblock->hdr); - if (H5HF_hdr_decr(iblock->hdr) < 0) + if (H5HF__hdr_decr(iblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if (iblock->parent) if (H5HF__iblock_decr(iblock->parent) < 0) @@ -1890,4 +1890,4 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_dest() */ +} /* end H5HF__man_iblock_dest() */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index ba69e37..673c543 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -68,7 +68,7 @@ H5FL_DEFINE(H5HF_block_loc_t); /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_init + * Function: H5HF__man_iter_init * * Purpose: Initialize a block iterator for walking over all the blocks * in a fractal heap. (initialization finishes when iterator is @@ -82,9 +82,9 @@ H5FL_DEFINE(H5HF_block_loc_t); *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_init(H5HF_block_iter_t *biter) +H5HF__man_iter_init(H5HF_block_iter_t *biter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -95,7 +95,7 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter) HDmemset(biter, 0, sizeof(H5HF_block_iter_t)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_init() */ +} /* end H5HF__man_iter_init() */ /*------------------------------------------------------------------------- * Function: H5HF__man_iter_start_offset @@ -213,7 +213,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t o biter->curr->context = iblock; /* Hold the indirect block with the location */ - if (H5HF_iblock_incr(biter->curr->context) < 0) + if (H5HF__iblock_incr(biter->curr->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") @@ -257,7 +257,7 @@ done: } /* end H5HF__man_iter_start_offset() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_set_entry + * Function: H5HF__man_iter_set_entry * * Purpose: Set the current entry for the iterator * @@ -269,9 +269,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry) +H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -284,10 +284,10 @@ H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigne biter->curr->col = entry % hdr->man_dtable.cparam.width; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_set_entry() */ +} /* end H5HF__man_iter_set_entry() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_start_entry + * Function: H5HF__man_iter_start_entry * * Purpose: Initialize a block iterator to a particular location within * an indirect block @@ -300,13 +300,13 @@ H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigne *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, - unsigned start_entry) +H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, + unsigned start_entry) { H5HF_block_loc_t *new_loc = NULL; /* Pointer to new block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -329,7 +329,7 @@ H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indire new_loc->up = NULL; /* Increment reference count on indirect block */ - if (H5HF_iblock_incr(new_loc->context) < 0) + if (H5HF__iblock_incr(new_loc->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Make new location the current location */ @@ -343,10 +343,10 @@ done: new_loc = H5FL_FREE(H5HF_block_loc_t, new_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_start_entry() */ +} /* end H5HF__man_iter_start_entry() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_reset + * Function: H5HF__man_iter_reset * * Purpose: Reset a block iterator to it's initial state, freeing any * location context it currently has @@ -359,11 +359,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_reset(H5HF_block_iter_t *biter) +H5HF__man_iter_reset(H5HF_block_iter_t *biter) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -403,10 +403,10 @@ H5HF_man_iter_reset(H5HF_block_iter_t *biter) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_reset() */ +} /* end H5HF__man_iter_reset() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_next + * Function: H5HF__man_iter_next * * Purpose: Advance to the next block within the current block of the heap * @@ -418,9 +418,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) +H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -437,10 +437,10 @@ H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) /* HDassert(biter->curr->row <= biter->curr->context->nrows); */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_next() */ +} /* end H5HF__man_iter_next() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_up + * Function: H5HF__man_iter_up * * Purpose: Move iterator up one level * @@ -452,12 +452,12 @@ H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_up(H5HF_block_iter_t *biter) +H5HF__man_iter_up(H5HF_block_iter_t *biter) { H5HF_block_loc_t *up_loc; /* Pointer to 'up' block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -483,10 +483,10 @@ H5HF_man_iter_up(H5HF_block_iter_t *biter) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_up() */ +} /* end H5HF__man_iter_up() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_down + * Function: H5HF__man_iter_down * * Purpose: Move iterator down one level * @@ -498,12 +498,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) +H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) { H5HF_block_loc_t *down_loc = NULL; /* Pointer to new 'down' block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -526,7 +526,7 @@ H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) down_loc->up = biter->curr; /* Increment reference count on indirect block */ - if (H5HF_iblock_incr(down_loc->context) < 0) + if (H5HF__iblock_incr(down_loc->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Make down location the current location */ @@ -537,10 +537,10 @@ done: down_loc = H5FL_FREE(H5HF_block_loc_t, down_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_down() */ +} /* end H5HF__man_iter_down() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_curr + * Function: H5HF__man_iter_curr * * Purpose: Retrieve information about the current block iterator location * @@ -552,10 +552,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, - H5HF_indirect_t **block) +H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, + H5HF_indirect_t **block) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -574,48 +574,10 @@ H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsig *block = biter->curr->context; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_curr() */ - -/*------------------------------------------------------------------------- - * Function: H5HF_man_iter_offset - * - * Purpose: Retrieve offset of iterator in heap - * - * Return: SUCCEED/FAIL - * - * Programmer: Quincey Koziol - * Apr 25 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset) -{ - hsize_t curr_offset; /* For computing offset in heap */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* - * Check arguments. - */ - HDassert(biter); - HDassert(biter->ready); - HDassert(biter->curr->context); - HDassert(offset); - - /* Compute the offset in the heap */ - curr_offset = biter->curr->context->block_off; - curr_offset += hdr->man_dtable.row_block_off[biter->curr->row]; - curr_offset += biter->curr->col * hdr->man_dtable.row_block_size[biter->curr->row]; - - /* Assign the return value */ - *offset = curr_offset; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_offset() */ +} /* end H5HF__man_iter_curr() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_ready + * Function: H5HF__man_iter_ready * * Purpose: Query if iterator is ready to use * @@ -627,9 +589,9 @@ H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset) *------------------------------------------------------------------------- */ hbool_t -H5HF_man_iter_ready(H5HF_block_iter_t *biter) +H5HF__man_iter_ready(H5HF_block_iter_t *biter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -637,4 +599,4 @@ H5HF_man_iter_ready(H5HF_block_iter_t *biter) HDassert(biter); FUNC_LEAVE_NOAPI(biter->ready) -} /* end H5HF_man_iter_ready() */ +} /* end H5HF__man_iter_ready() */ diff --git a/src/H5HFman.c b/src/H5HFman.c index d26c145..427be00 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -145,7 +145,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) HDassert(sec_node->sect_info.state == H5FS_SECT_LIVE); /* Retrieve direct block address from section */ - if (H5HF_sect_single_dblock_info(hdr, sec_node, &dblock_addr, &dblock_size) < 0) + if (H5HF__sect_single_dblock_info(hdr, sec_node, &dblock_addr, &dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Lock direct block */ @@ -189,7 +189,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) hdr->man_nobjs++; /* Reduce space available in heap (marks header dirty) */ - if (H5HF_hdr_adj_free(hdr, -(ssize_t)obj_size) < 0) + if (H5HF__hdr_adj_free(hdr, -(ssize_t)obj_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap") done: @@ -206,7 +206,7 @@ done: } /* end H5HF__man_insert() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_get_obj_len + * Function: H5HF__man_get_obj_len * * Purpose: Get the size of a managed heap object * @@ -218,10 +218,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) +H5HF__man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -240,7 +240,7 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) UINT64DECODE_VAR(id, *obj_len_p, hdr->heap_len_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_get_obj_len() */ +} /* end H5HF__man_get_obj_len() */ /*------------------------------------------------------------------------- * Function: H5HF__man_get_obj_off @@ -454,7 +454,7 @@ H5HF__man_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine routine */ - if (H5HF__man_op_real(hdr, id, H5HF_op_read, obj, 0) < 0) + if (H5HF__man_op_real(hdr, id, H5HF__op_read, obj, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: @@ -489,7 +489,7 @@ H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) /* Call the internal 'op' routine routine */ /* (Casting away const OK - QAK) */ - if (H5HF__man_op_real(hdr, id, H5HF_op_write, (void *)obj, H5HF_OP_MODIFY) < 0) + if (H5HF__man_op_real(hdr, id, H5HF__op_write, (void *)obj, H5HF_OP_MODIFY) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: @@ -629,7 +629,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "object overruns end of direct block") /* Create free space section node */ - if (NULL == (sec_node = H5HF_sect_single_new(obj_off, obj_len, iblock, dblock_entry))) + if (NULL == (sec_node = H5HF__sect_single_new(obj_off, obj_len, iblock, dblock_entry))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create section for direct block's free space") /* Unlock indirect block */ @@ -640,7 +640,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) } /* end if */ /* Increase space available in heap (marks header dirty) */ - if (H5HF_hdr_adj_free(hdr, (ssize_t)obj_len) < 0) + if (H5HF__hdr_adj_free(hdr, (ssize_t)obj_len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap") /* Update statistics about heap */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index a18d101..893a65d 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -221,9 +221,6 @@ typedef struct H5HF_dtable_t { /* Fractal heap free list info (forward decl - defined in H5HFflist.c) */ typedef struct H5HF_freelist_t H5HF_freelist_t; -/* Forward decl indirect block info */ -typedef struct H5HF_indirect_t H5HF_indirect_t; - /* Fractal heap block location */ typedef struct H5HF_block_loc_t { /* Necessary table fields */ @@ -296,7 +293,7 @@ typedef struct H5HF_free_section_t { /* (Each fractal heap header has certain information that is shared across all * the instances of blocks in that fractal heap) */ -typedef struct H5HF_hdr_t { +struct H5HF_hdr_t { /* Information for H5AC cache functions, _must_ be first field in structure */ H5AC_info_t cache_info; @@ -363,7 +360,7 @@ typedef struct H5HF_hdr_t { uint8_t heap_off_size; /* Size of heap offsets (in bytes) */ uint8_t heap_len_size; /* Size of heap ID lengths (in bytes) */ hbool_t checked_filters; /* TRUE if pipeline passes can_apply checks */ -} H5HF_hdr_t; +}; /* Common indirect block doubling table entry */ /* (common between entries pointing to direct & indirect child blocks) */ @@ -609,46 +606,45 @@ H5FL_BLK_EXTERN(direct_block); /******************************/ /* Doubling table routines */ -H5_DLL herr_t H5HF_dtable_init(H5HF_dtable_t *dtable); -H5_DLL herr_t H5HF_dtable_dest(H5HF_dtable_t *dtable); -H5_DLL herr_t H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col); -H5_DLL unsigned H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size); -H5_DLL unsigned H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size); -H5_DLL hsize_t H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col, - unsigned num_entries); +H5_DLL herr_t H5HF__dtable_init(H5HF_dtable_t *dtable); +H5_DLL herr_t H5HF__dtable_dest(H5HF_dtable_t *dtable); +H5_DLL herr_t H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col); +H5_DLL unsigned H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size); +H5_DLL unsigned H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size); +H5_DLL hsize_t H5HF__dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col, + unsigned num_entries); /* Heap header routines */ -H5_DLL H5HF_hdr_t *H5HF_hdr_alloc(H5F_t *f); -H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam); +H5_DLL H5HF_hdr_t *H5HF__hdr_alloc(H5F_t *f); +H5_DLL haddr_t H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam); H5_DLL H5HF_hdr_t *H5HF__hdr_protect(H5F_t *f, haddr_t addr, unsigned flags); -H5_DLL herr_t H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_finish_init(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_incr(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_decr(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr); -H5_DLL size_t H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_dirty(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt); -H5_DLL herr_t H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free); -H5_DLL herr_t H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size); -H5_DLL herr_t H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, - unsigned curr_entry); +H5_DLL herr_t H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_finish_init_phase2(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_finish_init(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_incr(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_decr(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_fuse_incr(H5HF_hdr_t *hdr); +H5_DLL size_t H5HF__hdr_fuse_decr(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_dirty(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt); +H5_DLL herr_t H5HF__hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free); +H5_DLL herr_t H5HF__hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size); +H5_DLL herr_t H5HF__hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, + unsigned curr_entry); H5_DLL herr_t H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); H5_DLL herr_t H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size); -H5_DLL herr_t H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries); +H5_DLL herr_t H5HF__hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries); H5_DLL herr_t H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr); -H5_DLL herr_t H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off); +H5_DLL herr_t H5HF__hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off); H5_DLL herr_t H5HF__hdr_empty(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_free(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_free(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF__hdr_delete(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_dest(H5HF_hdr_t *hdr); /* Indirect block routines */ -H5_DLL herr_t H5HF_iblock_incr(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__iblock_incr(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF__iblock_decr(H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_iblock_dirty(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__iblock_dirty(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size); H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size); H5_DLL herr_t H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node); @@ -658,9 +654,9 @@ H5_DLL H5HF_indirect_t *H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock H5HF_indirect_t *par_iblock, unsigned par_entry, hbool_t must_protect, unsigned flags, hbool_t *did_protect); H5_DLL herr_t H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, hbool_t did_protect); -H5_DLL herr_t H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t dblock_addr); +H5_DLL herr_t H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t dblock_addr); H5_DLL herr_t H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry); -H5_DLL herr_t H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr); +H5_DLL herr_t H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr); H5_DLL herr_t H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry); H5_DLL herr_t H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned nrows, @@ -668,7 +664,7 @@ H5_DLL herr_t H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_ad hsize_t *heap_size /*out*/); H5_DLL herr_t H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, hsize_t *ret_par_block_off, unsigned *ret_entry); -H5_DLL herr_t H5HF_man_iblock_dest(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__man_iblock_dest(H5HF_indirect_t *iblock); /* Direct block routines */ H5_DLL herr_t H5HF__man_dblock_new(H5HF_hdr_t *fh, size_t request, H5HF_free_section_t **ret_sec_node); @@ -682,11 +678,11 @@ H5_DLL H5HF_direct_t *H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_a H5_DLL herr_t H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **par_iblock, unsigned *par_entry, hbool_t *par_did_protect, unsigned flags); H5_DLL herr_t H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size); -H5_DLL herr_t H5HF_man_dblock_dest(H5HF_direct_t *dblock); +H5_DLL herr_t H5HF__man_dblock_dest(H5HF_direct_t *dblock); /* Managed object routines */ H5_DLL herr_t H5HF__man_insert(H5HF_hdr_t *fh, size_t obj_size, const void *obj, void *id); -H5_DLL herr_t H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); +H5_DLL herr_t H5HF__man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); H5_DLL void H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p); H5_DLL herr_t H5HF__man_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); H5_DLL herr_t H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj); @@ -694,7 +690,7 @@ H5_DLL herr_t H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t o H5_DLL herr_t H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id); /* 'Huge' object routines */ -H5_DLL herr_t H5HF_huge_init(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__huge_init(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *id); H5_DLL herr_t H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); H5_DLL herr_t H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p); @@ -715,38 +711,26 @@ H5_DLL herr_t H5HF__huge_bt2_filt_dir_found(const void *nrecord, void *op_data); H5_DLL herr_t H5HF__huge_bt2_filt_dir_remove(const void *nrecord, void *op_data); /* 'Tiny' object routines */ -H5_DLL herr_t H5HF_tiny_init(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *id); -H5_DLL herr_t H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); -H5_DLL herr_t H5HF_tiny_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); -H5_DLL herr_t H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); -H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); - -/* Debugging routines for dumping file structures */ -H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent, - int fwidth); -H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, - haddr_t hdr_addr, size_t nrec); -H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *stream, int indent, - int fwidth); -H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, - haddr_t hdr_addr, unsigned nrows); +H5_DLL herr_t H5HF__tiny_init(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *id); +H5_DLL herr_t H5HF__tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); +H5_DLL herr_t H5HF__tiny_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); +H5_DLL herr_t H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); +H5_DLL herr_t H5HF__tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); /* Block iteration routines */ -H5_DLL herr_t H5HF_man_iter_init(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_init(H5HF_block_iter_t *biter); H5_DLL herr_t H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t offset); -H5_DLL herr_t H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, - unsigned start_entry); -H5_DLL herr_t H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry); -H5_DLL herr_t H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries); -H5_DLL herr_t H5HF_man_iter_up(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_man_iter_reset(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, - H5HF_indirect_t **block); -H5_DLL herr_t H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset); -H5_DLL hbool_t H5HF_man_iter_ready(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, + unsigned start_entry); +H5_DLL herr_t H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry); +H5_DLL herr_t H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries); +H5_DLL herr_t H5HF__man_iter_up(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__man_iter_reset(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, + H5HF_indirect_t **block); +H5_DLL hbool_t H5HF__man_iter_ready(H5HF_block_iter_t *biter); /* Free space manipulation routines */ H5_DLL herr_t H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create); @@ -761,22 +745,22 @@ H5_DLL herr_t H5HF__space_delete(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16_t new_class); /* Free space section routines */ -H5_DLL H5HF_free_section_t *H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, - unsigned par_entry); +H5_DLL H5HF_free_section_t *H5HF__sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, + unsigned par_entry); H5_DLL herr_t H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -H5_DLL herr_t H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, - haddr_t *dblock_addr, size_t *dblock_size); +H5_DLL herr_t H5HF__sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, + haddr_t *dblock_addr, size_t *dblock_size); H5_DLL herr_t H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, size_t amt); H5_DLL herr_t H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); H5_DLL herr_t H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entry_p); -H5_DLL H5HF_indirect_t *H5HF_sect_row_get_iblock(H5HF_free_section_t *sect); +H5_DLL H5HF_indirect_t *H5HF__sect_row_get_iblock(H5HF_free_section_t *sect); H5_DLL herr_t H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); H5_DLL herr_t H5HF__sect_single_free(H5FS_section_info_t *sect); /* Internal operator callbacks */ -H5_DLL herr_t H5HF_op_read(const void *obj, size_t obj_len, void *op_data); -H5_DLL herr_t H5HF_op_write(const void *obj, size_t obj_len, void *op_data); +H5_DLL herr_t H5HF__op_read(const void *obj, size_t obj_len, void *op_data); +H5_DLL herr_t H5HF__op_write(const void *obj, size_t obj_len, void *op_data); /* Testing routines */ #ifdef H5HF_TESTING diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index ed7cddd..3263b4e 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -86,8 +86,10 @@ typedef struct H5HF_stat_t { hsize_t tiny_nobjs; /* Number of 'tiny' objects in heap */ } H5HF_stat_t; -/* Fractal heap info (forward decl - defined in H5HFpkg.h) */ -typedef struct H5HF_t H5HF_t; +/* Fractal heap info (forward decls - defined in H5HFpkg.h) */ +typedef struct H5HF_t H5HF_t; +typedef struct H5HF_hdr_t H5HF_hdr_t; +typedef struct H5HF_indirect_t H5HF_indirect_t; /* Typedef for 'op' operations */ typedef herr_t (*H5HF_operator_t)(const void *obj /*in*/, size_t obj_len, void *op_data /*in,out*/); @@ -125,4 +127,15 @@ H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, int indent H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); #endif /* H5HF_DEBUGGING */ +/* Debugging routines for dumping file structures */ +H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent, + int fwidth); +H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, + haddr_t hdr_addr, size_t nrec); +H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *stream, int indent, + int fwidth); +H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, + haddr_t hdr_addr, unsigned nrows); + #endif /* H5HFprivate_H */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index d80b2f3..eec41a4 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 1, 2006 * * Purpose: Free space section routines for fractal heaps @@ -64,11 +64,11 @@ typedef struct { /********************/ /* Shared routines */ -static herr_t H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr); -static herr_t H5HF_sect_term_cls(H5FS_section_class_t *cls); -static H5HF_free_section_t *H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, - H5FS_section_state_t state); -static herr_t H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *parent); +static herr_t H5FS__sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr); +static herr_t H5FS__sect_term_cls(H5FS_section_class_t *cls); +static H5HF_free_section_t *H5FS__sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, + H5FS_section_state_t state); +static herr_t H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *parent); /* 'single' section routines */ static herr_t H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_section_t *sect); @@ -87,12 +87,12 @@ static herr_t H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *udata) static herr_t H5HF__sect_single_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *sect); /* 'row' section routines */ -static H5HF_free_section_t *H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, - unsigned row, unsigned col, unsigned nentries, - H5HF_free_section_t *under_sect); +static H5HF_free_section_t *H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, + unsigned row, unsigned col, unsigned nentries, + H5HF_free_section_t *under_sect); static herr_t H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_row_parent_removed(H5HF_free_section_t *sect); -static herr_t H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock); +static herr_t H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock); static herr_t H5HF__sect_row_free_real(H5HF_free_section_t *sect); /* 'row' section callbacks */ @@ -113,16 +113,16 @@ static herr_t H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_s static herr_t H5HF__sect_row_debug(const H5FS_section_info_t *sect, FILE *stream, int indent, int fwidth); /* 'indirect' section routines */ -static H5HF_free_section_t *H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, - H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row, - unsigned col, unsigned nentries); +static H5HF_free_section_t *H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, + H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row, + unsigned col, unsigned nentries); static herr_t H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_t first_child, H5HF_free_section_t **first_row_sect, unsigned space_flags, unsigned start_row, unsigned start_col, unsigned end_row, unsigned end_col); -static H5HF_free_section_t *H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, - H5HF_free_section_t *row_sect); -static herr_t H5HF_sect_indirect_decr(H5HF_free_section_t *sect); +static H5HF_free_section_t *H5HF__sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, + H5HF_free_section_t *row_sect); +static herr_t H5HF__sect_indirect_decr(H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indirect_t *sect_iblock); @@ -130,25 +130,26 @@ static herr_t H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF hbool_t *alloc_from_start); static herr_t H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry); static herr_t H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static hbool_t H5HF_sect_indirect_is_first(H5HF_free_section_t *sect); -static H5HF_indirect_t * H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect); -static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect); -static H5HF_free_section_t *H5HF_sect_indirect_top(H5HF_free_section_t *sect); +static hbool_t H5HF__sect_indirect_is_first(H5HF_free_section_t *sect); +static H5HF_indirect_t * H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect); +static hsize_t H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect); +static H5HF_free_section_t *H5HF__sect_indirect_top(H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect1, H5HF_free_section_t *sect2); static herr_t H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf); +static herr_t H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf); static H5FS_section_info_t *H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); -static herr_t H5HF_sect_indirect_free(H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth); +static herr_t H5HF__sect_indirect_free(H5HF_free_section_t *sect); +static herr_t H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect); +static herr_t H5HF__sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, + int fwidth); /* 'indirect' section callbacks */ -static herr_t H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *udata); -static herr_t H5HF_sect_indirect_term_cls(H5FS_section_class_t *cls); +static herr_t H5HF__sect_indirect_init_cls(H5FS_section_class_t *cls, void *udata); +static herr_t H5HF__sect_indirect_term_cls(H5FS_section_class_t *cls); /*********************/ /* Package Variables */ @@ -247,8 +248,8 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_INDIRECT[1] = {{ NULL, /* Class private info */ /* Class methods */ - H5HF_sect_indirect_init_cls, /* Initialize section class */ - H5HF_sect_indirect_term_cls, /* Terminate section class */ + H5HF__sect_indirect_init_cls, /* Initialize section class */ + H5HF__sect_indirect_term_cls, /* Terminate section class */ /* Object methods */ NULL, /* Add section */ @@ -276,7 +277,7 @@ H5FL_DEFINE(H5HF_free_section_t); /*******************/ /*------------------------------------------------------------------------- - * Function: H5HF_sect_init_cls + * Function: H5FS__sect_init_cls * * Purpose: Initialize the common class structure * @@ -289,12 +290,12 @@ H5FL_DEFINE(H5HF_free_section_t); *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) +H5FS__sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) { H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -309,15 +310,15 @@ H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) cls->cls_private = cls_prvt; /* Increment reference count on heap header */ - if (H5HF_hdr_incr(hdr) < 0) + if (H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_init_cls() */ +} /* H5FS__sect_init_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_term_cls + * Function: H5FS__sect_term_cls * * Purpose: Terminate the common class structure * @@ -330,12 +331,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_term_cls(H5FS_section_class_t *cls) +H5FS__sect_term_cls(H5FS_section_class_t *cls) { H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -344,7 +345,7 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls) cls_prvt = (H5HF_sect_private_t *)cls->cls_private; /* Decrement reference count on heap header */ - if (H5HF_hdr_decr(cls_prvt->hdr) < 0) + if (H5HF__hdr_decr(cls_prvt->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") /* Free the class private information */ @@ -352,10 +353,10 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_term_cls() */ +} /* H5FS__sect_term_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_node_new + * Function: H5FS__sect_node_new * * Purpose: Allocate a free space section node of a particular type * @@ -369,12 +370,12 @@ done: *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t sect_state) +H5FS__sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t sect_state) { H5HF_free_section_t *new_sect; /* New section */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(H5F_addr_defined(sect_addr)); @@ -397,10 +398,10 @@ H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5F done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_node_new() */ +} /* H5FS__sect_node_new() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_node_free + * Function: H5HF__sect_node_free * * Purpose: Free a section node * @@ -414,11 +415,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) +H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); @@ -433,28 +434,27 @@ H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_node_free() */ +} /* H5HF__sect_node_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_new + * Function: H5HF__sect_single_new * * Purpose: Create a new 'single' section and return it to the caller * * Return: Pointer to new section on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 30 2006 * *------------------------------------------------------------------------- */ H5HF_free_section_t * -H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry) +H5HF__sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry) { H5HF_free_section_t *sect = NULL; /* 'Single' free space section to add */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -463,13 +463,13 @@ H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent /* Create free space section node */ if (NULL == - (sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_off, (hsize_t)sect_size, H5FS_SECT_LIVE))) + (sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_off, (hsize_t)sect_size, H5FS_SECT_LIVE))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for single section") /* Set the 'single' specific fields */ sect->u.single.parent = parent; if (sect->u.single.parent) { - if (H5HF_iblock_incr(sect->u.single.parent) < 0) + if (H5HF__iblock_incr(sect->u.single.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") } /* end if */ @@ -485,7 +485,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_single_new() */ +} /* end H5HF__sect_single_new() */ /*------------------------------------------------------------------------- * Function: H5HF__sect_single_locate_parent @@ -495,7 +495,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * October 24 2006 * *------------------------------------------------------------------------- @@ -523,7 +522,7 @@ H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_sect HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Increment reference count on indirect block that free section is in */ - if (H5HF_iblock_incr(sec_iblock) < 0) + if (H5HF__iblock_incr(sec_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Check for refreshing existing parent information */ @@ -557,7 +556,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 8 2006 * *------------------------------------------------------------------------- @@ -597,23 +595,22 @@ done: } /* end H5HF__sect_single_revive() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_dblock_info + * Function: H5HF__sect_single_dblock_info * * Purpose: Retrieve the direct block information for a single section * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * October 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, haddr_t *dblock_addr, - size_t *dblock_size) +H5HF__sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, haddr_t *dblock_addr, + size_t *dblock_size) { - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -640,7 +637,7 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, h } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_sect_single_dblock_info() */ +} /* end H5HF__sect_single_dblock_info() */ /*------------------------------------------------------------------------- * Function: H5HF__sect_single_reduce @@ -652,7 +649,6 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, h * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -717,7 +713,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) size_t dblock_overhead; /* Direct block's overhead */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect); @@ -725,7 +721,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(hdr); /* Retrieve direct block address from section */ - if (H5HF_sect_single_dblock_info(hdr, sect, &dblock_addr, &dblock_size) < 0) + if (H5HF__sect_single_dblock_info(hdr, sect, &dblock_addr, &dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Check for section occupying entire direct block */ @@ -741,7 +737,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(H5F_addr_eq(dblock->block_off + dblock_overhead, sect->sect_info.addr)); /* Convert 'single' section into 'row' section */ - if (H5HF_sect_row_from_single(hdr, sect, dblock) < 0) + if (H5HF__sect_row_from_single(hdr, sect, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't convert single section into row section") /* Destroy direct block */ @@ -840,7 +836,7 @@ H5HF__sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, /* Create free list section node */ if (NULL == - (new_sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_addr, sect_size, H5FS_SECT_SERIALIZED))) + (new_sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_addr, sect_size, H5FS_SECT_SERIALIZED))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "allocation failed for direct block free list section") /* Set return value */ @@ -1045,7 +1041,7 @@ H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") /* Retrieve direct block address from section */ - if (H5HF_sect_single_dblock_info(hdr, (*sect), &dblock_addr, &dblock_size) < 0) + if (H5HF__sect_single_dblock_info(hdr, (*sect), &dblock_addr, &dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Protect the direct block for the section */ @@ -1099,14 +1095,13 @@ H5HF__sect_single_free(H5FS_section_info_t *_sect) HDassert(sect); /* Check for live reference to an indirect block */ - if (sect->sect_info.state == H5FS_SECT_LIVE) { + if (sect->sect_info.state == H5FS_SECT_LIVE) /* Get parent indirect block, if there was one */ if (sect->u.single.parent) parent = sect->u.single.parent; - } /* end if */ /* Release the section */ - if (H5HF_sect_node_free(sect, parent) < 0) + if (H5HF__sect_node_free(sect, parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: @@ -1152,8 +1147,8 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 HDassert(H5F_addr_defined(iblock->ents[sect->u.single.par_entry].addr)); /* Retrieve direct block address from section */ - status = H5HF_sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect, - &dblock_addr, &dblock_size); + status = H5HF__sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect, + &dblock_addr, &dblock_size); HDassert(status >= 0); HDassert(H5F_addr_eq(iblock->ents[sect->u.single.par_entry].addr, dblock_addr)); HDassert(dblock_size > 0); @@ -1200,7 +1195,7 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 } /* H5HF__sect_single_valid() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_create + * Function: H5HF__sect_row_create * * Purpose: Create a new 'row' section * @@ -1214,13 +1209,13 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, - unsigned nentries, H5HF_free_section_t *under_sect) +H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, + unsigned nentries, H5HF_free_section_t *under_sect) { H5HF_free_section_t *sect = NULL; /* 'Row' section created */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect_size); @@ -1229,7 +1224,7 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsi /* Create 'row' free space section node */ /* ("inherits" underlying indirect section's state) */ - if (NULL == (sect = H5HF_sect_node_new( + if (NULL == (sect = H5FS__sect_node_new( (unsigned)(is_first ? H5HF_FSPACE_SECT_FIRST_ROW : H5HF_FSPACE_SECT_NORMAL_ROW), sect_off, sect_size, under_sect->sect_info.state))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for row section") @@ -1246,27 +1241,26 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsi done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_create() */ +} /* H5HF__sect_row_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_from_single + * Function: H5HF__sect_row_from_single * * Purpose: Convert a 'single' section into a 'row' section * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock) +H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -1284,7 +1278,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direc sect->u.row.checked_out = FALSE; /* Create indirect section that underlies the row section */ - if (NULL == (sect->u.row.under = H5HF_sect_indirect_for_row(hdr, dblock->parent, sect))) + if (NULL == (sect->u.row.under = H5HF__sect_indirect_for_row(hdr, dblock->parent, sect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "serializing row section not supported yet") /* Release single section's hold on underlying indirect block */ @@ -1293,7 +1287,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direc done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_from_single() */ +} /* end H5HF__sect_row_from_single() */ /*------------------------------------------------------------------------- * Function: H5HF__sect_row_revive @@ -1303,7 +1297,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -1350,7 +1343,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -1424,7 +1416,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -1457,24 +1448,23 @@ done: } /* end H5HF__sect_row_first() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_get_iblock + * Function: H5HF__sect_row_get_iblock * * Purpose: Retrieve the indirect block for a row section * * Return: Pointer to indirect block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 9 2006 * *------------------------------------------------------------------------- */ H5HF_indirect_t * -H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) +H5HF__sect_row_get_iblock(H5HF_free_section_t *sect) { H5HF_indirect_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -1484,10 +1474,10 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); HDassert(sect->sect_info.state == H5FS_SECT_LIVE); - ret_value = H5HF_sect_indirect_get_iblock(sect->u.row.under); + ret_value = H5HF__sect_indirect_get_iblock(sect->u.row.under); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_get_iblock() */ +} /* end H5HF__sect_row_get_iblock() */ /*------------------------------------------------------------------------- * Function: H5HF__sect_row_parent_removed @@ -1498,7 +1488,6 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) * Return: Non-negative on success / Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * February 4 2018 * *------------------------------------------------------------------------- @@ -1571,7 +1560,7 @@ H5HF__sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) HDassert(hdr); /* Call common class initialization */ - if (H5HF_sect_init_cls(cls, hdr) < 0) + if (H5FS__sect_init_cls(cls, hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize common section class") /* First row sections actually are proxies for indirection sections on disk */ @@ -1612,7 +1601,7 @@ H5HF__sect_row_term_cls(H5FS_section_class_t *cls) HDassert(cls); /* Call common class termination */ - if (H5HF_sect_term_cls(cls) < 0) + if (H5FS__sect_term_cls(cls) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't terminate common section class") done: @@ -1651,7 +1640,7 @@ H5HF__sect_row_serialize(const H5FS_section_class_t *cls, const H5FS_section_inf /* Forward to indirect routine to serialize underlying section */ hdr = ((H5HF_sect_private_t *)(cls->cls_private))->hdr; - if (H5HF_sect_indirect_serialize(hdr, sect->u.row.under, buf) < 0) + if (H5HF__sect_indirect_serialize(hdr, sect->u.row.under, buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSERIALIZE, FAIL, "can't serialize row section's underlying indirect section") @@ -1736,24 +1725,22 @@ H5HF__sect_row_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_i HDassert(H5F_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); /* Get the top indirect section underlying each row */ - top_indir_sect1 = H5HF_sect_indirect_top(sect1->u.row.under); + top_indir_sect1 = H5HF__sect_indirect_top(sect1->u.row.under); HDassert(top_indir_sect1); - top_indir_sect2 = H5HF_sect_indirect_top(sect2->u.row.under); + top_indir_sect2 = H5HF__sect_indirect_top(sect2->u.row.under); HDassert(top_indir_sect2); /* Check if second section shares the same underlying indirect block as * the first section, but doesn't already have same underlying indirect * section. */ - if (top_indir_sect1 != top_indir_sect2) { - if (H5HF_sect_indirect_iblock_off(sect1->u.row.under) == - H5HF_sect_indirect_iblock_off(sect2->u.row.under)) { + if (top_indir_sect1 != top_indir_sect2) + if (H5HF__sect_indirect_iblock_off(sect1->u.row.under) == + H5HF__sect_indirect_iblock_off(sect2->u.row.under)) /* Check if second section adjoins first section */ if (H5F_addr_eq((top_indir_sect1->sect_info.addr + top_indir_sect1->u.indirect.span_size), top_indir_sect2->sect_info.addr)) HGOTO_DONE(TRUE) - } /* end if */ - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1797,7 +1784,7 @@ H5HF__sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, H5HF_free_section_t *top_indir_sect; /* Top indirect section for row */ /* Get the top indirect section underlying second row section */ - top_indir_sect = H5HF_sect_indirect_top(sect2->u.row.under); + top_indir_sect = H5HF__sect_indirect_top(sect2->u.row.under); /* Shrink away underlying indirect section */ if (H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) @@ -1883,7 +1870,7 @@ H5HF__sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) HDassert((*sect)->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Get the top indirect section underlying each row */ - top_indir_sect = H5HF_sect_indirect_top((*sect)->u.row.under); + top_indir_sect = H5HF__sect_indirect_top((*sect)->u.row.under); /* Shrink away underlying indirect section */ if (H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) @@ -1920,7 +1907,7 @@ H5HF__sect_row_free_real(H5HF_free_section_t *sect) HDassert(sect); /* Release the section */ - if (H5HF_sect_node_free(sect, NULL) < 0) + if (H5HF__sect_node_free(sect, NULL) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: @@ -1953,7 +1940,7 @@ H5HF__sect_row_free(H5FS_section_info_t *_sect) HDassert(sect->u.row.under); /* Decrement the ref. count on the row section's underlying indirect section */ - if (H5HF_sect_indirect_decr(sect->u.row.under) < 0) + if (H5HF__sect_indirect_decr(sect->u.row.under) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't detach section node") /* Release the section */ @@ -2015,10 +2002,10 @@ H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t HDassert(sect->u.row.row == indir_sect->u.indirect.row); /* Get the top indirect section underlying row */ - top_indir_sect = H5HF_sect_indirect_top(sect->u.row.under); + top_indir_sect = H5HF__sect_indirect_top(sect->u.row.under); /* Check that the row's underlying indirect section is valid */ - H5HF_sect_indirect_valid(hdr, top_indir_sect); + H5HF__sect_indirect_valid(hdr, top_indir_sect); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -2057,31 +2044,30 @@ H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent, /* Print indirect section header */ HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Underlying indirect section:"); - H5HF_sect_indirect_debug(sect->u.row.under, stream, indent + 3, MAX(0, fwidth - 3)); + H5HF__sect_indirect_debug(sect->u.row.under, stream, indent + 3, MAX(0, fwidth - 3)); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) } /* H5HF__sect_row_debug() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_iblock_off + * Function: H5HF__sect_indirect_iblock_off * * Purpose: Get the offset of the indirect block for the section * * Return: Offset of indirect block in "heap space" (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static hsize_t -H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) +H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect) { hsize_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -2092,27 +2078,26 @@ H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) : sect->u.indirect.u.iblock_off; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_iblock_off() */ +} /* end H5HF__sect_indirect_iblock_off() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_top + * Function: H5HF__sect_indirect_top * * Purpose: Get the "top" indirect section * * Return: Pointer to the top indirect section (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_indirect_top(H5HF_free_section_t *sect) +H5HF__sect_indirect_top(H5HF_free_section_t *sect) { H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -2120,15 +2105,15 @@ H5HF_sect_indirect_top(H5HF_free_section_t *sect) HDassert(sect); if (sect->u.indirect.parent) - ret_value = H5HF_sect_indirect_top(sect->u.indirect.parent); + ret_value = H5HF__sect_indirect_top(sect->u.indirect.parent); else ret_value = sect; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_top() */ +} /* end H5HF__sect_indirect_top() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_init_cls + * Function: H5HF__sect_indirect_init_cls * * Purpose: Initialize the "indirect" class structure * @@ -2142,19 +2127,19 @@ H5HF_sect_indirect_top(H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) +H5HF__sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_udata; /* Fractal heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); HDassert(hdr); /* Call to common class initialization */ - if (H5HF_sect_init_cls(cls, hdr) < 0) + if (H5FS__sect_init_cls(cls, hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize common section class") /* Set the size of all serialized objects of this class of sections */ @@ -2162,10 +2147,10 @@ H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_init_cls() */ +} /* H5HF__sect_indirect_init_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_term_cls + * Function: H5HF__sect_indirect_term_cls * * Purpose: Terminate the "indirect" class structure * @@ -2179,25 +2164,25 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_term_cls(H5FS_section_class_t *cls) +H5HF__sect_indirect_term_cls(H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); /* Call common class termination */ - if (H5HF_sect_term_cls(cls) < 0) + if (H5FS__sect_term_cls(cls) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't terminate common section class") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_term_cls() */ +} /* H5HF__sect_indirect_term_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_new + * Function: H5HF__sect_indirect_new * * Purpose: Create a new 'indirect' section for other routines to finish * initializing. @@ -2205,19 +2190,18 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock, - hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries) +H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock, + hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2226,15 +2210,15 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5H HDassert(nentries); /* Create free space section node */ - if (NULL == (sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_INDIRECT, sect_off, sect_size, - (iblock ? H5FS_SECT_LIVE : H5FS_SECT_SERIALIZED)))) + if (NULL == (sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_INDIRECT, sect_off, sect_size, + (iblock ? H5FS_SECT_LIVE : H5FS_SECT_SERIALIZED)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for indirect section") /* Set the 'indirect' specific fields */ if (iblock) { sect->u.indirect.u.iblock = iblock; sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width * sect->u.indirect.u.iblock->max_rows; - if (H5HF_iblock_incr(sect->u.indirect.u.iblock) < 0) + if (H5HF__iblock_incr(sect->u.indirect.u.iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") } /* end if */ @@ -2247,7 +2231,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5H sect->u.indirect.num_entries = nentries; /* Compute span size of indirect section */ - sect->u.indirect.span_size = H5HF_dtable_span_size(&hdr->man_dtable, row, col, nentries); + sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries); HDassert(sect->u.indirect.span_size > 0); /* This indirect section doesn't (currently) have a parent */ @@ -2264,28 +2248,27 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_new() */ +} /* end H5HF__sect_indirect_new() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_for_row + * Function: H5HF__sect_indirect_for_row * * Purpose: Create the underlying indirect section for a new row section * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect) +H5HF__sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2296,9 +2279,9 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_s HDassert(row_sect->u.row.row < hdr->man_dtable.max_direct_rows); /* Create free space section node */ - if (NULL == (sect = H5HF_sect_indirect_new(hdr, row_sect->sect_info.addr, row_sect->sect_info.size, - iblock, iblock->block_off, row_sect->u.row.row, - row_sect->u.row.col, row_sect->u.row.num_entries))) + if (NULL == (sect = H5HF__sect_indirect_new(hdr, row_sect->sect_info.addr, row_sect->sect_info.size, + iblock, iblock->block_off, row_sect->u.row.row, + row_sect->u.row.col, row_sect->u.row.num_entries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create indirect section") /* Set # of direct rows covered */ @@ -2322,11 +2305,11 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_s done: if (!ret_value && sect) - if (H5HF_sect_indirect_free(sect) < 0) + if (H5HF__sect_indirect_free(sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_for_row() */ +} /* end H5HF__sect_indirect_for_row() */ /*------------------------------------------------------------------------- * Function: H5HF__sect_indirect_init_rows @@ -2337,7 +2320,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -2451,7 +2433,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ H5HF_free_section_t *row_sect = NULL; /* 'Row' free space section to add */ /* Create 'row' free space section node */ - if (NULL == (row_sect = H5HF_sect_row_create( + if (NULL == (row_sect = H5HF__sect_row_create( curr_off, (hdr->man_dtable.row_block_size[u] - dblock_overhead), first_child, u, row_col, row_entries, sect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "creation failed for child row section") @@ -2488,20 +2470,20 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ unsigned v; /* Local index variable */ /* Compute info about row's indirect blocks for child section */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[u]); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[u]); child_nentries = child_nrows * hdr->man_dtable.cparam.width; /* Add an indirect section for each indirect block in the row */ for (v = 0; v < row_entries; v++) { - hbool_t did_protect; /* Whether we protected the indirect block or not */ + hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ /* Try to get the child section's indirect block, if it's available */ if (sect->sect_info.state == H5FS_SECT_LIVE) { haddr_t child_iblock_addr; /* Child indirect block's address on disk */ /* Get the address of the child indirect block */ - if (H5HF_man_iblock_entry_addr(sect->u.indirect.u.iblock, curr_entry, - &child_iblock_addr) < 0) + if (H5HF__man_iblock_entry_addr(sect->u.indirect.u.iblock, curr_entry, + &child_iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve child indirect block's address") @@ -2520,8 +2502,8 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ child_iblock = NULL; /* Create free space section node */ - if (NULL == (child_sect = H5HF_sect_indirect_new(hdr, curr_off, (hsize_t)0, child_iblock, - curr_off, 0, 0, child_nentries))) + if (NULL == (child_sect = H5HF__sect_indirect_new(hdr, curr_off, (hsize_t)0, child_iblock, + curr_off, 0, 0, child_nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") /* Initialize rows for new indirect section */ @@ -2592,7 +2574,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 3 2006 * *------------------------------------------------------------------------- @@ -2636,8 +2617,8 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start sect_off += hdr->man_dtable.row_block_size[start_row] * start_col; /* Create free space section node */ - if (NULL == (sect = H5HF_sect_indirect_new(hdr, sect_off, (hsize_t)0, iblock, iblock->block_off, - start_row, start_col, nentries))) + if (NULL == (sect = H5HF__sect_indirect_new(hdr, sect_off, (hsize_t)0, iblock, iblock->block_off, + start_row, start_col, nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") /* Initialize rows for new indirect section */ @@ -2654,31 +2635,30 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start done: if (ret_value < 0 && sect) - if (H5HF_sect_indirect_free(sect) < 0) + if (H5HF__sect_indirect_free(sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF__sect_indirect_add() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_decr + * Function: H5HF__sect_indirect_decr * * Purpose: Decrement ref. count on indirect section * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_decr(H5HF_free_section_t *sect) +H5HF__sect_indirect_decr(H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2697,19 +2677,19 @@ H5HF_sect_indirect_decr(H5HF_free_section_t *sect) par_sect = sect->u.indirect.parent; /* Free indirect section */ - if (H5HF_sect_indirect_free(sect) < 0) + if (H5HF__sect_indirect_free(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") /* Decrement ref. count on indirect section's parent */ if (par_sect) - if (H5HF_sect_indirect_decr(par_sect) < 0) + if (H5HF__sect_indirect_decr(par_sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement ref. count on parent indirect section") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_decr() */ +} /* end H5HF__sect_indirect_decr() */ /*------------------------------------------------------------------------- * Function: H5HF__sect_indirect_revive_row @@ -2719,7 +2699,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 3 2006 * *------------------------------------------------------------------------- @@ -2765,7 +2744,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -2787,7 +2765,7 @@ H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indi HDassert(sect_iblock); /* Increment reference count on indirect block that free section is in */ - if (H5HF_iblock_incr(sect_iblock) < 0) + if (H5HF__iblock_incr(sect_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Set the pointer to the section's indirect block */ @@ -2822,7 +2800,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -2884,7 +2861,7 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */ /* Check if this section is the first section */ - is_first = H5HF_sect_indirect_is_first(sect); + is_first = H5HF__sect_indirect_is_first(sect); /* Remove this indirect section from parent indirect section */ if (H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) @@ -3001,8 +2978,8 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h /* Create peer indirect section */ if (NULL == - (peer_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, iblock, - iblock_off, start_row, start_col, peer_nentries))) + (peer_sect = H5HF__sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, iblock, + iblock_off, start_row, start_col, peer_nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") /* Set up direct row & indirect entry information for peer section */ @@ -3076,7 +3053,7 @@ done: /* Sanity check - we should only be here if an error occurred */ HDassert(ret_value < 0); - if (H5HF_sect_indirect_free(peer_sect) < 0) + if (H5HF__sect_indirect_free(peer_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") } /* end if */ @@ -3093,7 +3070,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -3133,7 +3109,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */ /* Check if this section is the first section */ - is_first = H5HF_sect_indirect_is_first(sect); + is_first = H5HF__sect_indirect_is_first(sect); /* Reduce parent indirect section */ if (H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) @@ -3229,8 +3205,8 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned /* Update the number of entries in current section & calculate it's span size */ /* (Will use this to compute the section address for the peer section */ sect->u.indirect.num_entries = new_nentries; - sect->u.indirect.span_size = H5HF_dtable_span_size(&hdr->man_dtable, sect->u.indirect.row, - sect->u.indirect.col, new_nentries); + sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, sect->u.indirect.row, + sect->u.indirect.col, new_nentries); HDassert(sect->u.indirect.span_size > 0); /* Compute address of peer indirect section */ @@ -3239,9 +3215,9 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned peer_sect_addr += hdr->man_dtable.row_block_size[child_row]; /* Create peer indirect section */ - if (NULL == (peer_sect = H5HF_sect_indirect_new(hdr, peer_sect_addr, sect->sect_info.size, iblock, - iblock_off, peer_start_row, peer_start_col, - peer_nentries))) + if (NULL == (peer_sect = H5HF__sect_indirect_new(hdr, peer_sect_addr, sect->sect_info.size, + iblock, iblock_off, peer_start_row, + peer_start_col, peer_nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") /* Set up direct row & indirect entry information for peer section */ @@ -3305,7 +3281,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned /* Decrement # of sections which depend on this row */ /* (Must be last as section can be freed) */ - if (H5HF_sect_indirect_decr(sect) < 0) + if (H5HF__sect_indirect_decr(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement section's ref. count ") done: @@ -3315,7 +3291,7 @@ done: /* Sanity check - we should only be here if an error occurred */ HDassert(ret_value < 0); - if (H5HF_sect_indirect_free(peer_sect) < 0) + if (H5HF__sect_indirect_free(peer_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") } /* end if */ @@ -3323,24 +3299,23 @@ done: } /* end H5HF__sect_indirect_reduce() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_is_first + * Function: H5HF__sect_indirect_is_first * * Purpose: Check if indirect section is first in all parents * * Return: Non-negative (TRUE/FALSE) on success/ * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 17 2006 * *------------------------------------------------------------------------- */ static hbool_t -H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) +H5HF__sect_indirect_is_first(H5HF_free_section_t *sect) { hbool_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(sect); @@ -3348,13 +3323,13 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) /* Recurse to parent */ if (sect->u.indirect.parent) { if (sect->sect_info.addr == sect->u.indirect.parent->sect_info.addr) - ret_value = H5HF_sect_indirect_is_first(sect->u.indirect.parent); + ret_value = H5HF__sect_indirect_is_first(sect->u.indirect.parent); } /* end if */ else ret_value = TRUE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_is_first() */ +} /* end H5HF__sect_indirect_is_first() */ /*------------------------------------------------------------------------- * Function: H5HF__sect_indirect_first @@ -3364,7 +3339,6 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -3408,22 +3382,21 @@ done: } /* end H5HF__sect_indirect_first() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_get_iblock + * Function: H5HF__sect_indirect_get_iblock * * Purpose: Retrieve the indirect block for a indirect section * * Return: Pointer to indirect block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 9 2006 * *------------------------------------------------------------------------- */ static H5HF_indirect_t * -H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) +H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -3433,7 +3406,7 @@ H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) HDassert(sect->sect_info.state == H5FS_SECT_LIVE); FUNC_LEAVE_NOAPI(sect->u.indirect.u.iblock) -} /* end H5HF_sect_indirect_get_iblock() */ +} /* end H5HF__sect_indirect_get_iblock() */ /*------------------------------------------------------------------------- * Function: H5HF__sect_indirect_merge_row @@ -3475,9 +3448,9 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H HDassert(row_sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Set up indirect section information */ - sect1 = H5HF_sect_indirect_top(row_sect1->u.row.under); + sect1 = H5HF__sect_indirect_top(row_sect1->u.row.under); HDassert(sect1); - sect2 = H5HF_sect_indirect_top(row_sect2->u.row.under); + sect2 = H5HF__sect_indirect_top(row_sect2->u.row.under); HDassert(sect2); /* Sanity check some assumptions about the indirect sections */ @@ -3653,12 +3626,12 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H /* Decrement ref. count on second indirect section's parent */ HDassert(sect2->u.indirect.rc == 0); if (sect2->u.indirect.parent) - if (H5HF_sect_indirect_decr(sect2->u.indirect.parent) < 0) + if (H5HF__sect_indirect_decr(sect2->u.indirect.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement ref. count on parent indirect section") /* Free second indirect section */ - if (H5HF_sect_indirect_free(sect2) < 0) + if (H5HF__sect_indirect_free(sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") /* Re-add the second section's first row */ @@ -3737,8 +3710,8 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(par_row >= hdr->man_dtable.max_direct_rows); /* Create parent indirect section */ - if (NULL == (par_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, - par_iblock, par_block_off, par_row, par_col, 1))) + if (NULL == (par_sect = H5HF__sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, + par_iblock, par_block_off, par_row, par_col, 1))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") /* No rows of direct blocks covered in parent, reset direct row information */ @@ -3759,7 +3732,7 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) done: if (ret_value < 0) - if (par_sect && H5HF_sect_indirect_free(par_sect) < 0) + if (par_sect && H5HF__sect_indirect_free(par_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) @@ -3813,7 +3786,7 @@ H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free child section node") /* Free the indirect section itself */ - if (H5HF_sect_indirect_free(sect) < 0) + if (H5HF__sect_indirect_free(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") done: @@ -3821,7 +3794,7 @@ done: } /* end H5HF__sect_indirect_shrink() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_serialize + * Function: H5HF__sect_indirect_serialize * * Purpose: Serialize a "live" indirect section into a buffer * @@ -3835,11 +3808,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf) +H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -3849,7 +3822,7 @@ H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, u /* Check if this indirect section has a parent & forward if this section is first */ if (sect->u.indirect.parent) { if (sect->sect_info.addr == sect->u.indirect.parent->sect_info.addr) - if (H5HF_sect_indirect_serialize(hdr, sect->u.indirect.parent, buf) < 0) + if (H5HF__sect_indirect_serialize(hdr, sect->u.indirect.parent, buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSERIALIZE, FAIL, "can't serialize indirect section's parent indirect section") } /* end if */ @@ -3874,7 +3847,7 @@ H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, u done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_serialize() */ +} /* H5HF__sect_indirect_serialize() */ /*------------------------------------------------------------------------- * Function: H5HF__sect_indirect_deserialize @@ -3925,8 +3898,8 @@ H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, haddr_t sec UINT16DECODE(buf, nentries); /* Create free space section node */ - if (NULL == (new_sect = H5HF_sect_indirect_new(hdr, sect_addr, sect_size, NULL, iblock_off, start_row, - start_col, nentries))) + if (NULL == (new_sect = H5HF__sect_indirect_new(hdr, sect_addr, sect_size, NULL, iblock_off, start_row, + start_col, nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create indirect section") /* Compute start entry */ @@ -3954,7 +3927,7 @@ done: } /* H5HF__sect_indirect_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_free + * Function: H5HF__sect_indirect_free * * Purpose: Free a 'indirect' section node * @@ -3968,12 +3941,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_free(H5HF_free_section_t *sect) +H5HF__sect_indirect_free(H5HF_free_section_t *sect) { H5HF_indirect_t *iblock = NULL; /* Indirect block for section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); @@ -3984,22 +3957,21 @@ H5HF_sect_indirect_free(H5HF_free_section_t *sect) sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.indir_ents); /* Check for live reference to an indirect block */ - if (sect->sect_info.state == H5FS_SECT_LIVE) { + if (sect->sect_info.state == H5FS_SECT_LIVE) /* Get indirect block, if there was one */ if (sect->u.indirect.u.iblock) iblock = sect->u.indirect.u.iblock; - } /* end if */ /* Release the sections */ - if (H5HF_sect_node_free(sect, iblock) < 0) + if (H5HF__sect_node_free(sect, iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_free() */ +} /* H5HF__sect_indirect_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_valid + * Function: H5HF__sect_indirect_valid * * Purpose: Check the validity of a section * @@ -4012,7 +3984,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) +H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) { unsigned start_row; /* Row for first block covered */ unsigned start_col; /* Column for first block covered */ @@ -4021,7 +3993,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) unsigned end_entry; /* Entry for last block covered */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check arguments */ HDassert(hdr); @@ -4094,15 +4066,15 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) } /* end if */ /* Recursively check child indirect section */ - H5HF_sect_indirect_valid(hdr, tmp_child_sect); + H5HF__sect_indirect_valid(hdr, tmp_child_sect); } /* end for */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_indirect_valid() */ +} /* H5HF__sect_indirect_valid() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_debug + * Function: H5HF__sect_indirect_debug * * Purpose: Dump debugging information about an indirect free space section * @@ -4116,9 +4088,9 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth) +H5HF__sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -4129,4 +4101,4 @@ H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int inde HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of entries:", sect->u.indirect.num_entries); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_indirect_debug() */ +} /* H5HF__sect_indirect_debug() */ diff --git a/src/H5HFspace.c b/src/H5HFspace.c index d0f4b7f..d62267c 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -221,7 +221,7 @@ done: } /* end H5HF__space_find() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_revert_root_cb + * Function: H5HF__space_revert_root_cb * * Purpose: Callback routine from iterator, to reset 'parent' pointers in * sections, when the heap is changing from having a root indirect @@ -236,12 +236,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) +H5HF__space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -263,7 +263,7 @@ H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udat done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_revert_root_cb() */ +} /* end H5HF__space_revert_root_cb() */ /*------------------------------------------------------------------------- * Function: H5HF__space_revert_root @@ -294,7 +294,7 @@ H5HF__space_revert_root(const H5HF_hdr_t *hdr) /* Only need to scan the sections if the free space has been initialized */ if (hdr->fspace) /* Iterate over all sections, resetting the parent pointers in 'single' sections */ - if (H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0) + if (H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF__space_revert_root_cb, NULL) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to reset parent pointers") done: @@ -302,7 +302,7 @@ done: } /* end H5HF__space_revert_root() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_create_root_cb + * Function: H5HF__space_create_root_cb * * Purpose: Callback routine from iterator, to set 'parent' pointers in * sections to newly created root indirect block, when the heap @@ -317,13 +317,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) +H5HF__space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ H5HF_indirect_t * root_iblock = (H5HF_indirect_t *)_udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -337,7 +337,7 @@ H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); /* Increment ref. count on new root indirect block */ - if (H5HF_iblock_incr(root_iblock) < 0) + if (H5HF__iblock_incr(root_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on section's indirect block") @@ -351,7 +351,7 @@ H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_create_root_cb() */ +} /* end H5HF__space_create_root_cb() */ /*------------------------------------------------------------------------- * Function: H5HF__space_create_root @@ -385,7 +385,7 @@ H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock) if (hdr->fspace) /* Iterate over all sections, seting the parent pointers in 'single' sections to the new indirect * block */ - if (H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0) + if (H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF__space_create_root_cb, root_iblock) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to set parent pointers") done: diff --git a/src/H5HFtest.c b/src/H5HFtest.c index 66cf4c3..84734d2 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -182,17 +182,12 @@ H5HF_cmp_cparam_test(const H5HF_create_t *cparam1, const H5HF_create_t *cparam2) */ #if 0 /* Check filter name */ - HDfprintf(stderr, "%s: Check 1.0\n", "H5HF_cmp_cparam_test"); - HDfprintf(stderr, "%s: cparam1->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u, - (cparam1->pline.filter[u].name ? cparam1->pline.filter[u].name : "")); - HDfprintf(stderr, "%s: cparam2->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u, - (cparam2->pline.filter[u].name ? cparam2->pline.filter[u].name : "")); - if (!cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) + if(!cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) HGOTO_DONE(-1) - else if (cparam1->pline.filter[u].name && !cparam2->pline.filter[u].name) + else if(cparam1->pline.filter[u].name && !cparam2->pline.filter[u].name) HGOTO_DONE(1) - else if (cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) { - if ((ret_value = HDstrcmp(cparam1->pline.filter[u].name, cparam2->pline.filter[u].name))) + else if(cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) { + if((ret_value = HDstrcmp(cparam1->pline.filter[u].name, cparam2->pline.filter[u].name))) HGOTO_DONE(ret_value) } /* end if */ #endif diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 9c5708d..eca177c 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -58,7 +58,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); +static herr_t H5HF__tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); /*********************/ /* Package Variables */ @@ -73,7 +73,7 @@ static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operato /*******************/ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_init + * Function: H5HF__tiny_init * * Purpose: Initialize information for tracking 'tiny' objects * @@ -85,9 +85,9 @@ static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operato *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_init(H5HF_hdr_t *hdr) +H5HF__tiny_init(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -115,10 +115,10 @@ H5HF_tiny_init(H5HF_hdr_t *hdr) } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_tiny_init() */ +} /* end H5HF__tiny_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_insert + * Function: H5HF__tiny_insert * * Purpose: Pack a 'tiny' object in a heap ID * @@ -130,13 +130,13 @@ H5HF_tiny_init(H5HF_hdr_t *hdr) *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) +H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) { uint8_t *id = (uint8_t *)_id; /* Pointer to ID buffer */ size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -168,15 +168,15 @@ H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) hdr->tiny_nobjs++; /* Mark heap header as modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_insert() */ +} /* end H5HF__tiny_insert() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_get_obj_len + * Function: H5HF__tiny_get_obj_len * * Purpose: Get the size of a 'tiny' object in a fractal heap * @@ -188,11 +188,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) +H5HF__tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) { size_t enc_obj_size; /* Encoded object size */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -214,10 +214,10 @@ H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) *obj_len_p = enc_obj_size + 1; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_tiny_get_obj_len() */ +} /* end H5HF__tiny_get_obj_len() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_op_real + * Function: H5HF__tiny_op_real * * Purpose: Internal routine to perform operation on 'tiny' object * @@ -229,12 +229,12 @@ H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) *------------------------------------------------------------------------- */ static herr_t -H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) +H5HF__tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) { size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -244,8 +244,8 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void * HDassert(op); /* Get the object's encoded length */ - /* H5HF_tiny_obj_len can't fail */ - ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size); + /* H5HF__tiny_obj_len can't fail */ + ret_value = H5HF__tiny_get_obj_len(hdr, id, &enc_obj_size); /* Advance past flag byte(s) */ if (!hdr->tiny_len_extended) @@ -264,10 +264,10 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void * done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_op_real() */ +} /* end H5HF__tiny_op_real() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_read + * Function: H5HF__tiny_read * * Purpose: Read a 'tiny' object from the heap * @@ -279,11 +279,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) +H5HF__tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -293,15 +293,15 @@ H5HF_tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine */ - if (H5HF_tiny_op_real(hdr, id, H5HF_op_read, obj) < 0) + if (H5HF__tiny_op_real(hdr, id, H5HF__op_read, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_read() */ +} /* end H5HF__tiny_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_op + * Function: H5HF__tiny_op * * Purpose: Operate directly on a 'tiny' object * @@ -313,11 +313,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) +H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -327,15 +327,15 @@ H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_da HDassert(op); /* Call the internal 'op' routine routine */ - if (H5HF_tiny_op_real(hdr, id, op, op_data) < 0) + if (H5HF__tiny_op_real(hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_op() */ +} /* end H5HF__tiny_op() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_remove + * Function: H5HF__tiny_remove * * Purpose: Remove a 'tiny' object from the heap statistics * @@ -347,12 +347,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) +H5HF__tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) { size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -361,17 +361,17 @@ H5HF_tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) HDassert(id); /* Get the object's encoded length */ - /* H5HF_tiny_obj_len can't fail */ - ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size); + /* H5HF__tiny_obj_len can't fail */ + ret_value = H5HF__tiny_get_obj_len(hdr, id, &enc_obj_size); /* Update statistics about heap */ hdr->tiny_size -= enc_obj_size; hdr->tiny_nobjs--; /* Mark heap header as modified */ - if (H5HF_hdr_dirty(hdr) < 0) + if (H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_remove() */ +} /* end H5HF__tiny_remove() */ diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 01c3fe3..6f71966 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -187,12 +187,12 @@ H5SM__bt2_debug(FILE *stream, int indent, int fwidth, const void *record, const FUNC_ENTER_STATIC_NOERR if (sohm->location == H5SM_IN_HEAP) - HDfprintf(stream, "%*s%-*s {%a, %lo, %Hx}\n", indent, "", fwidth, - "Shared Message in heap:", sohm->u.heap_loc.fheap_id, sohm->hash, + HDfprintf(stream, "%*s%-*s {%" PRIu64 ", %" PRIo32 ", %" PRIxHSIZE "}\n", indent, "", fwidth, + "Shared Message in heap:", sohm->u.heap_loc.fheap_id.val, sohm->hash, sohm->u.heap_loc.ref_count); else { HDassert(sohm->location == H5SM_IN_OH); - HDfprintf(stream, "%*s%-*s {%a, %lo, %Hx, %Hx}\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIo32 ", %x, %" PRIx32 "}\n", indent, "", fwidth, "Shared Message in OH:", sohm->u.mesg_loc.oh_addr, sohm->hash, sohm->msg_type_id, sohm->u.mesg_loc.index); } /* end else */ -- cgit v0.12