diff options
Diffstat (limited to 'src/H5C.c')
-rw-r--r-- | src/H5C.c | 67 |
1 files changed, 2 insertions, 65 deletions
@@ -5074,14 +5074,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; @@ -5101,18 +5099,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 ); @@ -5126,9 +5117,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 */ @@ -5240,58 +5228,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) } |