summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5AC.c12
-rw-r--r--src/H5ACmpio.c4
-rw-r--r--src/H5ACprivate.h59
-rw-r--r--src/H5C.c457
-rw-r--r--src/H5Cpkg.h56
-rw-r--r--src/H5Ctag.c29
-rw-r--r--src/H5Dfarray.c2
-rw-r--r--src/H5Dpkg.h6
-rw-r--r--src/H5EA.c4
-rw-r--r--src/H5EAdblkpage.c4
-rw-r--r--src/H5EAhdr.c19
-rw-r--r--src/H5EApkg.h18
-rw-r--r--src/H5FA.c38
-rw-r--r--src/H5FAdblkpage.c4
-rw-r--r--src/H5FAdblock.c32
-rw-r--r--src/H5FAhdr.c8
-rw-r--r--src/H5FScache.c2
-rw-r--r--src/H5Fprivate.h4
-rw-r--r--src/H5Fsuper_cache.c2
-rw-r--r--src/H5HFiblock.c7
-rw-r--r--src/H5HG.c2
-rw-r--r--src/H5O.c16
-rw-r--r--src/H5Oalloc.c29
-rw-r--r--src/H5Ocache.c4
-rw-r--r--src/H5Ocopy.c10
-rw-r--r--src/H5Opkg.h2
-rw-r--r--src/H5SM.c4
-rw-r--r--src/H5Zszip.c2
-rw-r--r--src/H5system.c2
29 files changed, 295 insertions, 543 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index f226c3d..8433e77 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -32,7 +32,7 @@
/****************/
#include "H5ACmodule.h" /* This source code file is part of the H5AC module */
-#define H5F_FRIEND /* Suppress error about including H5Fpkg */
+#define H5F_FRIEND /* Suppress error about including H5Fpkg */
/***********/
@@ -880,7 +880,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(!H5C_get_ignore_tags(f->shared->cache) && (H5AC__verify_tag(dxpl_id, type) < 0))
+ if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(dxpl_id, type) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Bad tag value")
#endif /* H5AC_DO_TAGGING_SANITY_CHECKS */
@@ -966,8 +966,7 @@ H5AC_mark_entry_dirty(void *thing)
* occult errors.
*/
if(NULL != (trace_file_ptr = H5C_get_trace_file_ptr_from_entry(thing)))
- sprintf(trace, "%s 0x%lx", FUNC,
- (unsigned long)(((H5C_cache_entry_t *)thing)->addr));
+ sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(entry_ptr->addr));
#endif /* H5AC__TRACE_FILE_ENABLED */
/* Check if log messages are being emitted */
@@ -1291,7 +1290,7 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
#endif /* H5_HAVE_PARALLEL */
/* Check for invalid access request */
- if((0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) && (0 == (flags & H5C__READ_ONLY_FLAG)))
+ if((0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) && (0 == (flags & H5C__READ_ONLY_FLAG)))
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file")
#if H5AC__TRACE_FILE_ENABLED
@@ -1305,7 +1304,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(!H5C_get_ignore_tags(f->shared->cache) && (H5AC__verify_tag(dxpl_id, type) < 0))
+ if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(dxpl_id, type) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, NULL, "Bad tag value")
#endif /* H5AC_DO_TAGGING_SANITY_CHECKS */
@@ -2449,7 +2448,6 @@ H5AC_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_expunge_tag_type_metadata*/
diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c
index e33fc8e..89a8f9d 100644
--- a/src/H5ACmpio.c
+++ b/src/H5ACmpio.c
@@ -730,12 +730,10 @@ H5AC__log_deleted_entry(const H5AC_info_t *entry_ptr)
*
* If mpi_rank is 0, we must first check to see if the entry
* appears in the dirty entries slist. If it is, do nothing.
- * If it isn't, add the size to th dirty_bytes count, add the
+ * If it isn't, add the size to the dirty_bytes count, add the
* entry to the dirty entries slist, and remove it from the
* cleaned list (if it is present there).
*
- * Return SUCCEED on success, and FAIL on failure.
- *
* Return: Non-negative on success/Negative on failure.
*
* Programmer: John Mainzer, 6/29/05
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index c5bf8f3..739cbce 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -53,35 +53,35 @@
/* Types of metadata objects cached */
typedef enum {
- H5AC_BT_ID = 0, /* ( 0) B-tree nodes */
- H5AC_SNODE_ID, /* ( 1) symbol table nodes */
- H5AC_LHEAP_PRFX_ID, /* ( 2) local heap prefix */
- H5AC_LHEAP_DBLK_ID, /* ( 3) local heap data block */
- H5AC_GHEAP_ID, /* ( 4) global heap */
- H5AC_OHDR_ID, /* ( 5) object header */
- H5AC_OHDR_CHK_ID, /* ( 6) object header chunk */
- H5AC_BT2_HDR_ID, /* ( 7) v2 B-tree header */
- H5AC_BT2_INT_ID, /* ( 8) v2 B-tree internal node */
- H5AC_BT2_LEAF_ID, /* ( 9) v2 B-tree leaf node */
- H5AC_FHEAP_HDR_ID, /* (10) fractal heap header */
- H5AC_FHEAP_DBLOCK_ID, /* (11) fractal heap direct block */
- H5AC_FHEAP_IBLOCK_ID, /* (12) fractal heap indirect block */
- H5AC_FSPACE_HDR_ID, /* (13) free space header */
- H5AC_FSPACE_SINFO_ID, /* (14) free space sections */
- H5AC_SOHM_TABLE_ID, /* (15) shared object header message master table */
- H5AC_SOHM_LIST_ID, /* (16) shared message index stored as a list */
- H5AC_EARRAY_HDR_ID, /* (17) extensible array header */
- H5AC_EARRAY_IBLOCK_ID, /* (18) extensible array index block */
- H5AC_EARRAY_SBLOCK_ID, /* (19) extensible array super block */
- H5AC_EARRAY_DBLOCK_ID, /* (20) extensible array data block */
- H5AC_EARRAY_DBLK_PAGE_ID, /* (21) extensible array data block page */
- H5AC_FARRAY_HDR_ID, /* (22) fixed array header */
- H5AC_FARRAY_DBLOCK_ID, /* (23) fixed array data block */
- H5AC_FARRAY_DBLK_PAGE_ID, /* (24) fixed array data block page */
- H5AC_SUPERBLOCK_ID, /* (25) file superblock */
- H5AC_DRVRINFO_ID, /* (26) driver info block (supplements superblock) */
- H5AC_TEST_ID, /* (27) test entry -- not used for actual files */
- H5AC_NTYPES /* Number of types, must be last */
+ H5AC_BT_ID = 0, /* ( 0) B-tree nodes */
+ H5AC_SNODE_ID, /* ( 1) symbol table nodes */
+ H5AC_LHEAP_PRFX_ID, /* ( 2) local heap prefix */
+ H5AC_LHEAP_DBLK_ID, /* ( 3) local heap data block */
+ H5AC_GHEAP_ID, /* ( 4) global heap */
+ H5AC_OHDR_ID, /* ( 5) object header */
+ H5AC_OHDR_CHK_ID, /* ( 6) object header chunk */
+ H5AC_BT2_HDR_ID, /* ( 7) v2 B-tree header */
+ H5AC_BT2_INT_ID, /* ( 8) v2 B-tree internal node */
+ H5AC_BT2_LEAF_ID, /* ( 9) v2 B-tree leaf node */
+ H5AC_FHEAP_HDR_ID, /* (10) fractal heap header */
+ H5AC_FHEAP_DBLOCK_ID, /* (11) fractal heap direct block */
+ H5AC_FHEAP_IBLOCK_ID, /* (12) fractal heap indirect block */
+ H5AC_FSPACE_HDR_ID, /* (13) free space header */
+ H5AC_FSPACE_SINFO_ID, /* (14) free space sections */
+ H5AC_SOHM_TABLE_ID, /* (15) shared object header message master table */
+ H5AC_SOHM_LIST_ID, /* (16) shared message index stored as a list */
+ H5AC_EARRAY_HDR_ID, /* (17) extensible array header */
+ H5AC_EARRAY_IBLOCK_ID, /* (18) extensible array index block */
+ H5AC_EARRAY_SBLOCK_ID, /* (19) extensible array super block */
+ H5AC_EARRAY_DBLOCK_ID, /* (20) extensible array data block */
+ H5AC_EARRAY_DBLK_PAGE_ID, /* (21) extensible array data block page */
+ H5AC_FARRAY_HDR_ID, /* (22) fixed array header */
+ H5AC_FARRAY_DBLOCK_ID, /* (23) fixed array data block */
+ H5AC_FARRAY_DBLK_PAGE_ID, /* (24) fixed array data block page */
+ H5AC_SUPERBLOCK_ID, /* (25) file superblock */
+ H5AC_DRVRINFO_ID, /* (26) driver info block (supplements superblock)*/
+ H5AC_TEST_ID, /* (27) test entry -- not used for actual files */
+ H5AC_NTYPES /* Number of types, must be last */
} H5AC_type_t;
/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when
@@ -188,7 +188,6 @@ typedef H5C_class_t H5AC_class_t;
/* Cache entry info */
typedef H5C_cache_entry_t H5AC_info_t;
-
/* Typedef for metadata cache (defined in H5Cpkg.h) */
typedef H5C_t H5AC_t;
diff --git a/src/H5C.c b/src/H5C.c
index d122910..8b11755 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -270,26 +270,18 @@ H5C_create(size_t max_cache_size,
HDassert( type_name_table_ptr );
for ( i = 0; i <= max_type_id; i++ ) {
-
HDassert( (type_name_table_ptr)[i] );
HDassert( HDstrlen(( type_name_table_ptr)[i]) > 0 );
}
- if ( NULL == (cache_ptr = H5FL_CALLOC(H5C_t)) ) {
-
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, \
- "memory allocation failed")
- }
-
- if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL ) {
+ if(NULL == (cache_ptr = H5FL_CALLOC(H5C_t)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ if(NULL == (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.")
- }
-
- if ( (cache_ptr->cork_list_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL ) {
+ if ( (cache_ptr->cork_list_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL )
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list for corked object addresses.")
- }
/* If we get this far, we should succeed. Go ahead and initialize all
* the fields.
@@ -460,12 +452,9 @@ H5C_create(size_t max_cache_size,
ret_value = cache_ptr;
done:
-
- if ( ret_value == 0 ) {
-
- if ( cache_ptr != NULL ) {
-
- if ( cache_ptr->slist_ptr != NULL )
+ if(NULL == ret_value) {
+ if(cache_ptr != NULL) {
+ if(cache_ptr->slist_ptr != NULL)
H5SL_close(cache_ptr->slist_ptr);
if ( cache_ptr->cork_list_ptr != NULL )
@@ -473,13 +462,10 @@ done:
cache_ptr->magic = 0;
cache_ptr = H5FL_FREE(H5C_t, cache_ptr);
-
} /* end if */
-
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5C_create() */
@@ -677,7 +663,8 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi; January 2014
+ * Programmer: Vailin Choi
+ * January 2014
*
*-------------------------------------------------------------------------
*/
@@ -858,8 +845,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type,
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
if(H5C_validate_lru_list(cache_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "LRU extreme sanity check failed on exit.\n");
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit.\n")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
FUNC_LEAVE_NOAPI(ret_value)
@@ -1327,9 +1313,8 @@ H5C_insert_entry(H5F_t * f,
*/
entry_ptr->compressed = FALSE;
entry_ptr->compressed_size = 0;
- if((type->image_len)(thing, &(entry_ptr->size), &(entry_ptr->compressed),
- &(entry_ptr->compressed_size)) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing")
+ if((type->image_len)(thing, &(entry_ptr->size), &(entry_ptr->compressed), &(entry_ptr->compressed_size)) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing")
HDassert(entry_ptr->size > 0 && entry_ptr->size < H5C_MAX_ENTRY_SIZE);
HDassert(((type->flags & H5C__CLASS_COMPRESSED_FLAG) != 0) ||
(entry_ptr->compressed == FALSE));
@@ -1338,10 +1323,8 @@ H5C_insert_entry(H5F_t * f,
* been computed yet. Thus if entry_ptr->compressed is TRUE,
* entry_ptr->size must equal entry_ptr->compressed_size.
*/
- HDassert((entry_ptr->compressed == FALSE) ||
- (entry_ptr->size == entry_ptr->compressed_size));
- HDassert((entry_ptr->compressed == TRUE) ||
- (entry_ptr->compressed_size == 0));
+ HDassert(!entry_ptr->compressed || (entry_ptr->size == entry_ptr->compressed_size));
+ HDassert(entry_ptr->compressed || (entry_ptr->compressed_size == 0));
entry_ptr->in_slist = FALSE;
@@ -1378,25 +1361,20 @@ H5C_insert_entry(H5F_t * f,
H5C__RESET_CACHE_ENTRY_STATS(entry_ptr)
- if ( ( cache_ptr->flash_size_increase_possible ) &&
- ( entry_ptr->size > cache_ptr->flash_size_increase_threshold ) ) {
-
+ if(cache_ptr->flash_size_increase_possible &&
+ (entry_ptr->size > cache_ptr->flash_size_increase_threshold))
if(H5C__flash_increase_cache_size(cache_ptr, 0, entry_ptr->size) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__flash_increase_cache_size failed.")
- }
if(cache_ptr->index_size >= cache_ptr->max_cache_size)
- empty_space = 0;
+ empty_space = 0;
else
- empty_space = cache_ptr->max_cache_size - cache_ptr->index_size;
+ empty_space = cache_ptr->max_cache_size - cache_ptr->index_size;
- if ( ( cache_ptr->evictions_enabled ) &&
- ( ( (cache_ptr->index_size + entry_ptr->size) >
- cache_ptr->max_cache_size)
+ if(cache_ptr->evictions_enabled &&
+ (((cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size)
||
- ( ( ( empty_space + cache_ptr->clean_index_size ) <
- cache_ptr->min_clean_size ) ) ) ) {
-
+ (((empty_space + cache_ptr->clean_index_size) < cache_ptr->min_clean_size)))) {
size_t space_needed;
if(empty_space <= entry_ptr->size)
@@ -1577,11 +1555,12 @@ H5C_mark_entry_dirty(void *thing)
entry_ptr->dirtied = TRUE;
} else if ( entry_ptr->is_pinned ) {
- hbool_t was_clean;
+ hbool_t was_clean; /* Whether the entry was previously clean */
+ /* Remember previous dirty status */
was_clean = !entry_ptr->is_dirty;
- /* mark the entry as dirty if it isn't already */
+ /* Mark the entry as dirty if it isn't already */
entry_ptr->is_dirty = TRUE;
entry_ptr->image_up_to_date = FALSE;
@@ -1638,56 +1617,40 @@ H5C_move_entry(H5C_t * cache_ptr,
FUNC_ENTER_NOAPI(FAIL)
- HDassert( cache_ptr );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- HDassert( type );
- HDassert( H5F_addr_defined(old_addr) );
- HDassert( H5F_addr_defined(new_addr) );
- HDassert( H5F_addr_ne(old_addr, new_addr) );
+ HDassert(cache_ptr);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ HDassert(type);
+ HDassert(H5F_addr_defined(old_addr));
+ HDassert(H5F_addr_defined(new_addr));
+ HDassert(H5F_addr_ne(old_addr, new_addr));
#if H5C_DO_EXTREME_SANITY_CHECKS
- if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) ||
- ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ||
- ( H5C_validate_lru_list(cache_ptr) < 0 ) ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "an extreme sanity check failed on entry.\n");
- }
+ if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C_validate_lru_list(cache_ptr) < 0))
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
H5C__SEARCH_INDEX(cache_ptr, old_addr, entry_ptr, FAIL)
- if ( ( entry_ptr == NULL ) || ( entry_ptr->type != type ) ) {
-
+ if(entry_ptr == NULL || entry_ptr->type != type)
/* the old item doesn't exist in the cache, so we are done. */
HGOTO_DONE(SUCCEED)
- }
- HDassert( entry_ptr->addr == old_addr );
- HDassert( entry_ptr->type == type );
-
- if ( entry_ptr->is_protected ) {
+ HDassert(entry_ptr->addr == old_addr);
+ HDassert(entry_ptr->type == type);
- HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, \
- "Target entry is protected.")
- }
+ if(entry_ptr->is_protected)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "target entry is protected.")
H5C__SEARCH_INDEX(cache_ptr, new_addr, test_entry_ptr, FAIL)
- if ( test_entry_ptr != NULL ) { /* we are hosed */
-
- if ( test_entry_ptr->type == type ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, \
- "Target already moved & reinserted???.")
-
- } else {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, \
- "New address already in use?.")
-
- }
- }
+ if(test_entry_ptr != NULL) { /* we are hosed */
+ if(test_entry_ptr->type == type)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "target already moved & reinserted???")
+ else
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "new address already in use?")
+ } /* end if */
/* If we get this far we have work to do. Remove *entry_ptr from
* the hash table (and skip list if necessary), change its address to the
@@ -1704,31 +1667,29 @@ H5C_move_entry(H5C_t * cache_ptr,
* change the addr. If the entry is only in the process of being flushed,
* don't mark it as dirty either, lest we confuse the flush call back.
*/
-
- if ( ! ( entry_ptr->destroy_in_progress ) ) {
-
+ if(!entry_ptr->destroy_in_progress) {
H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr)
- if ( entry_ptr->in_slist ) {
-
- HDassert( cache_ptr->slist_ptr );
+ if(entry_ptr->in_slist) {
+ HDassert(cache_ptr->slist_ptr);
H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr)
#if H5C_DO_SANITY_CHECKS
-
removed_entry_from_slist = TRUE;
-
#endif /* H5C_DO_SANITY_CHECKS */
- }
- }
+ } /* end if */
+ } /* end if */
entry_ptr->addr = new_addr;
if(!entry_ptr->destroy_in_progress) {
- hbool_t was_dirty;
+ hbool_t was_dirty; /* Whether the entry was previously dirty */
+ /* Remember previous dirty status */
was_dirty = entry_ptr->is_dirty;
+
+ /* Mark the entry as dirty if it isn't already */
entry_ptr->is_dirty = TRUE;
/* This shouldn't be needed, but it keeps the test code happy */
@@ -1743,7 +1704,6 @@ H5C_move_entry(H5C_t * cache_ptr,
} /* end if */
H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL)
-
H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL)
#if H5C_DO_SANITY_CHECKS
@@ -1759,7 +1719,7 @@ H5C_move_entry(H5C_t * cache_ptr,
#endif /* H5C_DO_SANITY_CHECKS */
if(!entry_ptr->flush_in_progress) {
- /* skip the update if a flush is in progress */
+ /* Update the replacement policy for the entry */
H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, FAIL)
}
} /* end if */
@@ -1768,13 +1728,10 @@ H5C_move_entry(H5C_t * cache_ptr,
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
- if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) ||
- ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ||
- ( H5C_validate_lru_list(cache_ptr) < 0 ) ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "an extreme sanity check failed on exit.\n");
- }
+ if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C_validate_lru_list(cache_ptr) < 0))
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit.\n")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
FUNC_LEAVE_NOAPI(ret_value)
@@ -1884,14 +1841,12 @@ H5C_resize_entry(void *thing, size_t new_size)
#endif /* H5_HAVE_PARALLEL */
/* update the hash table */
- H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\
- (new_size), (entry_ptr), (was_clean));
+ H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, \
+ new_size, entry_ptr, was_clean);
/* if the entry is in the skip list, update that too */
- if ( entry_ptr->in_slist ) {
- H5C__UPDATE_SLIST_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\
- (new_size));
- } /* end if */
+ if(entry_ptr->in_slist)
+ H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_size);
/* update statistics just before changing the entry size */
H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_ptr), \
@@ -1900,13 +1855,11 @@ H5C_resize_entry(void *thing, size_t new_size)
/* finally, update the entry size proper */
entry_ptr->size = new_size;
- if(!entry_ptr->in_slist) {
+ if(!entry_ptr->in_slist)
H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL)
- } /* end if */
- if(entry_ptr->is_pinned) {
+ if(entry_ptr->is_pinned)
H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr)
- } /* end if */
} /* end if */
done:
@@ -2536,7 +2489,6 @@ H5C_protect(H5F_t * f,
#endif /* H5_HAVE_PARALLEL */
done:
-
#if H5C_DO_EXTREME_SANITY_CHECKS
if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) ||
( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ||
@@ -2545,7 +2497,6 @@ done:
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5C_protect() */
@@ -2568,18 +2519,14 @@ H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr)
FUNC_ENTER_NOAPI(FAIL)
- if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.")
- }
+ if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC))
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry.")
cache_ptr->cache_hits = 0;
cache_ptr->cache_accesses = 0;
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5C_reset_cache_hit_rate_stats() */
@@ -2606,137 +2553,95 @@ herr_t
H5C_set_cache_auto_resize_config(H5C_t *cache_ptr,
H5C_auto_size_ctl_t *config_ptr)
{
- herr_t result;
size_t new_max_cache_size;
size_t new_min_clean_size;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.")
- }
-
- if ( config_ptr == NULL ) {
-
+ if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC))
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry.")
+ if(config_ptr == NULL)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL config_ptr on entry.")
- }
-
- if ( config_ptr->version != H5C__CURR_AUTO_SIZE_CTL_VER ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown config version.")
- }
+ if(config_ptr->version != H5C__CURR_AUTO_SIZE_CTL_VER)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unknown config version.")
/* check general configuration section of the config: */
- if ( SUCCEED != H5C_validate_resize_config(config_ptr,
- H5C_RESIZE_CFG__VALIDATE_GENERAL) ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, \
- "error in general configuration fields of new config.")
- }
+ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_GENERAL) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in general configuration fields of new config.")
/* check size increase control fields of the config: */
- if ( SUCCEED != H5C_validate_resize_config(config_ptr,
- H5C_RESIZE_CFG__VALIDATE_INCREMENT) ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, \
- "error in the size increase control fields of new config.")
- }
+ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_INCREMENT) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size increase control fields of new config.")
/* check size decrease control fields of the config: */
- if ( SUCCEED != H5C_validate_resize_config(config_ptr,
- H5C_RESIZE_CFG__VALIDATE_DECREMENT) ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, \
- "error in the size decrease control fields of new config.")
- }
+ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_DECREMENT) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size decrease control fields of new config.")
/* check for conflicts between size increase and size decrease controls: */
- if ( SUCCEED != H5C_validate_resize_config(config_ptr,
- H5C_RESIZE_CFG__VALIDATE_INTERACTIONS) ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, \
- "conflicting threshold fields in new config.")
- }
+ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_INTERACTIONS) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "conflicting threshold fields in new config.")
/* will set the increase possible fields to FALSE later if needed */
cache_ptr->size_increase_possible = TRUE;
cache_ptr->flash_size_increase_possible = TRUE;
cache_ptr->size_decrease_possible = TRUE;
- switch ( config_ptr->incr_mode )
- {
+ switch(config_ptr->incr_mode) {
case H5C_incr__off:
cache_ptr->size_increase_possible = FALSE;
break;
case H5C_incr__threshold:
- if ( ( config_ptr->lower_hr_threshold <= (double)0.0f ) ||
- ( config_ptr->increment <= (double)1.0f ) ||
- ( ( config_ptr->apply_max_increment ) &&
- ( config_ptr->max_increment <= 0 ) ) ) {
-
+ if((config_ptr->lower_hr_threshold <= (double)0.0f) ||
+ (config_ptr->increment <= (double)1.0f) ||
+ ((config_ptr->apply_max_increment) && (config_ptr->max_increment <= 0)))
cache_ptr->size_increase_possible = FALSE;
- }
break;
default: /* should be unreachable */
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown incr_mode?!?!?.")
- }
+ } /* end switch */
/* logically, this is were configuration for flash cache size increases
* should go. However, this configuration depends on max_cache_size, so
* we wait until the end of the function, when this field is set.
*/
- switch ( config_ptr->decr_mode )
- {
+ switch(config_ptr->decr_mode) {
case H5C_decr__off:
cache_ptr->size_decrease_possible = FALSE;
break;
case H5C_decr__threshold:
- if ( ( config_ptr->upper_hr_threshold >= (double)1.0f ) ||
- ( config_ptr->decrement >= (double)1.0f ) ||
- ( ( config_ptr->apply_max_decrement ) &&
- ( config_ptr->max_decrement <= 0 ) ) ) {
-
+ if((config_ptr->upper_hr_threshold >= (double)1.0f) ||
+ (config_ptr->decrement >= (double)1.0f) ||
+ ((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)))
cache_ptr->size_decrease_possible = FALSE;
- }
break;
case H5C_decr__age_out:
- if ( ( ( config_ptr->apply_empty_reserve ) &&
- ( config_ptr->empty_reserve >= (double)1.0f ) ) ||
- ( ( config_ptr->apply_max_decrement ) &&
- ( config_ptr->max_decrement <= 0 ) ) ) {
-
+ if(((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= (double)1.0f)) ||
+ ((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)))
cache_ptr->size_decrease_possible = FALSE;
- }
break;
case H5C_decr__age_out_with_threshold:
- if ( ( ( config_ptr->apply_empty_reserve ) &&
- ( config_ptr->empty_reserve >= (double)1.0f ) ) ||
- ( ( config_ptr->apply_max_decrement ) &&
- ( config_ptr->max_decrement <= 0 ) ) ||
- ( config_ptr->upper_hr_threshold >= (double)1.0f ) ) {
-
+ if(((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= (double)1.0f)) ||
+ ((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)) ||
+ (config_ptr->upper_hr_threshold >= (double)1.0f))
cache_ptr->size_decrease_possible = FALSE;
- }
break;
default: /* should be unreachable */
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown decr_mode?!?!?.")
- }
-
- if ( config_ptr->max_size == config_ptr->min_size ) {
+ } /* end switch */
+ if(config_ptr->max_size == config_ptr->min_size) {
cache_ptr->size_increase_possible = FALSE;
cache_ptr->flash_size_increase_possible = FALSE;
cache_ptr->size_decrease_possible = FALSE;
- }
+ } /* end if */
/* flash_size_increase_possible is intentionally omitted from the
* following:
@@ -2754,25 +2659,16 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr,
* go through the exercise even if the current size is within
* range and an initial size has not been provided.
*/
- if ( (cache_ptr->resize_ctl).set_initial_size ) {
-
- new_max_cache_size = (cache_ptr->resize_ctl).initial_size;
- }
- else if ( cache_ptr->max_cache_size > (cache_ptr->resize_ctl).max_size ) {
-
- new_max_cache_size = (cache_ptr->resize_ctl).max_size;
- }
- else if ( cache_ptr->max_cache_size < (cache_ptr->resize_ctl).min_size ) {
-
- new_max_cache_size = (cache_ptr->resize_ctl).min_size;
-
- } else {
-
+ if(cache_ptr->resize_ctl.set_initial_size)
+ new_max_cache_size = cache_ptr->resize_ctl.initial_size;
+ else if(cache_ptr->max_cache_size > cache_ptr->resize_ctl.max_size)
+ new_max_cache_size = cache_ptr->resize_ctl.max_size;
+ else if(cache_ptr->max_cache_size < cache_ptr->resize_ctl.min_size)
+ new_max_cache_size = cache_ptr->resize_ctl.min_size;
+ else
new_max_cache_size = cache_ptr->max_cache_size;
- }
- new_min_clean_size = (size_t)
- ((double)new_max_cache_size *
+ new_min_clean_size = (size_t)((double)new_max_cache_size *
((cache_ptr->resize_ctl).min_clean_fraction));
@@ -2782,50 +2678,30 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr,
*
* by definition.
*/
- HDassert( new_min_clean_size <= new_max_cache_size );
- HDassert( (cache_ptr->resize_ctl).min_size <= new_max_cache_size );
- HDassert( new_max_cache_size <= (cache_ptr->resize_ctl).max_size );
-
- if ( new_max_cache_size < cache_ptr->max_cache_size ) {
+ HDassert(new_min_clean_size <= new_max_cache_size);
+ HDassert(cache_ptr->resize_ctl.min_size <= new_max_cache_size);
+ HDassert(new_max_cache_size <= cache_ptr->resize_ctl.max_size);
+ if(new_max_cache_size < cache_ptr->max_cache_size)
cache_ptr->size_decreased = TRUE;
- }
cache_ptr->max_cache_size = new_max_cache_size;
cache_ptr->min_clean_size = new_min_clean_size;
- if ( H5C_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) {
-
+ if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0)
/* this should be impossible... */
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "H5C_reset_cache_hit_rate_stats failed.")
- }
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats failed.")
/* remove excess epoch markers if any */
- if ( ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) ||
- ( config_ptr->decr_mode == H5C_decr__age_out ) ) {
-
- if ( cache_ptr->epoch_markers_active >
- (cache_ptr->resize_ctl).epochs_before_eviction ) {
-
- result =
- H5C__autoadjust__ageout__remove_excess_markers(cache_ptr);
-
- if ( result != SUCCEED ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "can't remove excess epoch markers.")
- }
- }
- } else if ( cache_ptr->epoch_markers_active > 0 ) {
-
- result = H5C__autoadjust__ageout__remove_all_markers(cache_ptr);
-
- if ( result != SUCCEED ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "error removing all epoch markers.")
- }
+ if((config_ptr->decr_mode == H5C_decr__age_out_with_threshold) ||
+ (config_ptr->decr_mode == H5C_decr__age_out)) {
+ if(cache_ptr->epoch_markers_active > cache_ptr->resize_ctl.epochs_before_eviction)
+ if(H5C__autoadjust__ageout__remove_excess_markers(cache_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't remove excess epoch markers.")
+ } /* end if */
+ else if(cache_ptr->epoch_markers_active > 0) {
+ if(H5C__autoadjust__ageout__remove_all_markers(cache_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers.")
}
/* configure flash size increase facility. We wait until the
@@ -2836,33 +2712,26 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr,
* go ahead and configure it.
*/
- if ( cache_ptr->flash_size_increase_possible ) {
-
- switch ( config_ptr->flash_incr_mode )
- {
+ if(cache_ptr->flash_size_increase_possible) {
+ switch(config_ptr->flash_incr_mode) {
case H5C_flash_incr__off:
cache_ptr->flash_size_increase_possible = FALSE;
break;
case H5C_flash_incr__add_space:
cache_ptr->flash_size_increase_possible = TRUE;
- cache_ptr->flash_size_increase_threshold =
- (size_t)
- (((double)(cache_ptr->max_cache_size)) *
+ cache_ptr->flash_size_increase_threshold = (size_t)(((double)(cache_ptr->max_cache_size)) *
((cache_ptr->resize_ctl).flash_threshold));
break;
default: /* should be unreachable */
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "Unknown flash_incr_mode?!?!?.")
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?.")
break;
- }
- }
+ } /* end switch */
+ } /* end if */
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5C_set_cache_auto_resize_config() */
@@ -4470,10 +4339,8 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f,
next_ptr = entry_ptr->next;
prev_ptr = entry_ptr->prev;
- if ( prev_ptr != NULL ) {
-
+ if(prev_ptr != NULL)
prev_is_dirty = prev_ptr->is_dirty;
- }
/* dirty corked entry is skipped */
if(entry_ptr->is_corked && entry_ptr->is_dirty)
@@ -5356,6 +5223,7 @@ H5C_flush_invalidate_ring(const H5F_t * f, hid_t dxpl_id, H5C_ring_t ring,
* slist if we find them. However, best we do some extra
* sanity checking just in case.
*/
+ HDassert(entry_ptr != NULL);
HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
HDassert(entry_ptr->in_slist);
HDassert(entry_ptr->is_dirty);
@@ -5388,9 +5256,6 @@ H5C_flush_invalidate_ring(const H5F_t * f, hid_t dxpl_id, H5C_ring_t ring,
* flush, we must keep the slist in cannonical form at all
* times.
*/
- HDassert(entry_ptr != NULL);
- HDassert(entry_ptr->in_slist);
-
if(((!entry_ptr->flush_me_last) ||
((entry_ptr->flush_me_last) &&
(cache_ptr->num_last_entries >= cache_ptr->slist_len))) &&
@@ -5510,7 +5375,7 @@ H5C_flush_invalidate_ring(const H5F_t * f, hid_t dxpl_id, H5C_ring_t ring,
* It used to be that all entries remaining in the cache at
* this point had to be clean, but with the fractal heap mods
* this may not be the case. If so, we will flush entries out
- * of increasing address order.
+ * in increasing address order.
*
* Writes to disk are possible here.
*/
@@ -5864,7 +5729,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags)
if(!flush_marked_entries || entry_ptr->flush_marker)
HDassert(entry_ptr->ring >= ring);
- /* increment node pointer now, before we delete its target
+ /* advance node pointer now, before we delete its target
* from the slist.
*/
node_ptr = H5SL_next(node_ptr);
@@ -6225,7 +6090,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
* just flushed the entry.
*/
if(entry_ptr->type->notify &&
- (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_FLUSH, entry_ptr) < 0 )
+ (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_FLUSH, entry_ptr) < 0 )
HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client of entry flush")
} /* if ( write_entry ) */
@@ -6250,25 +6115,25 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr)
} /* end else if */
+ /* Update the cache internal data structures. */
if(destroy) {
+ /* Sanity checks */
if(take_ownership)
HDassert(!destroy_entry);
else
HDassert(destroy_entry);
+ HDassert(!entry_ptr->is_pinned);
+ /* Update stats, while entry is still in the cache */
H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr, take_ownership)
- } /* end if */
- /* If the entry's type has a 'notify' callback and the entry is about
- * to be removed from the cache, send a 'before eviction' notice while
- * the entry is still fully integrated in the cache.
- */
- if(destroy)
+ /* If the entry's type has a 'notify' callback and the entry is about
+ * to be removed from the cache, send a 'before eviction' notice while
+ * the entry is still fully integrated in the cache.
+ */
if(entry_ptr->type->notify && (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_BEFORE_EVICT, entry_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry to evict")
- /* Update the cache internal data structures. */
- if(destroy) {
/* Update the cache internal data structures as appropriate
* for a destroy. Specifically:
*
@@ -6326,12 +6191,11 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
* appropriate */
if(was_dirty) {
HDassert(entry_ptr->flush_dep_ndirty_children == 0);
-
if(entry_ptr->flush_dep_nparents > 0)
if(H5C__mark_flush_dep_clean(entry_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep clean flag")
} /* end if */
- }
+ } /* end else */
/* reset the flush_in progress flag */
entry_ptr->flush_in_progress = FALSE;
@@ -6346,7 +6210,10 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
* Now discard the entry if appropriate.
*/
if(destroy) {
- /* start by freeing the buffer for the on disk image */
+ /* Sanity check */
+ HDassert(0 == entry_ptr->flush_dep_nparents);
+
+ /* Start by freeing the buffer for the on disk image */
if(entry_ptr->image_ptr != NULL)
entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr);
@@ -6360,17 +6227,17 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
HDassert(H5F_addr_defined(entry_ptr->addr));
HDassert(!H5F_IS_TMP_ADDR(f, entry_ptr->addr));
#ifndef NDEBUG
-{
- hbool_t curr_compressed = FALSE;
- size_t curr_len;
- size_t curr_compressed_len = 0;
-
- /* Get the actual image size for the thing again */
- entry_ptr->type->image_len((void *)entry_ptr, &curr_len, &curr_compressed, &curr_compressed_len);
- HDassert(curr_len == entry_ptr->size);
- HDassert(curr_compressed == entry_ptr->compressed);
- HDassert(curr_compressed_len == entry_ptr->compressed_size);
-}
+ {
+ hbool_t curr_compressed = FALSE;
+ size_t curr_len;
+ size_t curr_compressed_len = 0;
+
+ /* Get the actual image size for the thing again */
+ entry_ptr->type->image_len((void *)entry_ptr, &curr_len, &curr_compressed, &curr_compressed_len);
+ HDassert(curr_len == entry_ptr->size);
+ HDassert(curr_compressed == entry_ptr->compressed);
+ HDassert(curr_compressed_len == entry_ptr->compressed_size);
+ }
#endif /* NDEBUG */
/* if the file space free size callback is defined, use
@@ -6438,7 +6305,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
if(entry_ptr->type->free_icr((void *)entry_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "free_icr callback failed.")
- }
+ } /* end if */
else {
HDassert(take_ownership);
@@ -6447,7 +6314,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
* unless the entry is re-inserted properly
*/
entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC;
- }
+ } /* end else */
} /* if (destroy) */
if(cache_ptr->log_flush)
@@ -7020,10 +6887,8 @@ H5C_make_space_in_cache(H5F_t * f,
next_ptr = entry_ptr->next;
prev_ptr = entry_ptr->prev;
- if ( prev_ptr != NULL ) {
-
+ if(prev_ptr != NULL)
prev_is_dirty = prev_ptr->is_dirty;
- }
if (entry_ptr->is_corked && entry_ptr->is_dirty) {
@@ -7742,12 +7607,13 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Vailin Choi; January 2014
+ * Programmer: Vailin Choi
+ * January 2014
*
*-------------------------------------------------------------------------
*/
herr_t
-H5C_cork(H5C_t * cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked)
+H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked)
{
haddr_t *ptr; /* Points to an address */
herr_t ret_value = SUCCEED; /* Return value */
@@ -8171,7 +8037,6 @@ H5C__generate_image(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_p
HDassert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + image_len,
H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE));
#endif /* H5C_DO_MEMORY_SANITY_CHECKS */
-
entry_ptr->image_up_to_date = TRUE;
} /* end block */
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index 92f4cdd..c8f5c00 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -524,21 +524,17 @@ if ( ( (entry_ptr) == NULL ) || \
(cache_ptr)->max_pel_size = (cache_ptr)->pel_size;
#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) \
- if ( cache_ptr->flush_in_progress ) { \
+ if ( cache_ptr->flush_in_progress ) \
((cache_ptr)->cache_flush_moves[(entry_ptr)->type->id])++; \
- } \
- if ( entry_ptr->flush_in_progress ) { \
+ if ( entry_ptr->flush_in_progress ) \
((cache_ptr)->entry_flush_moves[(entry_ptr)->type->id])++; \
- } \
(((cache_ptr)->moves)[(entry_ptr)->type->id])++;
#define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size)\
- if ( cache_ptr->flush_in_progress ) { \
+ if ( cache_ptr->flush_in_progress ) \
((cache_ptr)->cache_flush_size_changes[(entry_ptr)->type->id])++; \
- } \
- if ( entry_ptr->flush_in_progress ) { \
+ if ( entry_ptr->flush_in_progress ) \
((cache_ptr)->entry_flush_size_changes[(entry_ptr)->type->id])++; \
- } \
if ( (entry_ptr)->size < (new_size) ) { \
((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \
H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \
@@ -1002,7 +998,6 @@ if ( ( (cache_ptr) == NULL ) || \
( (cache_ptr)->index_size <= 0 ) || \
( (new_size) <= 0 ) || \
( (old_size) > (cache_ptr)->index_size ) || \
- ( (new_size) <= 0 ) || \
( ( (cache_ptr)->index_len == 1 ) && \
( (cache_ptr)->index_size != (old_size) ) ) || \
( (cache_ptr)->index_size != \
@@ -1175,19 +1170,17 @@ if ( ( (cache_ptr)->index_size != \
int k; \
H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \
k = H5C__HASH_FCN((entry_ptr)->addr); \
- if ( ((cache_ptr)->index)[k] == NULL ) \
- ((cache_ptr)->index)[k] = (entry_ptr); \
- else { \
+ if(((cache_ptr)->index)[k] != NULL) { \
(entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \
(entry_ptr)->ht_next->ht_prev = (entry_ptr); \
- ((cache_ptr)->index)[k] = (entry_ptr); \
} \
+ ((cache_ptr)->index)[k] = (entry_ptr); \
(cache_ptr)->index_len++; \
(cache_ptr)->index_size += (entry_ptr)->size; \
((cache_ptr)->index_ring_len[entry_ptr->ring])++; \
((cache_ptr)->index_ring_size[entry_ptr->ring]) \
- += (entry_ptr)->size; \
- if ( (entry_ptr)->is_dirty ) { \
+ += (entry_ptr)->size; \
+ if((entry_ptr)->is_dirty) { \
(cache_ptr)->dirty_index_size += (entry_ptr)->size; \
((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \
+= (entry_ptr)->size; \
@@ -1221,8 +1214,8 @@ if ( ( (cache_ptr)->index_size != \
(cache_ptr)->index_size -= (entry_ptr)->size; \
((cache_ptr)->index_ring_len[entry_ptr->ring])--; \
((cache_ptr)->index_ring_size[entry_ptr->ring]) \
- -= (entry_ptr)->size; \
- if ( (entry_ptr)->is_dirty ) { \
+ -= (entry_ptr)->size; \
+ if((entry_ptr)->is_dirty) { \
(cache_ptr)->dirty_index_size -= (entry_ptr)->size; \
((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \
-= (entry_ptr)->size; \
@@ -1231,7 +1224,7 @@ if ( ( (cache_ptr)->index_size != \
((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \
-= (entry_ptr)->size; \
} \
- if ((entry_ptr)->flush_me_last) { \
+ if((entry_ptr)->flush_me_last) { \
(cache_ptr)->num_last_entries--; \
HDassert((cache_ptr)->num_last_entries <= 1); \
} \
@@ -1506,31 +1499,6 @@ if ( ( (cache_ptr)->index_size != \
*
* Programmer: John Mainzer, 5/10/04
*
- * Modifications:
- *
- * JRM -- 7/21/04
- * Updated function for the addition of the hash table.
- *
- * JRM - 7/27/04
- * Converted from the function H5C_remove_entry_from_tree()
- * to the macro H5C__REMOVE_ENTRY_FROM_TREE in the hopes of
- * wringing a little more performance out of the cache.
- *
- * QAK -- 11/27/04
- * Switched over to using skip list routines.
- *
- * JRM -- 3/28/07
- * Updated sanity checks for the new is_read_only and
- * ro_ref_count fields in H5C_cache_entry_t.
- *
- * JRM -- 12/13/14
- * Added code to set cache_ptr->slist_changed to TRUE
- * when an entry is removed from the slist.
- *
- * JRM -- 9/1/15
- * Added code to maintain the cache_ptr->slist_ring_len
- * and cache_ptr->slist_ring_size arrays.
- *
*-------------------------------------------------------------------------
*/
@@ -4240,7 +4208,7 @@ struct H5C_t {
int32_t max_pel_len;
size_t max_pel_size;
- /* Fields for tacking 'make space in cache' (msic) operations */
+ /* Fields for tracking 'make space in cache' (msic) operations */
int64_t calls_to_msic;
int64_t total_entries_skipped_in_msic;
int64_t total_entries_scanned_in_msic;
diff --git a/src/H5Ctag.c b/src/H5Ctag.c
index e1b4df6..8ee287c 100644
--- a/src/H5Ctag.c
+++ b/src/H5Ctag.c
@@ -182,12 +182,10 @@ H5C_get_ignore_tags(const H5C_t *cache_ptr)
* Programmer: Mike McGreevy
* January 14, 2010
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5C__tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr, hid_t dxpl_id)
+H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry, hid_t dxpl_id)
{
H5P_genplist_t *dxpl; /* dataset transfer property list */
H5C_tag_t tag; /* Tag structure */
@@ -196,9 +194,9 @@ H5C__tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr, hid_t dxpl_id)
FUNC_ENTER_PACKAGE
/* Assertions */
- HDassert(cache_ptr != NULL);
- HDassert(entry_ptr != NULL);
- HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ HDassert(cache != NULL);
+ HDassert(entry != NULL);
+ HDassert(cache->magic == H5C__H5C_T_MAGIC);
/* Get the dataset transfer property list */
if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST)))
@@ -208,13 +206,7 @@ H5C__tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr, hid_t dxpl_id)
if((H5P_get(dxpl, "H5C_tag", &tag)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query property value")
- if(cache_ptr->ignore_tags != TRUE) {
-#if H5C_DO_TAGGING_SANITY_CHECKS
- /* Perform some sanity checks to ensure that a correct tag is being applied */
- if(H5C_verify_tag(entry_ptr->type->id, tag.value, tag.globality) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "tag verification failed")
-#endif
- } else {
+ if(cache->ignore_tags) {
/* if we're ignoring tags, it's because we're running
tests on internal functions and may not have inserted a tag
value into a given dxpl_id before creating some metadata. Thus,
@@ -227,12 +219,19 @@ H5C__tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr, hid_t dxpl_id)
tag.globality = H5C_GLOBALITY_NONE;
} /* end if */
} /* end if */
+#if H5C_DO_TAGGING_SANITY_CHECKS
+ else {
+ /* Perform some sanity checks to ensure that a correct tag is being applied */
+ if(H5C_verify_tag(entry->type->id, tag.value, tag.globality) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "tag verification failed")
+ } /* end else */
+#endif
/* Apply the tag to the entry */
- entry_ptr->tag = tag.value;
+ entry->tag = tag.value;
/* Apply the tag globality to the entry */
- entry_ptr->globality = tag.globality;
+ entry->globality = tag.globality;
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c
index 76ea229..5f82e59 100644
--- a/src/H5Dfarray.c
+++ b/src/H5Dfarray.c
@@ -145,7 +145,7 @@ static herr_t H5D__farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_
static herr_t H5D__farray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream);
static herr_t H5D__farray_idx_dest(const H5D_chk_idx_info_t *idx_info);
-/* Generic extensible array routines */
+/* Generic fixed array routines */
static herr_t H5D__farray_idx_open(const H5D_chk_idx_info_t *idx_info);
/*********************/
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 2190f8c..12966f2 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -394,6 +394,10 @@ typedef struct H5D_chunk_cached_t {
unsigned filter_mask; /*excluded filters */
} H5D_chunk_cached_t;
+/****************************/
+/* Virtual dataset typedefs */
+/****************************/
+
/* List of files held open during refresh operations */
typedef struct H5D_virtual_held_file_t {
H5F_t *file; /* Pointer to file held open */
@@ -685,6 +689,8 @@ H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t
#ifdef H5D_CHUNK_DEBUG
H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers);
#endif /* H5D_CHUNK_DEBUG */
+
+/* format convert */
H5_DLL herr_t H5D__chunk_format_convert(H5D_t *dset, H5D_chk_idx_info_t *idx_info, H5D_chk_idx_info_t *new_idx_info);
/* Functions that operate on compact dataset storage */
diff --git a/src/H5EA.c b/src/H5EA.c
index 350acc1..8a4c5a1 100644
--- a/src/H5EA.c
+++ b/src/H5EA.c
@@ -756,8 +756,8 @@ END_FUNC(PRIV) /* end H5EA_get() */
/*-------------------------------------------------------------------------
* Function: H5EA_depend
*
- * Purpose: Make a child flush dependency between the extensible array's
- * header and another piece of metadata in the file.
+ * Purpose: Make a child flush dependency between the extensible array
+ * and another piece of metadata in the file.
*
* Return: SUCCEED/FAIL
*
diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c
index 327feb0..b903a8a 100644
--- a/src/H5EAdblkpage.c
+++ b/src/H5EAdblkpage.c
@@ -154,7 +154,7 @@ H5EA__dblk_page_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent,
haddr_t addr))
/* Local variables */
- H5EA_dblk_page_t *dblk_page = NULL; /* Extensible array data block page */
+ H5EA_dblk_page_t *dblk_page = NULL; /* Extensible array data block page */
/* Sanity check */
HDassert(hdr);
@@ -206,7 +206,7 @@ H5EA__dblk_page_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent,
haddr_t dblk_page_addr, unsigned flags))
/* Local variables */
- H5EA_dblk_page_cache_ud_t udata; /* Information needed for loading data block page */
+ H5EA_dblk_page_cache_ud_t udata; /* Information needed for loading data block page */
/* Sanity check */
HDassert(hdr);
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index da15087..d8be3cb 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -204,9 +204,6 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata))
hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts));
hdr->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits;
hdr->arr_off_size = (unsigned char)H5EA_SIZEOF_OFFSET_BITS(hdr->cparam.max_nelmts_bits);
-#ifdef QAK
-HDfprintf(stderr, "%s: hdr->nsblks = %Zu\n", FUNC, hdr->nsblks);
-#endif /* QAK */
/* Allocate information for each super block */
if(NULL == (hdr->sblk_info = H5FL_SEQ_MALLOC(H5EA_sblk_info_t, hdr->nsblks)))
@@ -220,9 +217,6 @@ HDfprintf(stderr, "%s: hdr->nsblks = %Zu\n", FUNC, hdr->nsblks);
hdr->sblk_info[u].dblk_nelmts = H5EA_SBLK_DBLK_NELMTS(u, hdr->cparam.data_blk_min_elmts);
hdr->sblk_info[u].start_idx = start_idx;
hdr->sblk_info[u].start_dblk = start_dblk;
-#ifdef QAK
-HDfprintf(stderr, "%s: hdr->sblk_info[%Zu] = {%Zu, %Zu, %Hu, %Hu}\n", FUNC, u, hdr->sblk_info[u].ndblks, hdr->sblk_info[u].dblk_nelmts, hdr->sblk_info[u].start_idx, hdr->sblk_info[u].start_dblk);
-#endif /* QAK */
/* Advance starting indices for next super block */
start_idx += (hsize_t)hdr->sblk_info[u].ndblks * (hsize_t)hdr->sblk_info[u].dblk_nelmts;
@@ -271,9 +265,6 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
-#ifdef QAK
-HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx);
-#endif /* QAK */
/* Check for needing to increase size of array of factories */
if(idx >= hdr->elmt_fac.nalloc) {
@@ -341,9 +332,6 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
-#ifdef QAK
-HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx);
-#endif /* QAK */
/* Free buffer for elements in index block */
HDassert(idx < hdr->elmt_fac.nalloc);
@@ -374,10 +362,6 @@ H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam,
/* Local variables */
H5EA_hdr_t *hdr = NULL; /* Extensible array header */
-#ifdef QAK
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
-
/* Check arguments */
HDassert(f);
HDassert(cparam);
@@ -725,9 +709,6 @@ H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id))
/* Check for index block */
if(H5F_addr_defined(hdr->idx_blk_addr)) {
-#ifdef QAK
-HDfprintf(stderr, "%s: hdr->idx_blk_addr = %a\n", FUNC, hdr->idx_blk_addr);
-#endif /* QAK */
/* Delete index block */
if(H5EA__iblock_delete(hdr, dxpl_id) < 0)
H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array index block")
diff --git a/src/H5EApkg.h b/src/H5EApkg.h
index 6f3ee9c..70e6a55 100644
--- a/src/H5EApkg.h
+++ b/src/H5EApkg.h
@@ -241,11 +241,13 @@ typedef struct H5EA_sblock_t {
/* Internal array information (not stored) */
H5EA_hdr_t *hdr; /* Shared array header info */
- hbool_t has_hdr_depend; /* Whether this object has a flush dependency on the header */
- H5EA_iblock_t *parent; /* Parent object for super block (index block) */
haddr_t addr; /* Address of this index block on disk */
size_t size; /* Size of index block on disk */
+ /* Flush dependency information (not stored) */
+ hbool_t has_hdr_depend; /* Whether this object has a flush dependency on the header */
+ H5EA_iblock_t *parent; /* Parent object for super block (index block) */
+
/* Computed/cached values (not stored) */
unsigned idx; /* Super block index within the extensible array */
size_t ndblks; /* # of data block addresses that are in super block */
@@ -266,11 +268,13 @@ typedef struct H5EA_dblock_t {
/* Internal array information (not stored) */
H5EA_hdr_t *hdr; /* Shared array header info */
- hbool_t has_hdr_depend; /* Whether this object has a flush dependency on the header */
- void *parent; /* Parent object for data block (index or super block) */
haddr_t addr; /* Address of this data block on disk */
size_t size; /* Size of data block on disk */
+ /* Flush dependency information (not stored) */
+ hbool_t has_hdr_depend; /* Whether this object has a flush dependency on the header */
+ void *parent; /* Parent object for data block (index or super block) */
+
/* Computed/cached values (not stored) */
size_t nelmts; /* Number of elements in block */
size_t npages; /* Nummber of pages in a block (zero if not paged) */
@@ -286,11 +290,13 @@ typedef struct H5EA_dbk_page_t {
/* Internal array information (not stored) */
H5EA_hdr_t *hdr; /* Shared array header info */
- hbool_t has_hdr_depend; /* Whether this object has a flush dependency on the header */
- H5EA_sblock_t *parent; /* Parent object for data block page (super block) */
haddr_t addr; /* Address of this data block page on disk */
size_t size; /* Size of data block page on disk */
+ /* Flush dependency information (not stored) */
+ hbool_t has_hdr_depend; /* Whether this object has a flush dependency on the header */
+ H5EA_sblock_t *parent; /* Parent object for data block page (super block) */
+
/* Computed/cached values (not stored) */
/* <none> */
} H5EA_dblk_page_t;
diff --git a/src/H5FA.c b/src/H5FA.c
index 9678f45..4435af0 100644
--- a/src/H5FA.c
+++ b/src/H5FA.c
@@ -152,11 +152,11 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
/* Point fixed array wrapper at header and bump it's ref count */
fa->hdr = hdr;
if(H5FA__hdr_incr(fa->hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
+ H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
/* Increment # of files using this array header */
if(H5FA__hdr_fuse_incr(fa->hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment file reference count on shared array header")
+ H5E_THROW(H5E_CANTINC, "can't increment file reference count on shared array header")
/* Set file pointer for this array open context */
fa->f = f;
@@ -167,7 +167,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
CATCH
if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
+ H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
if(!ret_value)
if(fa && H5FA_close(fa, dxpl_id) < 0)
H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array")
@@ -261,10 +261,6 @@ H5FA_get_nelmts(const H5FA_t *fa, hsize_t *nelmts))
/* Local variables */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* H5FA_DEBUG */
-
/*
* Check arguments.
*/
@@ -295,10 +291,6 @@ H5FA_get_addr(const H5FA_t *fa, haddr_t *addr))
/* Local variables */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* H5FA_DEBUG */
-
/*
* Check arguments.
*/
@@ -336,11 +328,6 @@ H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt))
unsigned dblk_page_cache_flags = H5AC__NO_FLAGS_SET; /* Flags to unprotecting FIxed Array Data block page */
hbool_t hdr_dirty = FALSE; /* Whether header information changed */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx);
-#endif /* H5FA_DEBUG */
-
/*
* Check arguments.
*/
@@ -352,9 +339,6 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx);
/* Check if we need to create the fixed array data block */
if(!H5F_addr_defined(hdr->dblk_addr)) {
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx);
-#endif /* H5FA_DEBUG */
/* Create the data block */
hdr->dblk_addr = H5FA__dblock_create(hdr, dxpl_id, &hdr_dirty);
if(!H5F_addr_defined(hdr->dblk_addr))
@@ -449,11 +433,6 @@ H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt))
H5FA_dblock_t *dblock = NULL; /* Pointer to data block for FA */
H5FA_dblk_page_t *dblk_page = NULL; /* Pointer to data block page for FA */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx);
-#endif /* H5FA_DEBUG */
-
/*
* Check arguments.
*/
@@ -550,10 +529,6 @@ H5FA_close(H5FA_t *fa, hid_t dxpl_id))
hbool_t pending_delete = FALSE; /* Whether the array is pending deletion */
haddr_t fa_addr = HADDR_UNDEF; /* Address of array (for deletion) */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* H5FA_DEBUG */
-
/*
* Check arguments.
*/
@@ -657,9 +632,6 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata))
HDassert(H5F_addr_defined(fa_addr));
/* Lock the array header into memory */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr);
-#endif /* H5FA_DEBUG */
if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC__NO_FLAGS_SET)))
H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr)
@@ -760,10 +732,6 @@ H5FA_patch_file(H5FA_t *fa, H5F_t *f))
/* Local variables */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* H5FA_DEBUG */
-
/*
* Check arguments.
*/
diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c
index bba4439..054ffb9 100644
--- a/src/H5FAdblkpage.c
+++ b/src/H5FAdblkpage.c
@@ -152,7 +152,7 @@ herr_t, SUCCEED, FAIL,
H5FA__dblk_page_create(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, size_t nelmts))
/* Local variables */
- H5FA_dblk_page_t *dblk_page = NULL; /* Fixed array data block page */
+ H5FA_dblk_page_t *dblk_page = NULL; /* Fixed array data block page */
#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: Called, addr = %a\n", FUNC, addr);
@@ -210,7 +210,7 @@ H5FA__dblk_page_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_page_addr,
size_t dblk_page_nelmts, unsigned flags))
/* Local variables */
- H5FA_dblk_page_cache_ud_t udata; /* Information needed for loading data block page */
+ H5FA_dblk_page_cache_ud_t udata; /* Information needed for loading data block page */
#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: Called\n", FUNC);
diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c
index 95419f8..f597c8e 100644
--- a/src/H5FAdblock.c
+++ b/src/H5FAdblock.c
@@ -189,12 +189,8 @@ haddr_t, HADDR_UNDEF, HADDR_UNDEF,
H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty))
/* Local variables */
- H5FA_dblock_t *dblock = NULL; /* fixed array data block */
- haddr_t dblock_addr; /* fixed array data block address */
-
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called, hdr->stats.nelmts = %Zu, nelmts = %Zu\n", FUNC, hdr->stats.nelmts, hdr->cparam.nelmts);
-#endif /* H5FA_DEBUG */
+ H5FA_dblock_t *dblock = NULL; /* Fixed array data block */
+ haddr_t dblock_addr; /* Fixed array data block address */
/* Sanity check */
HDassert(hdr);
@@ -206,10 +202,6 @@ HDfprintf(stderr, "%s: Called, hdr->stats.nelmts = %Zu, nelmts = %Zu\n", FUNC, h
/* Set size of data block on disk */
hdr->stats.dblk_size = dblock->size = H5FA_DBLOCK_SIZE(dblock);
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: dblock->size = %Zu\n", FUNC, dblock->size);
-#endif /* H5FA_DEBUG */
-
/* Allocate space for the data block on disk */
if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FARRAY_DBLOCK, dxpl_id, (hsize_t)dblock->size)))
@@ -266,11 +258,7 @@ H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr,
unsigned flags))
/* Local variables */
- H5FA_dblock_cache_ud_t udata; /* Information needed for loading data block */
-
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* H5FA_DEBUG */
+ H5FA_dblock_cache_ud_t udata; /* Information needed for loading data block */
/* Sanity check */
HDassert(hdr);
@@ -310,10 +298,6 @@ H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flag
/* Local variables */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* H5FA_DEBUG */
-
/* Sanity check */
HDassert(dblock);
@@ -345,10 +329,6 @@ H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr))
/* Local variables */
H5FA_dblock_t *dblock = NULL; /* Pointer to data block */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* H5FA_DEBUG */
-
/* Sanity check */
HDassert(hdr);
HDassert(H5F_addr_defined(dblk_addr));
@@ -367,16 +347,10 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
/* Iterate over pages in data block */
for(u = 0; u < dblock->npages; u++) {
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Expunging data block page from cache\n", FUNC);
-#endif /* H5FA_DEBUG */
/* Evict the data block page from the metadata cache */
/* (OK to call if it doesn't exist in the cache) */
if(H5AC_expunge_entry(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTEXPUNGE, "unable to remove array data block page from metadata cache")
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Done expunging data block page from cache\n", FUNC);
-#endif /* H5FA_DEBUG */
/* Advance to next page address */
dblk_page_addr += dblock->dblk_page_size;
diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c
index ac9a103..d844f06 100644
--- a/src/H5FAhdr.c
+++ b/src/H5FAhdr.c
@@ -184,10 +184,6 @@ H5FA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam,
/* Local variables */
H5FA_hdr_t *hdr = NULL; /* Fixed array header */
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* H5FA_DEBUG */
-
/* Check arguments */
HDassert(f);
HDassert(cparam);
@@ -505,10 +501,6 @@ H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id))
/* Check for Fixed Array Data block */
if(H5F_addr_defined(hdr->dblk_addr)) {
-#ifdef H5FA_DEBUG
-HDfprintf(stderr, "%s: hdr->dblk_addr = %a\n", FUNC, hdr->dblk_addr);
-#endif /* H5FA_DEBUG */
-
/* Delete Fixed Array Data block */
if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr) < 0)
H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array data block")
diff --git a/src/H5FScache.c b/src/H5FScache.c
index 1d27972..c04ac7c 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -483,7 +483,7 @@ H5FS__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
* Note that while we may alter the contents of the free space
* header in cases 1) and 2), there is no need to mark the header
* as dirty, as the metadata cache would not be attempting to
- * serialize the header if it though it was clean.
+ * serialize the header if it thought it was clean.
*/
if(fspace->serial_sect_count > 0 && H5F_addr_defined(fspace->addr)) {
/* Sanity check */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 19a8117..35c7b5a 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -473,9 +473,9 @@
#define H5F_ACS_USE_MDC_LOGGING_NAME "use_mdc_logging" /* Whether to use metadata cache logging */
#define H5F_ACS_MDC_LOG_LOCATION_NAME "mdc_log_location" /* Name of metadata cache log location */
#define H5F_ACS_START_MDC_LOG_ON_ACCESS_NAME "start_mdc_log_on_access" /* Whether logging starts on file create/open */
-#define H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME "core_write_tracking_flag" /* Whether or not core VFD backing store write tracking is enabled */
+#define H5F_ACS_CORE_WRITE_TRACKING_FLAG_NAME "core_write_tracking_flag" /* Whether or not core VFD backing store write tracking is enabled */
#define H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME "evict_on_close_flag" /* Whether or not the metadata cache will evict objects on close */
-#define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME "core_write_tracking_page_size" /* The page size in kiB when core VFD write tracking is enabled */
+#define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME "core_write_tracking_page_size" /* The page size in kiB when core VFD write tracking is enabled */
#define H5F_ACS_COLL_MD_WRITE_FLAG_NAME "collective_metadata_write" /* property indicating whether metadata writes are done collectively or not */
/* ======================== File Mount properties ====================*/
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index f445303..2592b90 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -107,7 +107,7 @@ const H5AC_class_t H5AC_SUPERBLOCK[1] = {{
H5F__cache_superblock_image_len, /* 'image_len' callback */
H5F__cache_superblock_pre_serialize,/* 'pre_serialize' callback */
H5F__cache_superblock_serialize, /* 'serialize' callback */
- NULL, /* 'notify' callback */
+ NULL, /* 'notify' callback */
H5F__cache_superblock_free_icr, /* 'free_icr' callback */
NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c
index 341f423..bb31002 100644
--- a/src/H5HFiblock.c
+++ b/src/H5HFiblock.c
@@ -451,14 +451,11 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si
/* destroy flush dependency between direct block and header */
if(H5AC_destroy_flush_dependency(dblock->hdr, dblock) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, \
- "unable to destroy flush dependency")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
/* create flush dependency between direct block and new root indirect block */
if(H5AC_create_flush_dependency(dblock->parent, dblock) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, \
- "unable to create flush dependency")
-
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency")
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")
diff --git a/src/H5HG.c b/src/H5HG.c
index c33b85f..e8eb2eb 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -155,7 +155,7 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size)
H5_CHECK_OVERFLOW(size, size_t, hsize_t);
if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_GHEAP, dxpl_id, (hsize_t)size)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file space for global heap")
- if(NULL == (heap = H5FL_MALLOC(H5HG_heap_t)))
+ if(NULL == (heap = H5FL_CALLOC(H5HG_heap_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
heap->addr = addr;
heap->size = size;
diff --git a/src/H5O.c b/src/H5O.c
index d1806a1..f12bfed 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1388,6 +1388,8 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc,
/* Cache object header */
if(H5AC_insert_entry(f, dxpl_id, H5AC_OHDR, oh_addr, oh, insert_flags) < 0)
HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header")
+
+ /* Reset object header pointer, now that it's been inserted into the cache */
oh = NULL;
/* Reset metadata tag in dxpl_id */
@@ -1403,7 +1405,7 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc,
done:
if(ret_value < 0 && oh)
- if(H5O_free(oh) < 0)
+ if(H5O__free(oh) < 0)
HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
FUNC_LEAVE_NOAPI(ret_value)
@@ -1978,7 +1980,7 @@ H5O_assert(oh);
done:
if(ret_value == NULL && oh)
- if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0)
+ if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header")
FUNC_LEAVE_NOAPI_TAG(ret_value, NULL)
@@ -3627,7 +3629,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O_free
+ * Function: H5O__free
*
* Purpose: Destroys an object header.
*
@@ -3640,14 +3642,16 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O_free(H5O_t *oh)
+H5O__free(H5O_t *oh)
{
unsigned u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* check args */
HDassert(oh);
+ HDassert(0 == oh->rc);
/* Destroy chunks */
if(oh->chunk) {
@@ -3682,5 +3686,5 @@ H5O_free(H5O_t *oh)
oh = H5FL_FREE(H5O_t, oh);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_free() */
+} /* end H5O__free() */
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index 69b4b11..33d2e9d 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -644,9 +644,9 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno,
old_size = oh->chunk[chunkno].size;
oh->chunk[chunkno].size += delta + extra_prfx_size;
oh->chunk[chunkno].image = H5FL_BLK_REALLOC(chunk_image, old_image, oh->chunk[chunkno].size);
- oh->chunk[chunkno].gap = 0;
if(NULL == oh->chunk[chunkno].image)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "can't reallocate extended object header chunk")
+ oh->chunk[chunkno].gap = 0;
/* Wipe new space for chunk */
HDmemset(oh->chunk[chunkno].image + old_size, 0, oh->chunk[chunkno].size - old_size);
@@ -664,8 +664,8 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno,
oh->mesg[u].raw = oh->chunk[chunkno].image + extra_prfx_size + (oh->mesg[u].raw - old_image);
/* Find continuation message which points to this chunk and adjust chunk's size */
- /* (Chunk 0 doesn't have a continuation message that points to it and
- * it's size is directly encoded in the object header) */
+ /* (Chunk 0 doesn't have a continuation message that points to it,
+ * its size is directly encoded in the object header) */
if(chunkno > 0 && (H5O_CONT_ID == oh->mesg[u].type->id) &&
(((H5O_cont_t *)(oh->mesg[u].native))->chunkno == chunkno)) {
H5O_chunk_proxy_t *chk_proxy2 = NULL; /* Chunk that continuation message is in */
@@ -891,7 +891,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new
/*
* The total chunk size must include the requested space plus enough
* for the message header. This must be at least some minimum and
- * aligned propertly.
+ * aligned properly.
*/
size = MAX(H5O_MIN_SIZE, size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh));
HDassert(size == H5O_ALIGN_OH(oh, size));
@@ -903,20 +903,18 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new
*/
size += H5O_SIZEOF_CHKHDR_OH(oh);
- /* allocate space in file to hold the new chunk */
+ /* Allocate space in file to hold the new chunk */
new_chunk_addr = H5MF_alloc(f, H5FD_MEM_OHDR, dxpl_id, (hsize_t)size);
- if(HADDR_UNDEF == new_chunk_addr)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate space for new chunk")
+ if(!H5F_addr_defined(new_chunk_addr))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "unable to allocate space for new chunk")
- /*
- * Create the new chunk giving it a file address.
- */
+ /* Create the new chunk giving it a file address. */
if(oh->nchunks >= oh->alloc_nchunks) {
size_t na = MAX(H5O_NCHUNKS, oh->alloc_nchunks * 2); /* Double # of chunks allocated */
H5O_chunk_t *x;
if(NULL == (x = H5FL_SEQ_REALLOC(H5O_chunk_t, oh->chunk, na)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "can't allocate larger chunk array, na = %zu", na)
oh->alloc_nchunks = na;
oh->chunk = x;
} /* end if */
@@ -927,7 +925,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new
oh->chunk[chunkno].size = size;
oh->chunk[chunkno].gap = 0;
if(NULL == (oh->chunk[chunkno].image = p = H5FL_BLK_CALLOC(chunk_image, size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "can't allocate image for chunk, size = %zu", size)
/* If this is a later version of the object header format, put the magic
* # at the beginning of the chunk image.
@@ -1112,8 +1110,7 @@ done:
*
* Purpose: Allocate enough space in the object header for this message.
*
- * Return: Success: Index of message
- * Failure: Negative
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
* matzke@llnl.gov
@@ -1165,7 +1162,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type,
htri_t tri_result; /* Status from attempting to extend chunk */
if((tri_result = H5O_alloc_extend_chunk(f, dxpl_id, oh, chunkno, raw_size, &idx)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTEXTEND, FAIL, "H5O_alloc_extend_chunk failed unexpectedly")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTEXTEND, FAIL, "can't extend existing chunk")
if(tri_result == TRUE)
break;
} /* end for */
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index 3803978..0bb0bdf 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -376,7 +376,7 @@ H5O__cache_deserialize(const void *_image, size_t len, void *_udata,
done:
/* Release the [possibly partially initialized] object header on errors */
if(!ret_value && oh)
- if(H5O_free(oh) < 0)
+ if(H5O__free(oh) < 0)
HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header data")
FUNC_LEAVE_NOAPI(ret_value)
@@ -604,7 +604,7 @@ H5O__cache_free_icr(void *_thing)
HDassert(oh->cache_info.type == H5AC_OHDR);
/* Destroy object header */
- if(H5O_free(oh) < 0)
+ if(H5O__free(oh) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header")
done:
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 0ee8cfd..d056ae8 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -858,6 +858,10 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
oh_dst->nlink += (unsigned)addr_map->inc_ref_count;
} /* end if */
+ /* Retag all copied metadata to apply the destination object's tag */
+ if(H5AC_retag_copied_metadata(oloc_dst->file, oloc_dst->addr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to re-tag metadata entries")
+
/* Set metadata tag for destination object's object header */
H5_BEGIN_TAG(dxpl_id, oloc_dst->addr, FAIL);
@@ -870,10 +874,6 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
/* Reset metadat tag */
H5_END_TAG(FAIL);
- /* Retag all copied metadata to apply the destination object's tag */
- if(H5AC_retag_copied_metadata(oloc_dst->file, oloc_dst->addr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to re-tag metadata entries")
-
/* Set obj_type and udata, if requested */
if(obj_type) {
HDassert(udata);
@@ -892,7 +892,7 @@ done:
/* Free destination object header on failure */
if(ret_value < 0 && oh_dst && !inserted) {
- if(H5O_free(oh_dst) < 0)
+ if(H5O__free(oh_dst) < 0)
HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
if(H5O_loc_reset(oloc_dst) < 0)
HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index e40d28a..a719872 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -535,7 +535,7 @@ H5_DLL const H5O_obj_class_t * H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id
H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted);
H5_DLL herr_t H5O_inc_rc(H5O_t *oh);
H5_DLL herr_t H5O_dec_rc(H5O_t *oh);
-H5_DLL herr_t H5O_free(H5O_t *oh);
+H5_DLL herr_t H5O__free(H5O_t *oh);
/* Object header message routines */
H5_DLL herr_t H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
diff --git a/src/H5SM.c b/src/H5SM.c
index 0b72e40..730e9e0 100644
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -148,7 +148,7 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d
HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set ring value")
/* Initialize master table */
- if(NULL == (table = H5FL_MALLOC(H5SM_master_table_t)))
+ if(NULL == (table = H5FL_CALLOC(H5SM_master_table_t)))
HGOTO_ERROR(H5E_SOHM, H5E_CANTALLOC, FAIL, "memory allocation failed for SOHM table")
table->num_indexes = H5F_SOHM_NINDEXES(f);
table->table_size = H5SM_TABLE_SIZE(f);
@@ -657,7 +657,7 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id)
num_entries = header->list_max;
/* Allocate list in memory */
- if(NULL == (list = H5FL_MALLOC(H5SM_list_t)))
+ if(NULL == (list = H5FL_CALLOC(H5SM_list_t)))
HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for SOHM list")
if(NULL == (list->messages = (H5SM_sohm_t *)H5FL_ARR_CALLOC(H5SM_sohm_t, num_entries)))
HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for SOHM list")
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index 2c2ed07..557e923 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -298,7 +298,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Check arguments */
if (cd_nelmts!=4)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid deflate aggression level")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid number of filter parameters")
/* Copy the filter parameters into the szip parameter block */
H5_CHECKED_ASSIGN(sz_param.options_mask, int, cd_values[H5Z_SZIP_PARM_MASK], unsigned);
diff --git a/src/H5system.c b/src/H5system.c
index e17373c..ab08d2c 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -1106,5 +1106,5 @@ H5_combine_path(const char* path1, const char* path2, char **full_name /*out*/)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5_combine_name() */
+} /* end H5_combine_path() */