From 4b6469218705845cf83f0e65c5ba2ce8b194552a Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 23 Nov 2015 16:11:58 -0500 Subject: [svn-r28454] Description: Warning & code style cleanups, along with normalizations against trunk. Tested on: MacOSX/64 10.11.1 (amazon) w/serial & parallel (h5committest not required on this branch) --- src/H5AC.c | 137 +++++++++++++++++++++++++------------------------------ src/H5ACmpio.c | 10 ++-- src/H5ACpkg.h | 2 +- src/H5ACpublic.h | 2 +- src/H5B.c | 25 ++++------ src/H5Cprivate.h | 4 +- src/H5D.c | 2 +- src/H5Dbtree.c | 21 ++++----- src/H5Dbtree2.c | 16 +++---- src/H5Dchunk.c | 44 +++++++++--------- src/H5Dearray.c | 10 ++-- src/H5Dfarray.c | 10 ++-- src/H5Dint.c | 3 -- src/H5Dlayout.c | 1 + src/H5Doh.c | 2 + src/H5Dpkg.h | 6 +-- src/H5Dsingle.c | 10 ++-- src/H5Dvirtual.c | 1 - src/H5FDmulti.c | 16 +++---- 19 files changed, 148 insertions(+), 174 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index 31008ae..16b3880 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -39,16 +39,17 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACpkg.h" /* Metadata cache */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACpkg.h" /* Metadata cache */ #include "H5Cpkg.h" /* Cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* Files */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* Files */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Iprivate.h" /* IDs */ #include "H5Pprivate.h" /* Property lists */ #include "H5SLprivate.h" /* Skip Lists */ + /****************/ /* Local Macros */ /****************/ @@ -67,6 +68,9 @@ static herr_t H5AC__check_if_write_permitted(const H5F_t *f, hbool_t *write_permitted_ptr); static herr_t H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, H5C_auto_size_ctl_t *int_conf_ptr); +#if H5AC_DO_TAGGING_SANITY_CHECKS +static herr_t H5AC__verify_tag(hid_t dxpl_id, const H5AC_class_t * type); +#endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ /*********************/ @@ -97,11 +101,7 @@ hid_t H5AC_ind_dxpl_id = (-1); /* Local Variables */ /*******************/ -#if H5AC_DO_TAGGING_SANITY_CHECKS -static herr_t H5AC_verify_tag(hid_t dxpl_id, const H5AC_class_t * type); -#endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ - -static const char * H5AC_entry_type_names[H5AC_NTYPES] = +static const char *H5AC_entry_type_names[H5AC_NTYPES] = { "B-tree nodes", "symbol table nodes", @@ -134,6 +134,7 @@ static const char * H5AC_entry_type_names[H5AC_NTYPES] = "test entry" /* for testing only -- not used for actual files */ }; + /*------------------------------------------------------------------------- * Function: H5AC_init @@ -421,10 +422,11 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) if(f->shared->use_mdc_logging) { if(H5C_set_up_logging(f->shared->cache, f->shared->mdc_log_location, f->shared->start_mdc_log_on_access) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "mdc logging setup failed") + /* Write the log header regardless of current logging status */ if(H5AC__write_create_cache_log_msg(f->shared->cache) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to emit log message") - } + } /* end if */ /* Set the cache parameters */ if(H5AC_set_cache_auto_resize_config(f->shared->cache, config_ptr) < 0) @@ -491,7 +493,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to emit log message") if(H5C_tear_down_logging(f->shared->cache) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "mdc logging tear-down failed") - } + } /* end if */ #ifdef H5_HAVE_PARALLEL aux_ptr = H5C_get_aux_ptr(f->shared->cache); @@ -629,10 +631,9 @@ H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed.") done: - #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ @@ -640,7 +641,6 @@ done: if(H5AC__write_expunge_entry_log_msg(f->shared->cache, addr, type->id, ret_value) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to emit log message") - FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_expunge_entry() */ @@ -669,12 +669,12 @@ herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id) { #if H5AC__TRACE_FILE_ENABLED - char trace[128] = ""; - FILE * trace_file_ptr = NULL; + char trace[128] = ""; + FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ hbool_t log_enabled; /* TRUE if logging was set up */ hbool_t curr_logging; /* TRUE if currently logging */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -692,7 +692,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) * Write the result to catch occult errors. */ if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr(cache_ptr))) - sprintf(trace, "%s", FUNC); + sprintf(trace, "%s", FUNC); #endif /* H5AC__TRACE_FILE_ENABLED */ #ifdef H5_HAVE_PARALLEL @@ -707,7 +707,6 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache.") done: - #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); @@ -807,13 +806,13 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add void *thing, unsigned int flags) { #if H5AC__TRACE_FILE_ENABLED - char trace[128] = ""; + char trace[128] = ""; size_t trace_entry_size = 0; - FILE * trace_file_ptr = NULL; + FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ - hbool_t log_enabled; /* TRUE if logging was set up */ - hbool_t curr_logging; /* TRUE if currently logging */ - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t log_enabled; /* TRUE if logging was set up */ + hbool_t curr_logging; /* TRUE if currently logging */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -848,7 +847,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add #endif /* H5AC__TRACE_FILE_ENABLED */ #if H5AC_DO_TAGGING_SANITY_CHECKS - if (!f->shared->cache->ignore_tags && (H5AC_verify_tag(dxpl_id, type) < 0)) + if (!f->shared->cache->ignore_tags && (H5AC__verify_tag(dxpl_id, type) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Bad tag value") #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ @@ -886,15 +885,13 @@ done: #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ if(curr_logging) - if(H5AC__write_insert_entry_log_msg(f->shared->cache, addr, type->id, flags, - ((H5C_cache_entry_t *)thing)->size, ret_value) < 0) + if(H5AC__write_insert_entry_log_msg(f->shared->cache, addr, type->id, flags, ((H5C_cache_entry_t *)thing)->size, ret_value) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_insert_entry() */ - /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_dirty * @@ -912,8 +909,8 @@ herr_t H5AC_mark_entry_dirty(void *thing) { #if H5AC__TRACE_FILE_ENABLED - char trace[128] = ""; - FILE * trace_file_ptr = NULL; + char trace[128] = ""; + FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ hbool_t log_enabled; /* TRUE if logging was set up */ hbool_t curr_logging; /* TRUE if currently logging */ @@ -938,6 +935,7 @@ H5AC_mark_entry_dirty(void *thing) entry_ptr = (H5AC_info_t *)thing; cache_ptr = entry_ptr->cache_ptr; + /* Check if log messages are being emitted */ if(H5C_get_logging_status(cache_ptr, &log_enabled, &curr_logging) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to get logging status") @@ -958,10 +956,9 @@ H5AC_mark_entry_dirty(void *thing) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't mark pinned or protected entry dirty") done: - #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ @@ -991,8 +988,8 @@ herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr) { #if H5AC__TRACE_FILE_ENABLED - char trace[128] = ""; - FILE * trace_file_ptr = NULL; + char trace[128] = ""; + FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ #ifdef H5_HAVE_PARALLEL H5AC_aux_t *aux_ptr; @@ -1045,7 +1042,7 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ @@ -1107,14 +1104,14 @@ H5AC_pin_protected_entry(void *thing) if(H5C_get_logging_status(cache_ptr, &log_enabled, &curr_logging) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to get logging status") - /* pin entry */ + /* Pin entry */ if(H5C_pin_protected_entry(thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "can't pin entry") done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ @@ -1182,13 +1179,12 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing) done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ if(curr_logging) - if(H5AC__write_create_fd_log_msg(cache_ptr, (H5AC_info_t *)parent_thing, - (H5AC_info_t *)child_thing, ret_value) < 0) + if(H5AC__write_create_fd_log_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) @@ -1225,7 +1221,7 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; - size_t trace_entry_size = 0; + size_t trace_entry_size = 0; FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ void *thing = NULL; /* Pointer to native data structure for entry */ @@ -1274,7 +1270,7 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #endif /* H5AC__TRACE_FILE_ENABLED */ #if H5AC_DO_TAGGING_SANITY_CHECKS - if (!f->shared->cache->ignore_tags && (H5AC_verify_tag(dxpl_id, type) < 0)) + if (!f->shared->cache->ignore_tags && (H5AC__verify_tag(dxpl_id, type) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, NULL, "Bad tag value") #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ @@ -1293,17 +1289,16 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) - HDfprintf(trace_file_ptr, "%s %d %d\n", trace, (int)trace_entry_size, (int)(ret_value != NULL)); + HDfprintf(trace_file_ptr, "%s %d %d\n", trace, (int)trace_entry_size, (int)(ret_value != NULL)); #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ if(curr_logging) { herr_t fake_ret_value = (NULL == ret_value) ? FAIL : SUCCEED; - if(H5AC__write_protect_entry_log_msg(f->shared->cache, (H5AC_info_t *)thing, - flags, fake_ret_value) < 0) + if(H5AC__write_protect_entry_log_msg(f->shared->cache, (H5AC_info_t *)thing, flags, fake_ret_value) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "unable to emit log message") - } + } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_protect() */ @@ -1325,8 +1320,8 @@ herr_t H5AC_resize_entry(void *thing, size_t new_size) { #if H5AC__TRACE_FILE_ENABLED - char trace[128] = ""; - FILE * trace_file_ptr = NULL; + char trace[128] = ""; + FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ hbool_t log_enabled; /* TRUE if logging was set up */ hbool_t curr_logging; /* TRUE if currently logging */ @@ -1360,7 +1355,7 @@ H5AC_resize_entry(void *thing, size_t new_size) if(H5C_get_logging_status(cache_ptr, &log_enabled, &curr_logging) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to get logging status") - /* resize the entry */ + /* Resize the entry */ if(H5C_resize_entry(thing, new_size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "can't resize entry") @@ -1378,7 +1373,7 @@ H5AC_resize_entry(void *thing, size_t new_size) done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ @@ -1440,14 +1435,14 @@ H5AC_unpin_entry(void *thing) if(H5C_get_logging_status(cache_ptr, &log_enabled, &curr_logging) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to get logging status") - /* unpin the entry */ + /* Unpin the entry */ if(H5C_unpin_entry(thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "can't unpin entry") done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ @@ -1507,20 +1502,19 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing) if(H5C_get_logging_status(cache_ptr, &log_enabled, &curr_logging) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to get logging status") - /* destry the flush dependency */ + /* Destroy the flush dependency */ if(H5C_destroy_flush_dependency(parent_thing, child_thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "H5C_destroy_flush_dependency() failed.") done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); #endif /* H5AC__TRACE_FILE_ENABLED */ /* If currently logging, generate a message */ if(curr_logging) - if(H5AC__write_destroy_fd_log_msg(cache_ptr, (H5AC_info_t *)parent_thing, - (H5AC_info_t *)child_thing, ret_value) < 0) + if(H5AC__write_destroy_fd_log_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) @@ -1658,8 +1652,7 @@ done: /* If currently logging, generate a message */ if(curr_logging) - if(H5AC__write_unprotect_entry_log_msg(f->shared->cache, (H5AC_info_t *)thing, - type->id, flags, ret_value) < 0) + if(H5AC__write_unprotect_entry_log_msg(f->shared->cache, (H5AC_info_t *)thing, type->id, flags, ret_value) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) @@ -1809,12 +1802,12 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, if(NULL != (aux_ptr = H5C_get_aux_ptr(cache_ptr))) { config_ptr->dirty_bytes_threshold = aux_ptr->dirty_bytes_threshold; - config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy; + config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy; } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ config_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD; - config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; + config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; #ifdef H5_HAVE_PARALLEL } /* end else */ } @@ -2053,8 +2046,8 @@ done: if(curr_logging) if(H5AC__write_set_cache_config_log_msg(cache_ptr, config_ptr, ret_value) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to emit log message") - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_set_cache_auto_resize_config() */ @@ -2094,9 +2087,6 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr) if(config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version.") - if((config_ptr->rpt_fcn_enabled != TRUE) && (config_ptr->rpt_fcn_enabled != FALSE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->rpt_fcn_enabled must be either TRUE or FALSE.") - /* don't bother to test trace_file_name unless open_trace_file is TRUE */ if(config_ptr->open_trace_file) { size_t name_len; @@ -2537,10 +2527,9 @@ done: herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag) { - /* Variable Declarations */ - H5C_tag_t tag; /* tag structure */ - H5P_genplist_t *dxpl = NULL; /* dataset transfer property list */ - herr_t ret_value = SUCCEED; /* return value */ + H5C_tag_t tag; /* Tag structure */ + H5P_genplist_t *dxpl; /* Dataset transfer property list */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2722,7 +2711,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5AC_verify_tag + * Function: H5AC__verify_tag * * Purpose: Performs sanity checking on an entry type and tag value * stored in a supplied dxpl_id. @@ -2735,13 +2724,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC_verify_tag(hid_t dxpl_id, const H5AC_class_t * type) +H5AC__verify_tag(hid_t dxpl_id, const H5AC_class_t * type) { H5C_tag_t tag; H5P_genplist_t * dxpl; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the dataset transfer property list */ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) @@ -2811,7 +2800,7 @@ H5AC_verify_tag(hid_t dxpl_id, const H5AC_class_t * type) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_verify_tag */ +} /* H5AC__verify_tag */ #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index b23949a..8655a6f 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -36,11 +36,11 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACpkg.h" /* Metadata cache */ -#include "H5Cprivate.h" /* Cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* Files */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACpkg.h" /* Metadata cache */ +#include "H5Cprivate.h" /* Cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* Files */ #include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_PARALLEL diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 4e0b358..82e500e 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -421,7 +421,7 @@ H5_DLL herr_t H5AC__set_write_done_callback(H5C_t * cache_ptr, #endif /* H5_HAVE_PARALLEL */ /******************************/ -/* Pacakge Private Prototypes */ +/* Package Private Prototypes */ /******************************/ /* Cache logging routines */ diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index ac75d1f..dd16764 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -441,7 +441,7 @@ extern "C" { ****************************************************************************/ #define H5AC__CURR_CACHE_CONFIG_VERSION 1 -#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 +#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 #define H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY 0 #define H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED 1 diff --git a/src/H5B.c b/src/H5B.c index da1122c..b000cbd 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -111,6 +111,7 @@ #include "H5MFprivate.h" /* File memory management */ #include "H5Pprivate.h" /* Property lists */ + /****************/ /* Local Macros */ /****************/ @@ -560,7 +561,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void * udata) +H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) { /* * These are defined this way to satisfy alignment constraints. @@ -617,7 +618,6 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HDassert(!split_bt_ud.bt); HGOTO_DONE(SUCCEED) } /* end if */ - HDassert(H5B_INS_RIGHT == my_ins); HDassert(split_bt_ud.bt); HDassert(H5F_addr_defined(split_bt_ud.addr)); @@ -678,12 +678,9 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HDmemcpy(H5B_NKEY(new_root_bt, shared, 1), md_key, shared->type->sizeof_nkey); HDmemcpy(H5B_NKEY(new_root_bt, shared, 2), rt_key, shared->type->sizeof_nkey); + /* Insert the modified copy of the old root into the file again */ if(H5AC_insert_entry(f, dxpl_id, H5AC_BT, addr, new_root_bt, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to add new B-tree root node to cache") - - /* Mark new_root_bt as NULL, as it is not pinned or protected and does - * not need to be freed as it is now in the cache. */ - new_root_bt = NULL; + HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to add old B-tree root node to cache") done: if(ret_value < 0) @@ -750,7 +747,7 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, /* The MD_KEY is the left key of the new node */ if(H5B_INS_RIGHT == anchor) - (idx)++; /* Don't have to memmove() child addresses down, just add new child */ + idx++; /* Don't have to memmove() child addresses down, just add new child */ else /* Make room for the new child address */ bt->child[idx + 1] = bt->child[idx]; @@ -763,7 +760,7 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, /* The MD_KEY is the left key of the new node */ if(H5B_INS_RIGHT == anchor) - (idx)++; + idx++; /* Make room for the new child address */ HDmemmove(bt->child + idx + 1, bt->child + idx, @@ -777,7 +774,6 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, *bt_flags |= H5AC__DIRTIED_FLAG; FUNC_LEAVE_NOAPI(SUCCEED) - } /* end H5B_insert_child() */ @@ -1062,7 +1058,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, */ HDassert(!(bt->level == 0) != !(child_bt_ud.bt)); if(H5B_INS_LEFT == my_ins || H5B_INS_RIGHT == my_ins) { - hbool_t *tmp_bt_flags_ptr = NULL; + unsigned *tmp_bt_flags_ptr = NULL; H5B_t *tmp_bt; /* @@ -1122,8 +1118,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, done: if(child_bt_ud.bt) - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, child_bt_ud.bt, - child_bt_ud.cache_flags) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, child_bt_ud.bt, child_bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to unprotect child") if(new_child_bt_ud.bt) @@ -1610,8 +1605,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void /* The actual removal */ if(H5B__remove_helper(f, dxpl_id, addr, type, 0, lt_key, <_key_changed, - udata, rt_key, &rt_key_changed) - == H5B_INS_ERROR) + udata, rt_key, &rt_key_changed) == H5B_INS_ERROR) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree") #ifdef H5B_DEBUG @@ -2120,4 +2114,3 @@ H5B__node_dest(H5B_t *bt) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5B__node_dest() */ - diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 489a2d1..467c5d1 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -1153,8 +1153,6 @@ typedef enum { * ***************************************************************************/ - - /* Actions that can be reported to 'notify' client callback */ typedef enum H5C_notify_action_t { H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache @@ -1701,7 +1699,7 @@ typedef struct H5C_cache_entry_t { hbool_t image_up_to_date; const H5C_class_t * type; haddr_t tag; - int globality; + int globality; hbool_t is_corked; hbool_t is_dirty; hbool_t dirtied; diff --git a/src/H5D.c b/src/H5D.c index 9282aec..b1643d1 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -346,7 +346,7 @@ H5Dclose(hid_t dset_id) * reaches zero. */ if(H5I_dec_app_ref_always_close(dset_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't decrement count on dataset ID") + HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't decrement count on dataset ID") done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index e11c94a..15b9bec 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -126,7 +126,7 @@ static herr_t H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, haddr_t dset_ohdr_addr); static herr_t H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info); static hbool_t H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__btree_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t *dset); static herr_t H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); @@ -157,7 +157,7 @@ const H5D_chunk_ops_t H5D_COPS_BTREE[1] = {{ H5D__btree_idx_init, /* insert */ H5D__btree_idx_create, /* create */ H5D__btree_idx_is_space_alloc, /* is_space_alloc */ - H5D__btree_idx_insert_addr, /* insert */ + H5D__btree_idx_insert, /* insert */ H5D__btree_idx_get_addr, /* get_addr */ NULL, /* resize */ H5D__btree_idx_iterate, /* iterate */ @@ -855,7 +855,7 @@ H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate chunk layout") HDmemcpy(my_layout, layout, sizeof(H5O_layout_chunk_t)); shared->udata = my_layout; -HDassert(!store->u.btree.shared); + /* Make shared B-tree info reference counted */ if(NULL == (store->u.btree.shared = H5UC_create(shared, H5D__btree_shared_free))) HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") @@ -949,7 +949,7 @@ H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info) /* Create the v1 B-tree for the chunk index */ if(H5B_create(idx_info->f, idx_info->dxpl_id, H5B_BTREE, &udata, &(idx_info->storage->idx_addr)/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create B-tree") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create B-tree") done: FUNC_LEAVE_NOAPI(ret_value) @@ -981,9 +981,9 @@ H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /*------------------------------------------------------------------------- - * Function: H5D__btree_idx_insert_addr + * Function: H5D__btree_idx_insert * - * Purpose: Insert chunk address into the indexing structure. + * Purpose: Insert chunk entry into the indexing structure. * * Return: Non-negative on success/Negative on failure * @@ -993,7 +993,7 @@ H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) *------------------------------------------------------------------------- */ static herr_t -H5D__btree_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, +H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t H5_ATTR_UNUSED *dset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1017,7 +1017,7 @@ H5D__btree_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *u done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__btree_idx_insert_addr() */ +} /* H5D__btree_idx_insert() */ /*------------------------------------------------------------------------- @@ -1074,6 +1074,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static int H5D__btree_idx_iterate_cb(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, @@ -1179,7 +1180,6 @@ H5D__btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t HDassert(H5F_addr_defined(idx_info->storage->idx_addr)); HDassert(udata); - /* Remove the chunk from the v1 B-tree index and release the space for the * chunk (in the B-tree callback). */ @@ -1208,7 +1208,7 @@ done: static herr_t H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1224,7 +1224,6 @@ H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info) H5O_storage_chunk_t tmp_storage; /* Local copy of storage info */ H5D_chunk_common_ud_t udata; /* User data for B-tree operations */ - /* Set up temporary chunked storage info */ tmp_storage = *idx_info->storage; diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index 12b3194..5ff174d 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -120,7 +120,7 @@ static herr_t H5D__bt2_found_cb(const void *nrecord, void *op_data); */ static herr_t H5D__bt2_remove_cb(const void *nrecord, void *_udata); -/* Callback for H5B2_modify() which is called in H5D__bt2_idx_insert_addr() */ +/* Callback for H5B2_modify() which is called in H5D__bt2_idx_insert() */ static herr_t H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed); /* Chunked layout indexing callbacks for v2 B-tree indexing */ @@ -128,7 +128,7 @@ static herr_t H5D__bt2_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, haddr_t dset_ohdr_addr); static herr_t H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info); static hbool_t H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__bt2_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t *dset); static herr_t H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); @@ -158,7 +158,7 @@ const H5D_chunk_ops_t H5D_COPS_BT2[1] = {{ H5D__bt2_idx_init, /* init */ H5D__bt2_idx_create, /* create */ H5D__bt2_idx_is_space_alloc, /* is_space_alloc */ - H5D__bt2_idx_insert_addr, /* insert */ + H5D__bt2_idx_insert, /* insert */ H5D__bt2_idx_get_addr, /* get_addr */ NULL, /* resize */ H5D__bt2_idx_iterate, /* iterate */ @@ -917,7 +917,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) * * Purpose: Modify record for dataset chunk when it is found in a v2 B-tree. * This is the callback for H5B2_modify() which is called in - * H5D__bt2_idx_insert_addr(). + * H5D__bt2_idx_insert(). * * Return: Success: non-negative * Failure: negative @@ -941,7 +941,7 @@ H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed) /*------------------------------------------------------------------------- - * Function: H5D__bt2_idx_insert_addr + * Function: H5D__bt2_idx_insert * * Purpose: Insert chunk address into the indexing structure. * A non-filtered chunk: @@ -959,7 +959,7 @@ H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed) *------------------------------------------------------------------------- */ static herr_t -H5D__bt2_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, +H5D__bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t H5_ATTR_UNUSED *dset) { H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */ @@ -1017,7 +1017,7 @@ H5D__bt2_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__bt2_idx_insert_addr() */ +} /* H5D__bt2_idx_insert() */ /*------------------------------------------------------------------------- @@ -1025,7 +1025,7 @@ done: * * Purpose: Retrieve record for dataset chunk when it is found in a v2 B-tree. * This is the callback for H5B2_find() which is called in - * H5D__bt2_idx_get_addr() and H5D__bt2_idx_insert_addr(). + * H5D__bt2_idx_get_addr() and H5D__bt2_idx_insert(). * * Return: Success: non-negative * Failure: negative diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 7090727..a82667e 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -257,6 +257,8 @@ static herr_t H5D__chunk_file_cb(void *elem, const H5T_t *type, unsigned ndims, static herr_t H5D__chunk_mem_cb(void *elem, const H5T_t *type, unsigned ndims, const hsize_t *coords, void *fm); static unsigned H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled); +static herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, + const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset); static herr_t H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t flush); static hbool_t H5D__chunk_is_partial_edge_chunk(const hsize_t *chunk_scaled, @@ -385,6 +387,7 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Check if the chunk needs to be inserted (it also could exist already * and the chunk allocate operation could resize it) */ + /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; idx_info.dxpl_id = dxpl_id; @@ -425,11 +428,11 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Insert the chunk record into the index */ - if((need_insert || udata.need_modify) && layout->storage.u.chunk.ops->insert_addr) { + if((need_insert || udata.need_modify) && layout->storage.u.chunk.ops->insert) { /* Set the chunk's filter mask to the new settings */ udata.filter_mask = filters; - if((layout->storage.u.chunk.ops->insert_addr)(&idx_info, &udata, NULL) < 0) + if((layout->storage.u.chunk.ops->insert)(&idx_info, &udata, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index") } /* end if */ @@ -1760,9 +1763,9 @@ done: htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op) { - const H5D_t *dataset = io_info->dset; + const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ hbool_t no_filters = TRUE; - htri_t ret_value = FAIL; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1939,7 +1942,6 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Determine if we should use the chunk cache */ if((cacheable = H5D__chunk_cacheable(io_info, udata.chunk_block.offset, FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable") - if(cacheable) { /* Load the chunk into cache and lock it. */ @@ -2137,8 +2139,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") } /* end if */ else { - if((need_insert || udata.need_modify) && io_info->dset->shared->layout.storage.u.chunk.ops->insert_addr) - if((io_info->dset->shared->layout.storage.u.chunk.ops->insert_addr)(&idx_info, &udata, NULL) < 0) + if((need_insert || udata.need_modify) && io_info->dset->shared->layout.storage.u.chunk.ops->insert) + if((io_info->dset->shared->layout.storage.u.chunk.ops->insert)(&idx_info, &udata, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index") } /* end else */ @@ -2516,7 +2518,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_create() */ - /*------------------------------------------------------------------------- * Function: H5D__chunk_hash_val @@ -2640,7 +2641,7 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.storage = &dset->shared->layout.storage.u.chunk; /* Go get the chunk information */ if((dset->shared->layout.storage.u.chunk.ops->get_addr)(&idx_info, udata) < 0) @@ -2671,7 +2672,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset) { @@ -2797,8 +2798,8 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Insert the chunk record into the index */ - if((need_insert || udata.need_modify) && dset->shared->layout.storage.u.chunk.ops->insert_addr) - if((dset->shared->layout.storage.u.chunk.ops->insert_addr)(&idx_info, &udata, dset) < 0) + if((need_insert || udata.need_modify) && dset->shared->layout.storage.u.chunk.ops->insert) + if((dset->shared->layout.storage.u.chunk.ops->insert)(&idx_info, &udata, dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index") /* Cache the chunk's info, in case it's accessed again shortly */ @@ -3681,7 +3682,7 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, unsigned space_ndims; /* Dataset's space rank */ const hsize_t *space_dim; /* Dataset's dataspace dimensions */ const uint32_t *chunk_dim = layout->u.chunk.dim; /* Convenience pointer to chunk dimensions */ - unsigned op_dim; /* Current operationg dimension */ + unsigned op_dim; /* Current operating dimension */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ hbool_t has_unfilt_edge_chunks = FALSE; /* Whether there are partial edge chunks with disabled filters */ @@ -4009,8 +4010,8 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, /* (Note that this isn't safe, from a SWMR perspective, unlike * serial operation. -QAK */ - if((need_insert || udata.need_modify) && ops->insert_addr) - if((ops->insert_addr)(&idx_info, &udata, dset) < 0) + if((need_insert || udata.need_modify) && ops->insert) + if((ops->insert)(&idx_info, &udata, dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index") /* Increment indices and adjust the edge chunk state */ @@ -4666,7 +4667,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ unsigned space_ndims; /* Dataset's space rank */ const hsize_t *space_dim; /* Current dataspace dimensions */ - unsigned op_dim; /* Current operationg dimension */ + unsigned op_dim; /* Current operating dimension */ hbool_t shrunk_dim[H5O_LAYOUT_NDIMS]; /* Dimensions which have shrunk */ H5D_chunk_it_ud1_t udata; /* Chunk index iterator user data */ hbool_t udata_init = FALSE; /* Whether the chunk index iterator user data has been initialized */ @@ -5254,7 +5255,7 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) /* Remove the old entry from the cache */ if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) - HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") + HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") } /* end while */ done: @@ -5450,8 +5451,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_BEGIN_TAG(udata->idx_info_dst->dxpl_id, H5AC__COPIED_TAG, H5_ITER_ERROR); /* Insert chunk record into index */ - if((need_insert || udata_dst.need_modify) && udata->idx_info_dst->storage->ops->insert_addr) - if((udata->idx_info_dst->storage->ops->insert_addr)(udata->idx_info_dst, &udata_dst, NULL) < 0) + if((need_insert || udata_dst.need_modify) && udata->idx_info_dst->storage->ops->insert) + if((udata->idx_info_dst->storage->ops->insert)(udata->idx_info_dst, &udata_dst, NULL) < 0) HGOTO_ERROR_TAG(H5E_DATASET, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert chunk addr into index") /* Reset metadata tag in dxpl_id */ @@ -5473,9 +5474,6 @@ done: * Programmer: Peter Cao * August 20, 2005 * - * Vailin Choi; August 2010 - * Added v2-btree indexing - * *------------------------------------------------------------------------- */ herr_t @@ -6312,7 +6310,7 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) insert_udata.common.storage = new_idx_info->storage; /* Insert chunk into the v1 B-tree chunk index */ - if((new_idx_info->storage->ops->insert_addr)(new_idx_info, &insert_udata, NULL) < 0) + if((new_idx_info->storage->ops->insert)(new_idx_info, &insert_udata, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert chunk addr into index") done: diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 27c6b26..a132724 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -125,7 +125,7 @@ static herr_t H5D__earray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, haddr_t dset_ohdr_addr); static herr_t H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info); static hbool_t H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__earray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t *dset); static herr_t H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); @@ -162,7 +162,7 @@ const H5D_chunk_ops_t H5D_COPS_EARRAY[1] = {{ H5D__earray_idx_init, /* init */ H5D__earray_idx_create, /* create */ H5D__earray_idx_is_space_alloc, /* is_space_alloc */ - H5D__earray_idx_insert_addr, /* insert */ + H5D__earray_idx_insert, /* insert */ H5D__earray_idx_get_addr, /* get_addr */ H5D__earray_idx_resize, /* resize */ H5D__earray_idx_iterate, /* iterate */ @@ -1067,7 +1067,7 @@ H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_insert_addr + * Function: H5D__earray_idx_insert * * Purpose: Insert chunk address into the indexing structure. * @@ -1078,7 +1078,7 @@ H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) *------------------------------------------------------------------------- */ static herr_t -H5D__earray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, +H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t H5_ATTR_UNUSED *dset) { H5EA_t *ea; /* Pointer to extensible array structure */ @@ -1129,7 +1129,7 @@ H5D__earray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t * done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__earray_idx_insert_addr() */ +} /* H5D__earray_idx_insert() */ /*------------------------------------------------------------------------- diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 8ae4af5..47026e5 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -128,7 +128,7 @@ static herr_t H5D__farray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, haddr_t dset_ohdr_addr); static herr_t H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info); static hbool_t H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__farray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t *dset); static herr_t H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); @@ -162,7 +162,7 @@ const H5D_chunk_ops_t H5D_COPS_FARRAY[1] = {{ H5D__farray_idx_init, /* init */ H5D__farray_idx_create, /* create */ H5D__farray_idx_is_space_alloc, /* is_space_alloc */ - H5D__farray_idx_insert_addr, /* insert */ + H5D__farray_idx_insert, /* insert */ H5D__farray_idx_get_addr, /* get_addr */ NULL, /* resize */ H5D__farray_idx_iterate, /* iterate */ @@ -1016,7 +1016,7 @@ H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_insert_addr + * Function: H5D__farray_idx_insert * * Purpose: Insert chunk address into the indexing structure. * @@ -1027,7 +1027,7 @@ H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) *------------------------------------------------------------------------- */ static herr_t -H5D__farray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, +H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t H5_ATTR_UNUSED *dset) { H5FA_t *fa; /* Pointer to fixed array structure */ @@ -1078,7 +1078,7 @@ H5D__farray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t * done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__farray_idx_insert_addr() */ +} /* H5D__farray_idx_insert() */ /*------------------------------------------------------------------------- diff --git a/src/H5Dint.c b/src/H5Dint.c index ad0484e..3e54471 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1446,7 +1446,6 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) /* We're the first dataset to use the the shared info */ dataset->shared->fo_count = 1; - } /* end if */ else { /* Point to shared info */ @@ -1465,7 +1464,6 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) /* Increment object count for the object in the top file */ if(H5FO_top_incr(dataset->oloc.file, dataset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't increment object count") - } /* end else */ /* Set the dataset to return */ @@ -2811,7 +2809,6 @@ H5D__flush_real(H5D_t *dataset, hid_t dxpl_id) HDassert(dataset); HDassert(dataset->shared); - /* Avoid flushing the dataset (again) if it's closing */ if(!dataset->shared->closing) { diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 5a0e26b..beccdd7 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -548,6 +548,7 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, /* (Note: this is relying on H5D_alloc_storage not calling H5O_msg_write during dataset creation) */ if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_LAYOUT_ID, ((fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY && H5D_COMPACT != layout->type && !dset->shared->dcpl_cache.pline.nused) ? H5O_MSG_FLAG_CONSTANT : 0), 0, layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout") + done: /* Error cleanup */ if(ret_value < 0) diff --git a/src/H5Doh.c b/src/H5Doh.c index ae3d9ea..1c0b531 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -478,6 +478,8 @@ H5O__dset_flush(void *_obj_ptr, hid_t dxpl_id) if(H5D__flush_real(dset, dxpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__dset_flush() */ + diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index df16d45..e899784 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -330,7 +330,7 @@ typedef struct H5D_chunk_ops_t { H5D_chunk_init_func_t init; /* Routine to initialize indexing information in memory */ H5D_chunk_create_func_t create; /* Routine to create chunk index */ H5D_chunk_is_space_alloc_func_t is_space_alloc; /* Query routine to determine if storage/index is allocated */ - H5D_chunk_insert_func_t insert_addr; /* Routine to insert a chunk into an index */ + H5D_chunk_insert_func_t insert; /* Routine to insert a chunk into an index */ H5D_chunk_get_addr_func_t get_addr; /* Routine to retrieve address of chunk in file */ H5D_chunk_resize_func_t resize; /* Routine to update chunk index info after resizing dataset */ H5D_chunk_iterate_func_t iterate; /* Routine to iterate over chunks */ @@ -565,6 +565,7 @@ typedef struct H5D_rdcc_ent_t { } H5D_rdcc_ent_t; typedef H5D_rdcc_ent_t *H5D_rdcc_ent_ptr_t; /* For free lists */ + /*****************************/ /* Package Private Variables */ /*****************************/ @@ -619,7 +620,6 @@ H5_DLL herr_t H5D__flush_real(H5D_t *dataset, hid_t dxpl_id); H5_DLL herr_t H5D__mark(const H5D_t *dataset, hid_t dxpl_id, unsigned flags); H5_DLL herr_t H5D__refresh(hid_t dset_id, H5D_t *dataset, hid_t dxpl_id); - /* To convert a dataset's chunk indexing type to v1 B-tree */ H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); @@ -695,8 +695,6 @@ H5_DLL void *H5D__chunk_lock(const H5D_io_info_t *io_info, H5_DLL herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed); -H5_DLL herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, - const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset); H5_DLL herr_t H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes); H5_DLL herr_t H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hsize_t old_dim[]); diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index b49a578..b472f7e 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -61,7 +61,7 @@ static herr_t H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, haddr_t dset_ohdr_addr); static herr_t H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info); static hbool_t H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D__single_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t *dset); static herr_t H5D__single_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); @@ -88,7 +88,7 @@ const H5D_chunk_ops_t H5D_COPS_SINGLE[1] = {{ H5D__single_idx_init, /* init */ H5D__single_idx_create, /* create */ H5D__single_idx_is_space_alloc, /* is_space_alloc */ - H5D__single_idx_insert_addr, /* insert */ + H5D__single_idx_insert, /* insert */ H5D__single_idx_get_addr, /* get_addr */ NULL, /* resize */ H5D__single_idx_iterate, /* iterate */ @@ -208,7 +208,7 @@ H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /*------------------------------------------------------------------------- - * Function: H5D__single_idx_insert_addr + * Function: H5D__single_idx_insert * * Purpose: Allocate space for the single chunk * @@ -219,7 +219,7 @@ H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage) *------------------------------------------------------------------------- */ static herr_t -H5D__single_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, +H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t *dset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -255,7 +255,7 @@ H5D__single_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t * done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__single_idx_insert_addr() */ +} /* H5D__single_idx_insert() */ /*------------------------------------------------------------------------- diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index d435c0d..5e63448 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -801,7 +801,6 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy source dataspace extent") virtual_ent->source_space_status = H5O_VIRTUAL_STATUS_CORRECT; } /* end if */ - } /* end else */ } /* end if */ diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 5026e60..181ad39 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -1808,7 +1808,6 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw) H5FD_multi_t *file = (H5FD_multi_t*)_file; int nerrors = 0; H5FD_mem_t out_mt; - int k; static const char *func="H5FD_multi_unlock"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1829,11 +1828,13 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw) /* Try to unlock the member files that are locked before error is encountered */ if(nerrors) { - for(k = (int)H5FD_MEM_DEFAULT; k < (int)out_mt; k++) { - H5E_BEGIN_TRY { - if(H5FDunlock(file->memb[k]) < 0) - nerrors++; - } H5E_END_TRY; + H5FD_mem_t k; + + for(k = H5FD_MEM_DEFAULT; k < out_mt; k = (H5FD_mem_t)(k + 1)) { + H5E_BEGIN_TRY { + if(H5FDunlock(file->memb[k]) < 0) + nerrors++; + } H5E_END_TRY; } /* end for */ } /* end if */ @@ -1869,10 +1870,9 @@ H5FD_multi_unlock(H5FD_t *_file) H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { - if(file->memb[mt]) { + if(file->memb[mt]) if(H5FDunlock(file->memb[mt]) < 0) nerrors++; - } } END_MEMBERS; if(nerrors) -- cgit v0.12