diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-06 13:32:07 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-06 13:32:07 (GMT) |
commit | 5b2226efc3156536e262a2b24c78386eacdf0b73 (patch) | |
tree | 95bf9ac2d46009fe1a981af1e0e3d9004010483b /test/cache_common.c | |
parent | 93170b425a30c328c3db0183d8870c6e535c9d7c (diff) | |
download | hdf5-5b2226efc3156536e262a2b24c78386eacdf0b73.zip hdf5-5b2226efc3156536e262a2b24c78386eacdf0b73.tar.gz hdf5-5b2226efc3156536e262a2b24c78386eacdf0b73.tar.bz2 |
[svn-r18721] Description:
Bring r18720 from metadata journaling merging branch to trunk:
Bring changes from metadata journaling branch to 'merging' branch:
Rename H5[A]C_mark_pinned_or_protected_entry_dirty() to
H5[A]C_mark_entry_dirty() and get rid of H5[A]C_mark_pinned_entry_dirty().
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'test/cache_common.c')
-rw-r--r-- | test/cache_common.c | 136 |
1 files changed, 15 insertions, 121 deletions
diff --git a/test/cache_common.c b/test/cache_common.c index 4326616..6290f2a 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1439,7 +1439,7 @@ create_pinned_entry_dependency(H5F_t * file_ptr, * If the dirty_pin parameter is true, verify that the * target entry is in the cache and is pinned. If it * isn't, scream and die. If it is, use the - * H5C_mark_pinned_entry_dirty() call to dirty it. + * H5C_mark_entry_dirty() call to dirty it. * * Do nothing if pass is false on entry. * @@ -1492,7 +1492,7 @@ dirty_entry(H5F_t * file_ptr, } else { - mark_pinned_entry_dirty(type, idx, FALSE, (size_t)0); + mark_entry_dirty(type, idx); } } @@ -1827,7 +1827,7 @@ reset_entries(void) * If the resize_pin parameter is true, verify that the * target entry is in the cache and is pinned. If it * isn't, scream and die. If it is, use the - * H5C_mark_pinned_entry_dirty() call to resize it. + * H5C_resize_pinned_entry() call to resize it. * * Do nothing if pass is false on entry. * @@ -1882,7 +1882,7 @@ resize_entry(H5F_t * file_ptr, } else { - mark_pinned_entry_dirty(type, idx, TRUE, new_size); + resize_pinned_entry(cache_ptr, type, idx, new_size); } } } else { @@ -3074,7 +3074,7 @@ insert_entry(H5F_t * file_ptr, /*------------------------------------------------------------------------- - * Function: mark_pinned_entry_dirty() + * Function: mark_entry_dirty() * * Purpose: Mark the specified entry as dirty. * @@ -3089,10 +3089,8 @@ insert_entry(H5F_t * file_ptr, */ void -mark_pinned_entry_dirty(int32_t type, - int32_t idx, - hbool_t size_changed, - size_t new_size) +mark_entry_dirty(int32_t type, + int32_t idx) { /* const char * fcn_name = "mark_pinned_entry_dirty()"; */ herr_t result; @@ -3110,127 +3108,23 @@ mark_pinned_entry_dirty(int32_t type, HDassert( entry_ptr->index == idx ); HDassert( entry_ptr->type == type ); HDassert( entry_ptr == entry_ptr->self ); - HDassert( ! (entry_ptr->header.is_protected) ); - HDassert( entry_ptr->header.is_pinned ); - HDassert( entry_ptr->is_pinned ); + HDassert( entry_ptr->header.is_protected || + entry_ptr->header.is_pinned ); entry_ptr->is_dirty = TRUE; - if ( size_changed ) { - - /* update entry size now to keep the sanity checks happy */ - entry_ptr->size = new_size; - } - - result = H5C_mark_pinned_entry_dirty((void *)entry_ptr, - size_changed, - new_size); + result = H5C_mark_entry_dirty((void *)entry_ptr); if ( ( result < 0 ) || - ( ! (entry_ptr->header.is_dirty) ) || - ( ! (entry_ptr->header.is_pinned) ) || + ( !entry_ptr->header.is_protected && !entry_ptr->header.is_pinned ) || + ( entry_ptr->header.is_protected && !entry_ptr->header.dirtied ) || + ( !entry_ptr->header.is_protected && !entry_ptr->header.is_dirty ) || ( entry_ptr->header.type != &(types[type]) ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { -#if 0 /* This is useful debugging code -- keep it around */ - HDfprintf(stdout, "result = %ld.\n", (long)result); - HDfprintf(stdout, "entry_ptr->header.is_dirty = %d.\n", - (int)(entry_ptr->header.is_dirty)); - HDfprintf(stdout, "entry_ptr->header.is_pinned = %d.\n", - (int)(entry_ptr->header.is_pinned)); - HDfprintf(stdout, - "(entry_ptr->header.type != &(types[type])) = %d.\n", - (int)(entry_ptr->header.type != &(types[type]))); - HDfprintf(stdout, - "entry_ptr->size = %ld, entry_ptr->header.size = %ld.\n", - (long)(entry_ptr->size), (long)(entry_ptr->header.size)); - HDfprintf(stdout, - "entry_ptr->addr = %ld, entry_ptr->header.addr = %ld.\n", - (long)(entry_ptr->addr), (long)(entry_ptr->header.addr)); -#endif - pass = FALSE; - failure_mssg = "error in H5C_mark_pinned_entry_dirty()."; - - } - - HDassert( ((entry_ptr->header).type)->id == type ); - - } - - return; - -} /* mark_pinned_entry_dirty() */ - - -/*------------------------------------------------------------------------- - * Function: mark_pinned_or_protected_entry_dirty() - * - * Purpose: Mark the specified entry as dirty. - * - * Do nothing if pass is FALSE on entry. - * - * Return: void - * - * Programmer: John Mainzer - * 5/17/06 - * - *------------------------------------------------------------------------- - */ - -void -mark_pinned_or_protected_entry_dirty(int32_t type, - int32_t idx) -{ - /* const char * fcn_name = "mark_pinned_or_protected_entry_dirty()"; */ - herr_t result; - test_entry_t * base_addr; - test_entry_t * entry_ptr; - - if ( pass ) { - - HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); - - base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); - - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->type == type ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->header.is_protected || - entry_ptr->header.is_pinned ); - - entry_ptr->is_dirty = TRUE; - - result = H5C_mark_pinned_or_protected_entry_dirty((void *)entry_ptr); - - if ( ( result < 0 ) - || - ( ( ! (entry_ptr->header.is_protected) ) - && - ( ! (entry_ptr->header.is_pinned) ) - ) - || - ( ( entry_ptr->header.is_protected ) - && - ( ! ( entry_ptr->header.dirtied ) ) - ) - || - ( ( ! ( entry_ptr->header.is_protected ) ) - && - ( ! ( entry_ptr->header.is_dirty ) ) - ) - || - ( entry_ptr->header.type != &(types[type]) ) - || - ( entry_ptr->size != entry_ptr->header.size ) - || - ( entry_ptr->addr != entry_ptr->header.addr ) ) { - pass = FALSE; - failure_mssg = - "error in H5C_mark_pinned_or_protected_entry_dirty()."; + failure_mssg = "error in H5C_mark_entry_dirty()."; } @@ -3240,7 +3134,7 @@ mark_pinned_or_protected_entry_dirty(int32_t type, return; -} /* mark_pinned_or_protected_entry_dirty() */ +} /* mark_entry_dirty() */ /*------------------------------------------------------------------------- |