diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-06 00:50:20 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-06 00:50:20 (GMT) |
commit | 731916db3cb3f03f9d7f0dbca86988cae4bb50f5 (patch) | |
tree | 0cde8b5d4c55b4f07a5d2f3c5cc20784d8e3ce1a | |
parent | cb772e9939a8dd4e447ad7f8e4cf2fdefb8f37db (diff) | |
download | hdf5-731916db3cb3f03f9d7f0dbca86988cae4bb50f5.zip hdf5-731916db3cb3f03f9d7f0dbca86988cae4bb50f5.tar.gz hdf5-731916db3cb3f03f9d7f0dbca86988cae4bb50f5.tar.bz2 |
[svn-r18718] Description:
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:
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
-rw-r--r-- | src/H5AC.c | 90 | ||||
-rw-r--r-- | src/H5ACprivate.h | 4 | ||||
-rw-r--r-- | src/H5C.c | 127 | ||||
-rw-r--r-- | src/H5Cprivate.h | 10 | ||||
-rw-r--r-- | src/H5FS.c | 2 | ||||
-rw-r--r-- | src/H5FSsection.c | 20 | ||||
-rw-r--r-- | src/H5HFhdr.c | 2 | ||||
-rw-r--r-- | src/H5HFiblock.c | 2 | ||||
-rw-r--r-- | src/H5HL.c | 4 | ||||
-rw-r--r-- | src/H5O.c | 8 | ||||
-rw-r--r-- | src/H5Oalloc.c | 4 | ||||
-rw-r--r-- | src/H5Ochunk.c | 2 | ||||
-rw-r--r-- | src/H5Omessage.c | 2 | ||||
-rw-r--r-- | test/cache.c | 88 | ||||
-rw-r--r-- | test/cache_common.c | 121 | ||||
-rw-r--r-- | test/cache_common.h | 14 | ||||
-rw-r--r-- | test/cache_journal.c | 29 | ||||
-rw-r--r-- | testpar/t_cache.c | 118 |
18 files changed, 99 insertions, 548 deletions
@@ -1914,91 +1914,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5AC_mark_pinned_entry_dirty - * - * Purpose: Mark a pinned entry as dirty. The target entry MUST be - * be pinned, and MUST be unprotected. - * - * If the entry has changed size, the function updates - * data structures for the size change. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 4/11/06 - * - *------------------------------------------------------------------------- - */ -herr_t -H5AC_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size) -{ -#if H5AC__TRACE_FILE_ENABLED - char trace[128] = ""; - FILE * trace_file_ptr = NULL; -#endif /* H5AC__TRACE_FILE_ENABLED */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5AC_mark_pinned_entry_dirty, FAIL) - - /* Sanity check */ - HDassert(thing); - -#if H5AC__TRACE_FILE_ENABLED - /* For the mark pinned entry dirty call, only the addr, size_changed, - * and new_size are really necessary in the trace file. Write the result - * to catch occult errors. - */ - if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) - sprintf(trace, "%s 0x%lx %d %d", FUNC, - (unsigned long)(((H5C_cache_entry_t *)thing)->addr), - (int)size_changed, - (int)new_size); -#endif /* H5AC__TRACE_FILE_ENABLED */ - -#ifdef H5_HAVE_PARALLEL -{ - H5AC_info_t *entry_ptr = (H5AC_info_t *)thing; - H5C_t *cache_ptr = entry_ptr->cache_ptr; - - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - - if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) { - /* Check for usage errors */ - if(!entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry isn't pinned??") - if(entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry is protected??") - - if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr, size_changed, new_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") - } /* end if */ -} -#endif /* H5_HAVE_PARALLEL */ - - if(H5C_mark_pinned_entry_dirty(thing, size_changed, new_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't mark pinned entry dirty") - -done: -#if H5AC__TRACE_FILE_ENABLED - if(trace_file_ptr) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); -#endif /* H5AC__TRACE_FILE_ENABLED */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_mark_pinned_entry_dirty() */ - - -/*------------------------------------------------------------------------- - * Function: H5AC_mark_pinned_or_protected_entry_dirty + * Function: H5AC_mark_entry_dirty * * Purpose: Mark a pinned or protected entry as dirty. The target * entry MUST be either pinned, protected, or both. * - * Unlike H5AC_mark_pinned_entry_dirty(), this function does - * not support size changes. - * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2007,7 +1927,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_mark_pinned_or_protected_entry_dirty(void *thing) +H5AC_mark_entry_dirty(void *thing) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -2015,7 +1935,7 @@ H5AC_mark_pinned_or_protected_entry_dirty(void *thing) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_mark_pinned_or_protected_entry_dirty, FAIL) + FUNC_ENTER_NOAPI(H5AC_mark_entry_dirty, FAIL) /* Sanity check */ HDassert(thing); @@ -2047,7 +1967,7 @@ H5AC_mark_pinned_or_protected_entry_dirty(void *thing) } #endif /* H5_HAVE_PARALLEL */ - if(H5C_mark_pinned_or_protected_entry_dirty(thing) < 0) + if(H5C_mark_entry_dirty(thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't mark pinned or protected entry dirty") done: @@ -2057,7 +1977,7 @@ done: #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_mark_pinned_entry_dirty() */ +} /* H5AC_mark_entry_dirty() */ /*------------------------------------------------------------------------- diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index e970ef3..1cf9dcc 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -314,9 +314,7 @@ H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, size_t new_size, void *thing, unsigned flags); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags); -H5_DLL herr_t H5AC_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, - size_t new_size); -H5_DLL herr_t H5AC_mark_pinned_or_protected_entry_dirty(void *thing); +H5_DLL herr_t H5AC_mark_entry_dirty(void *thing); H5_DLL herr_t H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr); @@ -2934,130 +2934,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_mark_pinned_entry_dirty - * - * Purpose: Mark a pinned entry as dirty. The target entry MUST be - * be pinned, and MUST be unprotected. - * - * If the entry has changed size, the function updates - * data structures for the size change. - * - * If the entry is not already dirty, the function places - * the entry on the skip list. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 3/22/06 - * - *------------------------------------------------------------------------- - */ -herr_t -H5C_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size) -{ - H5C_t * cache_ptr; - H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; - size_t size_increase; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5C_mark_pinned_entry_dirty, FAIL) - - /* Sanity checks */ - HDassert(entry_ptr); - HDassert(H5F_addr_defined(entry_ptr->addr)); - cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert((!cache_ptr->mdj_enabled) || cache_ptr->trans_in_progress); - - /* Check for usage errors */ - if(!entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry isn't pinned??") - if(entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry is protected??") - - /* mark the entry as dirty if it isn't already */ - entry_ptr->is_dirty = TRUE; - entry_ptr->image_up_to_date = FALSE; - - /* update for change in entry size if necessary */ - if ( ( size_changed ) && ( entry_ptr->size != new_size ) ) { - - /* Release the current image */ - if( entry_ptr->image_ptr ) - entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); - - /* 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 ) { - if(H5C__flash_increase_cache_size(cache_ptr, entry_ptr->size, new_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "flash cache increase failed") - } - } - } - - /* update the pinned entry list */ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pel_len), \ - (cache_ptr->pel_size), \ - (entry_ptr->size), (new_size)); - - /* update the hash table */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\ - (new_size)); - - /* 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)); - } - - /* if journaling is enabled, and the entry is already in the - * transaction list, update that list for the size change as well. - */ - H5C__UPDATE_TL_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_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; - } - - if ( ! (entry_ptr->in_slist) ) { - - H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) - } - - /* if journaling is enabled, check to see if the entry is in the - * transaction list. If it isn't, insert it. If it is, move it to - * the head of the list. - */ - H5C__UPDATE_TL_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr, FAIL) - - H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_mark_pinned_entry_dirty() */ - - -/*------------------------------------------------------------------------- - * Function: H5C_mark_pinned_or_protected_entry_dirty + * Function: H5C_mark_entry_dirty * * Purpose: Mark a pinned or protected entry as dirty. The target entry * MUST be either pinned or protected, and MAY be both. * - * At present, this funtion does not support size change. - * * In the protected case, this call is the functional * equivalent of setting the H5C__DIRTIED_FLAG on an unprotect * call. @@ -3074,13 +2955,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_mark_pinned_or_protected_entry_dirty(void *thing) +H5C_mark_entry_dirty(void *thing) { H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_mark_pinned_or_protected_entry_dirty, FAIL) + FUNC_ENTER_NOAPI(H5C_mark_entry_dirty, FAIL) /* Sanity checks */ HDassert(entry_ptr); @@ -3127,7 +3008,7 @@ H5C_mark_pinned_or_protected_entry_dirty(void *thing) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_mark_pinned_or_protected_entry_dirty() */ +} /* H5C_mark_entry_dirty() */ /*------------------------------------------------------------------------- diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 7c7f0ac..c323e04 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -544,10 +544,10 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * * This field is set to FALSE in the protect call, and may * be set to TRUE by the - * H5C_mark_pinned_or_protected_entry_dirty() + * H5C_mark_entry_dirty() * call at an time prior to the unprotect call. * - * The H5C_mark_pinned_or_protected_entry_dirty() call exists + * The H5C_mark_entry_dirty() call exists * as a convenience function for the fractal heap code which * may not know if an entry is protected or pinned, but knows * that is either protected or pinned. The dirtied field was @@ -1399,11 +1399,7 @@ H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t * f, int32_t ce_array_len, haddr_t *ce_array_ptr); -H5_DLL herr_t H5C_mark_pinned_entry_dirty(void * thing, - hbool_t size_changed, - size_t new_size); - -H5_DLL herr_t H5C_mark_pinned_or_protected_entry_dirty(void *thing); +H5_DLL herr_t H5C_mark_entry_dirty(void *thing); H5_DLL herr_t H5C_rename_entry(H5C_t * cache_ptr, const H5C_class_t * type, @@ -379,7 +379,7 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_c fspace->alloc_sect_size = fspace->sect_size = 0; /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") /* Evict the section info from the metadata cache */ diff --git a/src/H5FSsection.c b/src/H5FSsection.c index cbc7efa..e53fa0c 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -226,7 +226,7 @@ HDfprintf(stderr, "%s: New section info, addr = %a, size = %Hu\n", FUNC, fspace- HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, NULL, "can't add free space sections to cache") /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, NULL, "unable to mark free space header as dirty") } /* end if */ else { @@ -323,7 +323,7 @@ HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); } /* end else */ /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") done: @@ -386,7 +386,7 @@ HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); } /* end else */ /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") done: @@ -591,7 +591,7 @@ HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); fspace->tot_space -= sect->size; /* Mark free space sections as changed */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace->sinfo) < 0) + if(H5AC_mark_entry_dirty(fspace->sinfo) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space sections as dirty") done: @@ -1102,7 +1102,7 @@ HDfprintf(stderr, "%s: fspace->hdr->tot_space = %Hu\n", FUNC, fspace->tot_space) /* Mark free space sections as changed */ /* (if adding sections while deserializing sections, don't set the flag) */ if(!(flags & H5FS_ADD_DESERIALIZING)) { - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace->sinfo) < 0) + if(H5AC_mark_entry_dirty(fspace->sinfo) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space sections as dirty") } /* end if */ @@ -1382,12 +1382,12 @@ HDfprintf(stderr, "%s: old_addr = %a, fspace->sect_addr = %a\n", FUNC, old_addr, } /* end if */ else { /* Mark free space section as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace->sinfo) < 0) + if(H5AC_mark_entry_dirty(fspace->sinfo) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space section info as dirty") } /* end else */ /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end if */ else { @@ -1447,12 +1447,12 @@ HDfprintf(stderr, "%s: Allocating space for smaller serialized sections, new_siz } /* end if */ else { /* Mark free space section as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace->sinfo) < 0) + if(H5AC_mark_entry_dirty(fspace->sinfo) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space section info as dirty") } /* end else */ /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end if */ } /* end else */ @@ -1791,7 +1791,7 @@ HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC HGOTO_ERROR(H5E_FSPACE, H5E_CANTCOMPUTE, FAIL, "can't adjust free space section size on disk") /* Mark free space sections as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace->sinfo) < 0) + if(H5AC_mark_entry_dirty(fspace->sinfo) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space sections as dirty") done: diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 9c08eed..4da956d 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -713,7 +713,7 @@ H5HF_hdr_dirty(H5HF_hdr_t *hdr) } /* end if */ /* Mark header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(hdr) < 0) + if(H5AC_mark_entry_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark fractal heap header as dirty") /* Set the dirty flags for the heap header */ diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 4fe109a..9013c0c 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -335,7 +335,7 @@ H5HF_iblock_dirty(H5HF_indirect_t *iblock) HDassert(iblock); /* Mark indirect block as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(iblock) < 0) + if(H5AC_mark_entry_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark fractal heap indirect block as dirty") done: @@ -662,12 +662,12 @@ H5HL_dirty(H5HL_t *heap) /* Sanity check */ HDassert(heap->dblk); - if(H5AC_mark_pinned_or_protected_entry_dirty(heap->dblk) < 0) + if(H5AC_mark_entry_dirty(heap->dblk) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap data block as dirty") } /* end if */ /* Mark heap prefix as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(heap->prfx) < 0) + if(H5AC_mark_entry_dirty(heap->prfx) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap prefix as dirty") done: @@ -1455,7 +1455,7 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) oh->nlink += adjust; /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") /* Check if the object should be deleted */ @@ -1486,7 +1486,7 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) oh->nlink += adjust; /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end if */ @@ -1696,7 +1696,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) /* (usually through updating the # of object header messages) */ if(oh->prefix_modified) { /* Mark the header as dirty now */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, NULL, "unable to mark object header as dirty") /* Reset flag */ @@ -1933,7 +1933,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) oh->atime = oh->ctime = now; /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end else */ } /* end if */ diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index a4619df..4540d35 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -618,7 +618,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, oh->flags |= new_size_flags; /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end if */ @@ -1120,7 +1120,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, UFAIL, "can't split null message") /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, UFAIL, "unable to mark object header as dirty") /* Set return value */ diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index 002b0fe..304b296 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -230,7 +230,7 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_chunk_proxy_t *chk_p /* Check for dirtying the first chunk */ else if(chk_flags & H5AC__DIRTIED_FLAG) { /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end else/if */ else { diff --git a/src/H5Omessage.c b/src/H5Omessage.c index b3bda5f..39a5256 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1368,7 +1368,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object") /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end if */ diff --git a/test/cache.c b/test/cache.c index 298a56d..922fda9 100644 --- a/test/cache.c +++ b/test/cache.c @@ -11422,8 +11422,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * JRM -- 5/17/06 * Complete reqrite of pinned entry tests to accomodate - * the new H5C_mark_pinned_or_protected_entry_dirty() - * call. + * the new H5C_mark_entry_dirty() call. * *------------------------------------------------------------------------- */ @@ -12710,13 +12709,12 @@ check_flush_cache__single_entry(H5F_t * file_ptr) * * 2) Marked dirty by unprotect or not. * - * 3) Marked dirty by call to H5C_mark_pinned_entry_dirty() or not. + * 3) Marked dirty by call to H5C_mark_entry_dirty() or not. * - * 4) Marked dirty by call to H5C_mark_pinned_or_protected_entry_dirty() - * while protected or not. + * 4) Marked dirty by call to H5C_mark_entry_dirty() while protected + * or not. * - * 5) Marked dirty by call to H5C_mark_pinned_or_protected_entry_dirty() - * while pinned or not. + * 5) Marked dirty by call to H5C_mark_entry_dirty() while pinned or not. * * 6) Entry marked for flush or not. * @@ -13282,7 +13280,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, * JRM -- 5/17/06 * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned * flags and supporting code to allow us to test the - * H5C_mark_pinned_or_protected_entry_dirty() call. Use the + * H5C_mark_entry_dirty() call. Use the * call to mark the entry dirty while the entry is protected * if pop_mark_dirty_prot is TRUE, and to mark the entry * dirty while it is pinned if pop_mark_dirty_pinned is TRUE. @@ -13350,9 +13348,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( pop_mark_dirty_prot ) { - mark_pinned_or_protected_entry_dirty(file_ptr, - entry_type, - entry_idx); + mark_entry_dirty(file_ptr, entry_type, entry_idx); } unprotect_entry(file_ptr, entry_type, entry_idx, @@ -13360,15 +13356,12 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( mark_dirty ) { - mark_pinned_entry_dirty(file_ptr, entry_type, entry_idx, - FALSE, (size_t)0); + mark_entry_dirty(file_ptr, entry_type, entry_idx); } if ( pop_mark_dirty_pinned ) { - mark_pinned_or_protected_entry_dirty(file_ptr, - entry_type, - entry_idx); + mark_entry_dirty(file_ptr, entry_type, entry_idx); } } @@ -13638,7 +13631,7 @@ check_get_entry_status(void) } } - mark_pinned_entry_dirty(file_ptr, 0, 0, FALSE, (size_t)0); + mark_entry_dirty(file_ptr, 0, 0); if ( pass ) { @@ -17518,13 +17511,7 @@ check_double_unprotect_err(void) * * Purpose: Verify that: * - * 1) a call to H5C_mark_pinned_entry_dirty with an upinned - * entry as the target will generate an error. - * - * 2) a call to H5C_mark_pinned_entry_dirty with a protected - * entry as the target will generate an error. - * - * 3) a call to H5C_mark_pinned_or_protected_entry_dirty with + * 1) a call to H5C_mark_entry_dirty with * and unpinned and unprotected entry will generate an * error. * @@ -17533,10 +17520,6 @@ check_double_unprotect_err(void) * Programmer: John Mainzer * 5/17/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -17554,14 +17537,8 @@ check_mark_entry_dirty_errs(void) pass = TRUE; - /* allocate a cache, protect an entry, and then attempt to mark it dirty - * with the H5C_mark_pinned_entry_dirty() call -- This should fail. - * - * Then unprotect the entry without pinning it, and try to mark it dirty - * again -- this should fail too. - * - * Try it again using H5C_mark_pinned_or_protected_entry_dirty -- this - * should fail as well. + /* allocate a cache, protect an entry, unprotect the entry without + * pinning it, and try to mark it dirty -- this should fail. * * Destroy the cache -- should succeed. */ @@ -17575,54 +17552,21 @@ check_mark_entry_dirty_errs(void) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG); - - protect_entry(file_ptr, 0, 0); + unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); entry_ptr = &((entries[0])[0]); } if ( pass ) { - result = H5C_mark_pinned_entry_dirty((void *)entry_ptr, - FALSE, (size_t)0); - - if ( result > 0 ) { - - pass = FALSE; - failure_mssg = - "attempt dirty a pinned and protected entry succeeded.\n"; - - } else { - - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG); - } - } - - if ( pass ) { - - result = H5C_mark_pinned_entry_dirty((void *)entry_ptr, - FALSE, (size_t)0); - - - if ( result > 0 ) { - - pass = FALSE; - failure_mssg = - "attempt to dirty a unpinned and unprotected entry succeeded 1.\n"; - } - } - - if ( pass ) { - - result = H5C_mark_pinned_or_protected_entry_dirty((void *)entry_ptr); + result = H5C_mark_entry_dirty((void *)entry_ptr); if ( result > 0 ) { pass = FALSE; failure_mssg = - "attempt to dirty a unpinned and unprotected entry succeeded 2.\n"; + "attempt to dirty a unpinned and unprotected entry succeeded.\n"; } } diff --git a/test/cache_common.c b/test/cache_common.c index 240bbb92..789113f 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1340,7 +1340,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. * @@ -1393,8 +1393,7 @@ dirty_entry(H5F_t * file_ptr, } else { - mark_pinned_entry_dirty(file_ptr, type, idx, - FALSE, (size_t)0); + mark_entry_dirty(file_ptr, type, idx); } } @@ -1783,7 +1782,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. * @@ -1839,8 +1838,7 @@ resize_entry(H5F_t * file_ptr, } else { - mark_pinned_entry_dirty(file_ptr, type, idx, - TRUE, new_size); + resize_pinned_entry(file_ptr, type, idx, new_size); } } } else { @@ -2967,7 +2965,7 @@ insert_entry(H5F_t * file_ptr, /*------------------------------------------------------------------------- - * Function: mark_pinned_entry_dirty() + * Function: mark_entry_dirty() * * Purpose: Mark the specified entry as dirty. * @@ -2982,11 +2980,9 @@ insert_entry(H5F_t * file_ptr, */ void -mark_pinned_entry_dirty(H5F_t * file_ptr, +mark_entry_dirty(H5F_t * file_ptr, int32_t type, - int32_t idx, - hbool_t size_changed, - size_t new_size) + int32_t idx) { #ifndef NDEBUG H5C_t * cache_ptr; @@ -3018,15 +3014,7 @@ mark_pinned_entry_dirty(H5F_t * file_ptr, 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) ) || @@ -3052,96 +3040,7 @@ mark_pinned_entry_dirty(H5F_t * file_ptr, (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(H5F_t * file_ptr, - int32_t type, - int32_t idx) -{ -#ifndef NDEBUG - H5C_t * cache_ptr; -#endif /* NDEBUG */ - herr_t result; - test_entry_t * base_addr; - test_entry_t * entry_ptr; - - if ( pass ) { - -#ifndef NDEBUG - cache_ptr = file_ptr->shared->cache; -#endif /* NDEBUG */ - - HDassert( cache_ptr ); - 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->cache_ptr == cache_ptr ); - 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()."; } @@ -3151,7 +3050,7 @@ mark_pinned_or_protected_entry_dirty(H5F_t * file_ptr, return; -} /* mark_pinned_or_protected_entry_dirty() */ +} /* mark_entry_dirty() */ /*------------------------------------------------------------------------- diff --git a/test/cache_common.h b/test/cache_common.h index f98323a..e748b60 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -170,13 +170,13 @@ typedef struct flush_op * FLUSH_OP__DIRTY: TRUE iff the * target is pinned, and is to * be dirtied via the - * H5C_mark_pinned_entry_dirty() + * H5C_mark_entry_dirty() * call. * * FLUSH_OP__RESIZE: TRUE iff the * target is pinned, and is to * be resized via the - * H5C_mark_pinned_entry_dirty() + * H5C_mark_entry_dirty() * call. * * FLUSH_OP__RENAME: TRUE iff the @@ -770,15 +770,9 @@ void insert_entry(H5F_t * file_ptr, hbool_t dirty, unsigned int flags); -void mark_pinned_entry_dirty(H5F_t * file_ptr, +void mark_entry_dirty(H5F_t * file_ptr, int32_t type, - int32_t idx, - hbool_t size_changed, - size_t new_size); - -void mark_pinned_or_protected_entry_dirty(H5F_t * file_ptr, - int32_t type, - int32_t idx); + int32_t idx); void rename_entry(H5C_t * cache_ptr, int32_t type, diff --git a/test/cache_journal.c b/test/cache_journal.c index a39515c..70428b4 100644 --- a/test/cache_journal.c +++ b/test/cache_journal.c @@ -3669,7 +3669,7 @@ mdj_smoke_check_00(hbool_t human_readable, HDfprintf(stdout, "%s:%d cp = %d.\n", fcn_name, pass, cp++); - /* e-2) ... then use the H5C_mark_pinned_or_protected_entry_dirty() + /* e-2) ... then use the H5C_mark_entry_dirty() * call to mark a variety of protected, pinned, and pinned and * protected entries dirty. Also rename some pinned entries. */ @@ -3683,12 +3683,12 @@ mdj_smoke_check_00(hbool_t human_readable, protect_entry(file_ptr, MICRO_ENTRY_TYPE, 8); protect_entry(file_ptr, MICRO_ENTRY_TYPE, 9); - mark_pinned_or_protected_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 0); - mark_pinned_or_protected_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 1); - mark_pinned_or_protected_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 2); - mark_pinned_or_protected_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 3); - mark_pinned_or_protected_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 6); - mark_pinned_or_protected_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 7); + mark_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 0); + mark_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 1); + mark_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 2); + mark_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 3); + mark_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 6); + mark_entry_dirty(file_ptr, MICRO_ENTRY_TYPE, 7); rename_entry(cache_ptr, MICRO_ENTRY_TYPE, 4, FALSE); rename_entry(cache_ptr, MICRO_ENTRY_TYPE, 5, FALSE); @@ -3814,8 +3814,7 @@ mdj_smoke_check_00(hbool_t human_readable, /* f-2) Now resize a selection of pinned and unpinned entries via - * protect/unprotect pairs, H5C_resize_pinned_entry() and - * H5C_mark_pinned_entry_dirty(). + * protect/unprotect pairs and H5C_resize_pinned_entry(). */ @@ -3847,10 +3846,10 @@ mdj_smoke_check_00(hbool_t human_readable, resize_pinned_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, ((VARIABLE_ENTRY_SIZE / 16) * 10)); - mark_pinned_entry_dirty(file_ptr, VARIABLE_ENTRY_TYPE, 6, TRUE, + resize_pinned_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, ((VARIABLE_ENTRY_SIZE / 16) * 9)); - mark_pinned_entry_dirty(file_ptr, VARIABLE_ENTRY_TYPE, 7, TRUE, + resize_pinned_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, ((VARIABLE_ENTRY_SIZE / 16) * 8)); end_trans(file_ptr, cache_ptr, verbose, (uint64_t)7, "transaction 7.2"); @@ -3912,11 +3911,11 @@ mdj_smoke_check_00(hbool_t human_readable, resize_pinned_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE); rename_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 6, FALSE); - mark_pinned_entry_dirty(file_ptr, VARIABLE_ENTRY_TYPE, 6, TRUE, + resize_pinned_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE); rename_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 7, FALSE); - mark_pinned_entry_dirty(file_ptr, VARIABLE_ENTRY_TYPE, 7, TRUE, + resize_pinned_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE); end_trans(file_ptr, cache_ptr, verbose, (uint64_t)8, "transaction 8.2"); @@ -3980,12 +3979,12 @@ mdj_smoke_check_00(hbool_t human_readable, unpin_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5); rename_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 6, TRUE); - mark_pinned_entry_dirty(file_ptr, VARIABLE_ENTRY_TYPE, 6, TRUE, + resize_pinned_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE); unpin_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6); rename_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 7, TRUE); - mark_pinned_entry_dirty(file_ptr, VARIABLE_ENTRY_TYPE, 7, TRUE, + resize_pinned_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE); unpin_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7); diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 989e857..35e4baa 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -374,11 +374,8 @@ void lock_and_unlock_random_entries(H5C_t * cache_ptr, H5F_t * file_ptr, void lock_and_unlock_random_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int min_idx, int max_idx); void lock_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx); -void mark_pinned_entry_dirty(H5C_t * cache_ptr, H5F_t * file_ptr, - int32_t idx, hbool_t size_changed, size_t new_size); -void mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr, - H5F_t * file_ptr, - int32_t idx); +void mark_entry_dirty(H5C_t * cache_ptr, H5F_t * file_ptr, + int32_t idx); void pin_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx, hbool_t global, hbool_t dirty); void pin_protected_entry(H5C_t * cache_ptr, H5F_t * file_ptr, @@ -2724,7 +2721,7 @@ lock_entry(H5C_t * cache_ptr, /***************************************************************************** - * Function: mark_pinned_entry_dirty() + * Function: mark_entry_dirty() * * Purpose: Mark dirty the entry indicated by the index, * @@ -2735,18 +2732,14 @@ lock_entry(H5C_t * cache_ptr, * Programmer: John Mainzer * 4/14/06 * - * Modifications: - * *****************************************************************************/ void -mark_pinned_entry_dirty(H5C_t * cache_ptr, +mark_entry_dirty(H5C_t * cache_ptr, H5F_t * file_ptr, - int32_t idx, - hbool_t size_changed, - size_t new_size) + int32_t idx) { - const char * fcn_name = "mark_pinned_entry_dirty()"; + const char * fcn_name = "mark_entry_dirty()"; herr_t result; struct datum * entry_ptr; @@ -2765,16 +2758,14 @@ mark_pinned_entry_dirty(H5C_t * cache_ptr, (entry_ptr->ver)++; entry_ptr->dirty = TRUE; - result = H5AC_mark_pinned_entry_dirty( (void *)entry_ptr, - size_changed, - new_size); + result = H5AC_mark_entry_dirty( (void *)entry_ptr); if ( result < 0 ) { nerrors++; if ( verbose ) { HDfprintf(stdout, - "%d:%s: error in H5AC_mark_pinned_entry_dirty().\n", + "%d:%s: error in H5AC_mark_entry_dirty().\n", world_mpi_rank, fcn_name); } } @@ -2786,69 +2777,7 @@ mark_pinned_entry_dirty(H5C_t * cache_ptr, return; -} /* mark_pinned_entry_dirty() */ - - -/***************************************************************************** - * Function: mark_pinned_or_protected_entry_dirty() - * - * Purpose: Use the H5AC_mark_pinned_or_protected_entry_dirty() call to - * mark dirty the entry indicated by the index, - * - * Do nothing if nerrors is non-zero on entry. - * - * Return: void - * - * Programmer: John Mainzer - * 5/18/06 - * - * Modifications: - * - *****************************************************************************/ - -void -mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr, - H5F_t * file_ptr, - int32_t idx) -{ - const char * fcn_name = "mark_pinned_or_protected_entry_dirty()"; - herr_t result; - struct datum * entry_ptr; - - if ( nerrors == 0 ) { - - HDassert( file_ptr ); - HDassert( cache_ptr ); - HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) ); - HDassert( idx < virt_num_data_entries ); - - entry_ptr = &(data[idx]); - - HDassert ( entry_ptr->locked || entry_ptr->global_pinned ); - - (entry_ptr->ver)++; - entry_ptr->dirty = TRUE; - - result = H5AC_mark_pinned_or_protected_entry_dirty( (void *)entry_ptr); - - if ( result < 0 ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: error in %s.\n", - world_mpi_rank, fcn_name, - "H5AC_mark_pinned_or_protected_entry_dirty()"); - } - } - else if ( ! ( entry_ptr->locked ) ) - { - global_dirty_pins++; - } - } - - return; - -} /* mark_pinned_or_protected_entry_dirty() */ +} /* mark_entry_dirty() */ /***************************************************************************** @@ -3773,8 +3702,7 @@ unpin_entry(H5C_t * cache_ptr, if ( dirty ) { - mark_pinned_entry_dirty(cache_ptr, file_ptr, idx, FALSE, - (size_t)0); + mark_entry_dirty(cache_ptr, file_ptr, idx); } @@ -5131,8 +5059,7 @@ smoke_check_4(void) * Function: smoke_check_5() * * Purpose: Similar to smoke check 1, but modified to verify that - * H5AC_mark_pinned_or_protected_entry_dirty() works in - * the parallel case. + * H5AC_mark_entry_dirty() works in the parallel case. * * Return: Success: TRUE * @@ -5269,7 +5196,7 @@ smoke_check_5(void) HDfprintf(stdout, "%d:(mpoped %d)\n", world_mpi_rank, i); fflush(stdout); } - mark_pinned_or_protected_entry_dirty(cache_ptr, file_ptr, i); + mark_entry_dirty(cache_ptr, file_ptr, i); } if ( show_detailed_progress ) @@ -5326,15 +5253,9 @@ smoke_check_5(void) } if ( i % 4 == 0 ) - { - mark_pinned_or_protected_entry_dirty(cache_ptr, - file_ptr, i); - } + mark_entry_dirty(cache_ptr, file_ptr, i); else - { - mark_pinned_entry_dirty(cache_ptr, file_ptr, i, - FALSE, (size_t)0); - } + mark_entry_dirty(cache_ptr, file_ptr, i); if ( i % 8 <= 4 ) { @@ -5458,8 +5379,7 @@ smoke_check_5(void) * * - H5AC_flush() * - H5AC_set() - * - H5AC_mark_pinned_entry_dirty() - * - H5AC_mark_pinned_or_protected_entry_dirty() + * - H5AC_mark_entry_dirty() * H5AC_rename() * - H5AC_pin_protected_entry() * - H5AC_protect() @@ -5506,7 +5426,7 @@ trace_file_check(void) "H5AC_set 0x404 4 16 0x0 4 0\n", "H5AC_set 0x408 6 16 0x0 6 0\n", "H5AC_protect 0x400 2 16 H5AC_WRITE 2 1\n", - "H5AC_mark_pinned_or_protected_entry_dirty 0x400 0\n", + "H5AC_mark_entry_dirty 0x400 0\n", "H5AC_unprotect 0x400 16 2 0 0\n", "H5AC_protect 0x402 2 16 H5AC_WRITE 2 1\n", "H5AC_pin_protected_entry 0x402 0\n", @@ -5516,7 +5436,7 @@ trace_file_check(void) "H5AC_protect 0x404 4 16 H5AC_WRITE 4 1\n", "H5AC_pin_protected_entry 0x404 0\n", "H5AC_unprotect 0x404 16 4 0 0\n", - "H5AC_mark_pinned_entry_dirty 0x404 0 0 0\n", + "H5AC_mark_entry_dirty 0x404 0\n", "H5AC_resize_pinned_entry 0x404 2 0\n", "H5AC_resize_pinned_entry 0x404 4 0\n", "H5AC_unpin_entry 0x404 0\n", @@ -5612,7 +5532,7 @@ trace_file_check(void) insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET); lock_entry(cache_ptr, file_ptr, 0); - mark_pinned_or_protected_entry_dirty(cache_ptr, file_ptr, 0); + mark_entry_dirty(cache_ptr, file_ptr, 0); unlock_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET); lock_entry(cache_ptr, file_ptr, 1); @@ -5625,7 +5545,7 @@ trace_file_check(void) lock_entry(cache_ptr, file_ptr, 2); pin_protected_entry(cache_ptr, file_ptr, 2, TRUE); unlock_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET); - mark_pinned_entry_dirty(cache_ptr, file_ptr, 2, FALSE, 0); + mark_entry_dirty(cache_ptr, file_ptr, 2); resize_entry(cache_ptr, file_ptr, 2, data[2].len / 2); resize_entry(cache_ptr, file_ptr, 2, data[2].len); unpin_entry(cache_ptr, file_ptr, 2, TRUE, FALSE, FALSE); |