summaryrefslogtreecommitdiffstats
path: root/src/H5C.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2016-01-11 15:55:55 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2016-01-11 15:55:55 (GMT)
commit5dbc03ac86cb05730467eb0cad4bf3fb51a74ae4 (patch)
tree85afdc8134a6e0b512c8ffeb3a63b6af4eb5409e /src/H5C.c
parent2824e6bef0f9ea6550845f75ad4580349eafb822 (diff)
parent887cf130ff773568f90ec8bae66dafa761a77712 (diff)
downloadhdf5-5dbc03ac86cb05730467eb0cad4bf3fb51a74ae4.zip
hdf5-5dbc03ac86cb05730467eb0cad4bf3fb51a74ae4.tar.gz
hdf5-5dbc03ac86cb05730467eb0cad4bf3fb51a74ae4.tar.bz2
[svn-r28851] merge from trunk.
Diffstat (limited to 'src/H5C.c')
-rw-r--r--src/H5C.c87
1 files changed, 33 insertions, 54 deletions
diff --git a/src/H5C.c b/src/H5C.c
index 15ff757..8536ab0 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -6992,7 +6992,7 @@ H5C_flush_invalidate_ring(const H5F_t * f, hid_t dxpl_id, H5C_ring_t ring,
/* Get cache entry for this node */
next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
- if ( NULL == next_entry_ptr )
+ if(NULL == next_entry_ptr)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!")
HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
@@ -7430,8 +7430,8 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags)
#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)) {
+ (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 */
@@ -7794,7 +7794,7 @@ done:
*
* Refactored function to delay all modifications of the
* metadata cache data structures until after any calls
- * to the pre-serialize or serialize callbacks.
+ * to the pre-serialize or serialize callbacks.
*
* Need to do this, as some pre-serialize or serialize
* calls result in calls to the metadata cache and
@@ -7862,7 +7862,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
HDassert(FALSE == entry_ptr->coll_access);
#endif
- /* we will write the entry to disk if it exists, is dirty, and if the
+ /* we will write the entry to disk if it exists, is dirty, and if the
* clear only flag is not set.
*/
if(entry_ptr->is_dirty && !clear_only)
@@ -8270,7 +8270,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
/* only log a flush if we actually wrote to disk */
H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr)
- }
+ } /* end else if */
if(destroy) {
if(take_ownership)
@@ -8279,7 +8279,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
HDassert(destroy_entry);
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
@@ -8527,12 +8527,12 @@ H5C_load_entry(H5F_t * f,
/* verify absence of prohibited or unsupported type flag combinations */
HDassert(!(type->flags & H5C__CLASS_NO_IO_FLAG));
-
+
/* for now, we do not combine the speculative load and compressed flags */
HDassert(!((type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) &&
(type->flags & H5C__CLASS_COMPRESSED_FLAG)));
- /* Can't see how skip reads could be usefully combined with
+ /* Can't see how skip reads could be usefully combined with
* either the speculative read or compressed flags. Hence disallow.
*/
HDassert(!((type->flags & H5C__CLASS_SKIP_READS) &&
@@ -8654,12 +8654,10 @@ H5C_load_entry(H5F_t * f,
}
/* Allocate the buffer for reading the on-disk entry image */
if(NULL == (image = H5MM_malloc(len + H5C_IMAGE_EXTRA_SPACE)))
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, \
- "memory allocation failed for on disk image buffer.")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "memory allocation failed for on disk image buffer.")
#if H5C_DO_MEMORY_SANITY_CHECKS
- HDmemcpy(((uint8_t *)image) + len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
+ HDmemcpy(image + len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
#endif /* H5C_DO_MEMORY_SANITY_CHECKS */
#ifdef H5_HAVE_PARALLEL
@@ -8721,12 +8719,9 @@ H5C_load_entry(H5F_t * f,
/* Get the actual image size for the thing */
if(type->image_len(thing, &new_len, &compressed, &compressed_size) < 0)
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, \
- "can't retrieve image length")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't retrieve image length")
if(new_len == 0)
-
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "image length is 0")
HDassert(((type->flags & H5C__CLASS_COMPRESSED_FLAG) != 0) ||
@@ -8770,15 +8765,13 @@ H5C_load_entry(H5F_t * f,
if(NULL == (new_image = H5MM_realloc(image,
new_len + H5C_IMAGE_EXTRA_SPACE)))
- HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, \
- "image null after H5MM_realloc()")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "image null after H5MM_realloc()")
image = new_image;
#if H5C_DO_MEMORY_SANITY_CHECKS
- HDmemcpy(((uint8_t *)image) + new_len,
- H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
+ HDmemcpy(((uint8_t *)image) + new_len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
#endif /* H5C_DO_MEMORY_SANITY_CHECKS */
@@ -8799,8 +8792,7 @@ H5C_load_entry(H5F_t * f,
if ( type->free_icr(thing) < 0 )
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, NULL, \
- "free_icr callback failed")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, NULL, "free_icr callback failed")
#ifdef H5_HAVE_PARALLEL
if(!coll_access || 0 == mpi_rank) {
@@ -8881,7 +8873,7 @@ H5C_load_entry(H5F_t * f,
*
* HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) );
*
- * note that type ids 5 & 6 are associated with object headers in the
+ * note that type ids 5 & 6 are associated with object headers in the
* metadata cache.
*
* When we get to using H5C for other purposes, we may wish to
@@ -9089,8 +9081,8 @@ H5C_make_space_in_cache(H5F_t * f,
( entry_ptr != NULL )
)
{
- HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
- HDassert( ! (entry_ptr->is_protected) );
+ HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert( !(entry_ptr->is_protected) );
HDassert( ! (entry_ptr->is_read_only) );
HDassert( (entry_ptr->ro_ref_count) == 0 );
@@ -9122,8 +9114,8 @@ H5C_make_space_in_cache(H5F_t * f,
* last_entry_removed_ptr prior to the call to
* H5C__flush_single_entry() so that we can spot
* unexpected removals of entries from the cache,
- * and set the restart_scan flag if proceeding
- * would be likely to cause us to scan an entry
+ * and set the restart_scan flag if proceeding
+ * would be likely to cause us to scan an entry
* that is no longer in the cache.
*/
cache_ptr->entries_removed_counter = 0;
@@ -9186,15 +9178,15 @@ H5C_make_space_in_cache(H5F_t * f,
if ( didnt_flush_entry ) {
- /* epoch markers don't get flushed, and we don't touch
+ /* epoch markers don't get flushed, and we don't touch
* entries that are in the process of being flushed.
- * Hence no need for sanity checks, as we haven't
- * flushed anything. Thus just set entry_ptr to prev_ptr
+ * Hence no need for sanity checks, as we haven't
+ * flushed anything. Thus just set entry_ptr to prev_ptr
* and go on.
*/
entry_ptr = prev_ptr;
- } else if ( ( restart_scan )
+ } else if ( ( restart_scan )
||
( prev_ptr->is_dirty != prev_is_dirty )
||
@@ -9370,10 +9362,8 @@ H5C_validate_lru_list(H5C_t * cache_ptr)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed")
}
- if ( ( cache_ptr->LRU_list_len < 0 ) || ( cache_ptr->LRU_list_size < 0 ) ) {
-
+ if(cache_ptr->LRU_list_len < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed")
- }
if ( ( cache_ptr->LRU_list_len == 1 )
&&
@@ -9500,10 +9490,8 @@ H5C_validate_pinned_entry_list(H5C_t * cache_ptr)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed")
}
- if ( ( cache_ptr->pel_len < 0 ) || ( cache_ptr->pel_size < 0 ) ) {
-
+ if(cache_ptr->pel_len < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed")
- }
if ( ( cache_ptr->pel_len == 1 )
&&
@@ -9623,21 +9611,12 @@ H5C_validate_protected_entry_list(H5C_t * cache_ptr)
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- if ( ( ( cache_ptr->pl_head_ptr == NULL )
- ||
- ( cache_ptr->pl_tail_ptr == NULL )
- )
- &&
- ( cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr )
- ) {
-
+ if(((cache_ptr->pl_head_ptr == NULL) || (cache_ptr->pl_tail_ptr == NULL))
+ && (cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed")
- }
-
- if ( ( cache_ptr->pl_len < 0 ) || ( cache_ptr->pl_size < 0 ) ) {
+ if(cache_ptr->pl_len < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed")
- }
if ( ( cache_ptr->pl_len == 1 )
&&
@@ -9968,7 +9947,7 @@ done:
* Function: H5C_ignore_tags
*
* Purpose: Override all assertion frameworks associated with making
- * sure proper tags are applied to metadata.
+ * sure proper tags are applied to cache entries.
*
* NOTE: This should really only be used in tests that need
* to access internal functions without going through
@@ -10080,7 +10059,7 @@ done:
* Return: FAIL if error is detected, SUCCEED otherwise.
*
* Programmer: Mike McGreevy
- * November 3, 2009
+ * August 19, 2010
*
*-------------------------------------------------------------------------
*/
@@ -10123,7 +10102,7 @@ done:
* Return: FAIL if error is detected, SUCCEED otherwise.
*
* Programmer: Mike McGreevy
- * November 3, 2009
+ * September 9, 2010
*
*-------------------------------------------------------------------------
*/
@@ -10169,7 +10148,7 @@ H5C_mark_tagged_entries(H5C_t * cache_ptr, haddr_t tag)
* Return: FAIL if error is detected, SUCCEED otherwise.
*
* Programmer: Mike McGreevy
- * November 3, 2009
+ * November 3, 2010
*
*-------------------------------------------------------------------------
*/