summaryrefslogtreecommitdiffstats
path: root/src/H5C.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-18 19:09:04 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-18 19:09:04 (GMT)
commit4e0e18dfa5aab1bf63e130c9569ffba83ce3697e (patch)
tree376f356a2d69eb6939c6aacbab8be276f96df7fc /src/H5C.c
parent38df150e1635103c44ec4c89ee9eff43a61ebc84 (diff)
downloadhdf5-4e0e18dfa5aab1bf63e130c9569ffba83ce3697e.zip
hdf5-4e0e18dfa5aab1bf63e130c9569ffba83ce3697e.tar.gz
hdf5-4e0e18dfa5aab1bf63e130c9569ffba83ce3697e.tar.bz2
[svn-r18851] Description:
Bring r18837 from trunk to 1.8 branch: Remove the size parameter from H5[A]C_unprotect() and the H5[A]C__SIZE_CHANGED_FLAG, switching all clients & tests over to using H5[A]C_resize_entry appropriately. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug 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 (h5committested on trunk)
Diffstat (limited to 'src/H5C.c')
-rw-r--r--src/H5C.c67
1 files changed, 2 insertions, 65 deletions
diff --git a/src/H5C.c b/src/H5C.c
index f56704e..597f9db 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -4961,14 +4961,12 @@ H5C_unprotect(H5F_t * f,
const H5C_class_t * type,
haddr_t addr,
void * thing,
- unsigned int flags,
- size_t new_size)
+ unsigned int flags)
{
H5C_t * cache_ptr;
hbool_t deleted;
hbool_t dirtied;
hbool_t set_flush_marker;
- hbool_t size_changed;
hbool_t pin_entry;
hbool_t unpin_entry;
hbool_t free_file_space;
@@ -4988,18 +4986,11 @@ H5C_unprotect(H5F_t * f,
deleted = ( (flags & H5C__DELETED_FLAG) != 0 );
dirtied = ( (flags & H5C__DIRTIED_FLAG) != 0 );
set_flush_marker = ( (flags & H5C__SET_FLUSH_MARKER_FLAG) != 0 );
- size_changed = ( (flags & H5C__SIZE_CHANGED_FLAG) != 0 );
pin_entry = ( (flags & H5C__PIN_ENTRY_FLAG) != 0 );
unpin_entry = ( (flags & H5C__UNPIN_ENTRY_FLAG) != 0 );
free_file_space = ( (flags & H5C__FREE_FILE_SPACE_FLAG) != 0 );
take_ownership = ( (flags & H5C__TAKE_OWNERSHIP_FLAG) != 0 );
- /* Changing the size of an entry dirties it. Thus, set the
- * dirtied flag if the size_changed flag is set.
- */
-
- dirtied |= size_changed;
-
HDassert( f );
HDassert( f->shared );
@@ -5013,9 +5004,6 @@ H5C_unprotect(H5F_t * f,
HDassert( type->flush );
HDassert( H5F_addr_defined(addr) );
HDassert( thing );
- HDassert( ( size_changed == TRUE ) || ( size_changed == FALSE ) );
- HDassert( ( ! size_changed ) || ( dirtied ) );
- HDassert( ( ! size_changed ) || ( new_size > 0 ) );
HDassert( ! ( pin_entry && unpin_entry ) );
HDassert( ( ! free_file_space ) || ( deleted ) ); /* deleted flag must accompany free_file_space */
HDassert( ( ! take_ownership ) || ( deleted ) ); /* deleted flag must accompany take_ownership */
@@ -5135,58 +5123,7 @@ H5C_unprotect(H5F_t * f,
/* mark the entry as dirty if appropriate */
entry_ptr->is_dirty = ( (entry_ptr->is_dirty) || dirtied );
- /* update for change in entry size if necessary */
- if ( ( size_changed ) && ( entry_ptr->size != new_size ) ) {
-
- /* do a flash cache size increase if appropriate */
- if ( cache_ptr->flash_size_increase_possible ) {
-
- if ( new_size > entry_ptr->size ) {
-
- size_increase = new_size - entry_ptr->size;
-
- if ( size_increase >=
- cache_ptr->flash_size_increase_threshold ) {
-
- result = H5C__flash_increase_cache_size(cache_ptr,
- entry_ptr->size,
- new_size);
-
- if ( result < 0 ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \
- "H5C__flash_increase_cache_size failed.")
- }
- }
- }
- }
-
- /* update the protected list */
- H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pl_len), \
- (cache_ptr->pl_size), \
- (entry_ptr->size), (new_size));
-
- /* update the hash table */
- 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));
- }
-
- /* update statistics just before changing the entry size */
- H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_ptr), \
- (new_size));
-
- /* finally, update the entry size proper */
- entry_ptr->size = new_size;
-
- } else if ( ( was_clean ) && ( entry_ptr->is_dirty ) ) {
+ if ( ( was_clean ) && ( entry_ptr->is_dirty ) ) {
H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr)
}