diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-27 15:07:42 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-27 15:07:42 (GMT) |
commit | 032766b521a2b22d77059e89a1eb3a76a5d83875 (patch) | |
tree | 0681d291691b47f16bf2f0832c581158e5579bb0 /src | |
parent | 0b761d78c765c902b5ca13c9067878e5097f9afb (diff) | |
download | hdf5-032766b521a2b22d77059e89a1eb3a76a5d83875.zip hdf5-032766b521a2b22d77059e89a1eb3a76a5d83875.tar.gz hdf5-032766b521a2b22d77059e89a1eb3a76a5d83875.tar.bz2 |
[svn-r18171] Description:
Bring r18169 from 'merge_metadata_journaling' branch back to trunk:
Converge changes on metadata_journaling branch and trunk:
- Remove H5F_t* parameter from H5HL_unprotect()
- Remove H5F_t* parameter from H5HL_dirty()
- Remove H5F_t* parameter from H5O_unprotect()
- Bring changes to metadata caching routines back:
- H5AC_pin_protected_entry()
- H5AC_resize_pinned_entry()
- H5AC_unpin_entry()
- H5AC_mark_pinned_entry_dirty()
- H5AC_mark_pinned_or_protected_entry_dirty()
- Revise internal H5C routines to drop H5F_t* and/or H5C_t* as
parameter where possible
- Revise tests to follow internal routine changes
Also, drop file/cache pointer parameter from create/destroy flush
dependency internal cache calls.
Also, other minor changes to speedup the 'cache' test.
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-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
Diffstat (limited to 'src')
-rw-r--r-- | src/H5AC.c | 516 | ||||
-rw-r--r-- | src/H5ACprivate.h | 30 | ||||
-rw-r--r-- | src/H5B2hdr.c | 9 | ||||
-rw-r--r-- | src/H5C.c | 402 | ||||
-rw-r--r-- | src/H5Cprivate.h | 46 | ||||
-rw-r--r-- | src/H5Dint.c | 6 | ||||
-rw-r--r-- | src/H5Dlayout.c | 6 | ||||
-rw-r--r-- | src/H5EA.c | 18 | ||||
-rw-r--r-- | src/H5EAcache.c | 16 | ||||
-rw-r--r-- | src/H5EAhdr.c | 19 | ||||
-rw-r--r-- | src/H5EAint.c | 11 | ||||
-rw-r--r-- | src/H5EApkg.h | 4 | ||||
-rw-r--r-- | src/H5F.c | 2 | ||||
-rw-r--r-- | src/H5FAhdr.c | 20 | ||||
-rw-r--r-- | src/H5FS.c | 14 | ||||
-rw-r--r-- | src/H5FScache.c | 2 | ||||
-rw-r--r-- | src/H5Fsuper.c | 8 | ||||
-rw-r--r-- | src/H5Gnode.c | 4 | ||||
-rw-r--r-- | src/H5Gobj.c | 4 | ||||
-rw-r--r-- | src/H5Groot.c | 2 | ||||
-rw-r--r-- | src/H5Gstab.c | 22 | ||||
-rw-r--r-- | src/H5Gtest.c | 2 | ||||
-rw-r--r-- | src/H5HFhdr.c | 6 | ||||
-rw-r--r-- | src/H5HFiblock.c | 6 | ||||
-rw-r--r-- | src/H5HL.c | 32 | ||||
-rw-r--r-- | src/H5HLcache.c | 14 | ||||
-rw-r--r-- | src/H5HLdbg.c | 2 | ||||
-rw-r--r-- | src/H5HLint.c | 4 | ||||
-rw-r--r-- | src/H5HLpkg.h | 2 | ||||
-rw-r--r-- | src/H5HLprivate.h | 2 | ||||
-rw-r--r-- | src/H5O.c | 11 | ||||
-rw-r--r-- | src/H5Oalloc.c | 2 | ||||
-rw-r--r-- | src/H5Oefl.c | 6 | ||||
-rw-r--r-- | src/H5Omessage.c | 4 | ||||
-rw-r--r-- | src/H5Oprivate.h | 2 | ||||
-rw-r--r-- | src/H5Ztrans.c | 8 |
36 files changed, 474 insertions, 790 deletions
@@ -154,8 +154,7 @@ static herr_t H5AC_log_deleted_entry(H5AC_t * cache_ptr, haddr_t addr, unsigned int flags); -static herr_t H5AC_log_dirtied_entry(H5AC_t * cache_ptr, - H5C_cache_entry_t * entry_ptr, +static herr_t H5AC_log_dirtied_entry(const H5C_cache_entry_t *entry_ptr, haddr_t addr, hbool_t size_changed, size_t new_size); @@ -190,7 +189,7 @@ static herr_t H5AC_receive_and_apply_clean_list(H5F_t * f, hid_t secondary_dxpl_id, H5AC_t * cache_ptr); -static herr_t H5AC_log_renamed_entry(H5AC_t * cache_ptr, +static herr_t H5AC_log_renamed_entry(const H5F_t * f, haddr_t old_addr, haddr_t new_addr); @@ -744,25 +743,6 @@ done: * matzke@llnl.gov * Jul 9 1997 * - * Modifications: - * - * Complete re-design and re-write to support the re-designed - * metadata cache. - * JRM - 5/12/04 - * - * Abstracted the guts of the function to H5C_dest() in H5C.c, - * and then re-wrote the function as a wrapper for H5C_dest(). - * - * JRM - 6/7/04 - * - * Added code to free the auxiliary structure and its - * associated slist if present. - * JRM - 6/28/05 - * - * Added code to close the trace file if it is present. - * - * JRM - 6/8/06 - * *------------------------------------------------------------------------- */ herr_t @@ -796,7 +776,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) #endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ - if(H5C_dest(f, dxpl_id, H5AC_noblock_dxpl_id, f->shared->cache) < 0) + if(H5C_dest(f, dxpl_id, H5AC_noblock_dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache") f->shared->cache = NULL; @@ -845,7 +825,6 @@ H5AC_expunge_entry(H5F_t *f, unsigned flags) { herr_t result; - H5AC_t * cache_ptr = NULL; #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; FILE * trace_file_ptr = NULL; @@ -862,11 +841,13 @@ H5AC_expunge_entry(H5F_t *f, HDassert(type->dest); HDassert(H5F_addr_defined(addr)); - cache_ptr = f->shared->cache; - #if H5AC__TRACE_FILE_ENABLED - /* For the expunge entry call, only the addr, and type id are really - * necessary in the trace file. Write the return value to catch occult +{ + H5AC_t * cache_ptr = f->shared->cache; + + + /* For the expunge entry call, only the addr, and type id are really + * necessary in the trace file. Write the return value to catch occult * errors. */ if ( ( cache_ptr != NULL ) && @@ -877,12 +858,12 @@ H5AC_expunge_entry(H5F_t *f, (unsigned long)addr, (int)(type->id)); } +} #endif /* H5AC__TRACE_FILE_ENABLED */ result = H5C_expunge_entry(f, dxpl_id, H5AC_noblock_dxpl_id, - cache_ptr, type, addr, flags); @@ -960,7 +941,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) #endif /* H5_HAVE_PARALLEL */ /* Flush the cache */ - if(H5C_flush_cache(f, dxpl_id, H5AC_noblock_dxpl_id, f->shared->cache, H5AC__NO_FLAGS_SET) < 0) + if(H5C_flush_cache(f, dxpl_id, H5AC_noblock_dxpl_id, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache.") done: @@ -998,14 +979,12 @@ done: * *------------------------------------------------------------------------- */ - herr_t -H5AC_get_entry_status(H5F_t * f, +H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned * status_ptr) { H5C_t *cache_ptr = f->shared->cache; - herr_t ret_value = SUCCEED; /* Return value */ herr_t result; hbool_t in_cache; hbool_t is_dirty; @@ -1015,6 +994,7 @@ H5AC_get_entry_status(H5F_t * f, hbool_t is_flush_dep_parent; size_t entry_size; unsigned status = 0; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_get_entry_status, FAIL) @@ -1026,7 +1006,7 @@ H5AC_get_entry_status(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.") } - result = H5C_get_entry_status(cache_ptr, addr, &entry_size, &in_cache, + result = H5C_get_entry_status(f, addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, &is_flush_dep_parent, &is_flush_dep_child); @@ -1135,7 +1115,6 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, { herr_t result; H5AC_info_t *info; - H5AC_t *cache; #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ @@ -1182,7 +1161,6 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #endif /* H5AC__TRACE_FILE_ENABLED */ /* Get local copy of this information */ - cache = f->shared->cache; info = (H5AC_info_t *)thing; info->addr = addr; @@ -1209,7 +1187,6 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, result = H5C_insert_entry(f, dxpl_id, H5AC_noblock_dxpl_id, - cache, type, addr, thing, @@ -1274,109 +1251,66 @@ done: * Programmer: John Mainzer * 4/11/06 * - * Modifications: - * - * Added trace file support. JRM -- 6/6/06 - * *------------------------------------------------------------------------- */ herr_t -H5AC_mark_pinned_entry_dirty(H5F_t * f, - void * thing, - hbool_t size_changed, - size_t new_size) +H5AC_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size) { - H5C_t *cache_ptr = f->shared->cache; - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ #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 ( ( f != NULL ) && - ( f->shared != NULL ) && - ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC_mark_pinned_entry_dirty 0x%lx %d %d", + 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 ); - HDassert( thing ); - - if ( ( ((H5AC_info_t *)thing)->is_dirty == FALSE ) && - ( NULL != cache_ptr->aux_ptr) ) { - - H5AC_info_t * entry_ptr; - - HDassert( ( size_changed == TRUE ) || ( size_changed == FALSE ) ); - - entry_ptr = (H5AC_info_t *)thing; - - 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??") - } - - result = H5AC_log_dirtied_entry(cache_ptr, - entry_ptr, - entry_ptr->addr, - size_changed, - new_size); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - if ( result < 0 ) { + 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??") - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5AC_log_dirtied_entry() failed.") - } - } + 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 */ - result = H5C_mark_pinned_entry_dirty(cache_ptr, - thing, - size_changed, - new_size); - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5C_mark_pinned_entry_dirty() failed.") - - } + 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 != NULL ) { - + 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() */ @@ -1394,92 +1328,59 @@ done: * Programmer: John Mainzer * 5/16/06 * - * Modifications: - * - * Added trace file support. JRM -- 6/6/06 - * *------------------------------------------------------------------------- */ herr_t -H5AC_mark_pinned_or_protected_entry_dirty(H5F_t * f, - void * thing) +H5AC_mark_pinned_or_protected_entry_dirty(void *thing) { - H5C_t * cache_ptr = f->shared->cache; -#ifdef H5_HAVE_PARALLEL - H5AC_info_t * info_ptr; -#endif /* H5_HAVE_PARALLEL */ - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ #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_or_protected_entry_dirty, FAIL) + /* Sanity check */ + HDassert(thing); + #if H5AC__TRACE_FILE_ENABLED /* For the mark pinned or protected entry dirty call, only the addr * is really necessary in the trace file. Write the result to catch * occult errors. */ - if ( ( f != NULL ) && - ( f->shared != NULL ) && - ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC_mark_pinned_or_protected_entry_dirty %lx", + if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) + sprintf(trace, "%s %lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); - } #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 ); - HDassert( thing ); - - info_ptr = (H5AC_info_t *)thing; - - if ( ( info_ptr->is_dirty == FALSE ) && - ( ! ( info_ptr->is_protected ) ) && - ( info_ptr->is_pinned ) && - ( NULL != cache_ptr->aux_ptr) ) { - - result = H5AC_log_dirtied_entry(cache_ptr, - info_ptr, - info_ptr->addr, - FALSE, - 0); - - if ( result < 0 ) { + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5AC_log_dirtied_entry() failed.") - } - } + if((!entry_ptr->is_dirty) && (!entry_ptr->is_protected) && + (entry_ptr->is_pinned) && (NULL != cache_ptr->aux_ptr)) { + if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr, FALSE, 0) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") + } /* end if */ +} #endif /* H5_HAVE_PARALLEL */ - result = H5C_mark_pinned_or_protected_entry_dirty(cache_ptr, thing); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5C_mark_pinned_entry_dirty() failed.") - - } + if(H5C_mark_pinned_or_protected_entry_dirty(thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't mark pinned or protected entry dirty") done: - #if H5AC__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + 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_or_protected_entry_dirty() */ @@ -1570,16 +1471,8 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad #ifdef H5_HAVE_PARALLEL if ( NULL != (aux_ptr = f->shared->cache->aux_ptr) ) { - - result = H5AC_log_renamed_entry(f->shared->cache, - old_addr, - new_addr); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ - "H5AC_log_renamed_entry() failed.") - } + if(H5AC_log_renamed_entry(f, old_addr, new_addr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log renamed entry") } #endif /* H5_HAVE_PARALLEL */ @@ -1635,60 +1528,42 @@ done: * Programmer: John Mainzer * 4/27/06 * - * Modifications: - * - * Added trace file support. 6/6/06 - * *------------------------------------------------------------------------- */ herr_t -H5AC_pin_protected_entry(H5F_t * f, - void * thing) +H5AC_pin_protected_entry(void *thing) { - H5C_t *cache_ptr = f->shared->cache; - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ #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_pin_protected_entry, FAIL) + /* Sanity check */ + HDassert(thing); + #if H5AC__TRACE_FILE_ENABLED /* For the pin protected entry call, only the addr is really necessary * in the trace file. Also write the result to catch occult errors. */ - if ( ( f != NULL ) && - ( f->shared != NULL ) && - ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC_pin_protected_entry %lx", + if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) + sprintf(trace, "%s %lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); - } #endif /* H5AC__TRACE_FILE_ENABLED */ - result = H5C_pin_protected_entry(cache_ptr, thing); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, \ - "H5C_pin_protected_entry() failed.") - } + if(H5C_pin_protected_entry(thing) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "can't pin entry") done: - #if H5AC__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + 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_pin_protected_entry() */ @@ -1706,9 +1581,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_create_flush_dependency(H5F_t * f, void * parent_thing, void * child_thing) +H5AC_create_flush_dependency(void * parent_thing, void * child_thing) { - H5C_t *cache_ptr = f->shared->cache; #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; FILE * trace_file_ptr = NULL; @@ -1718,13 +1592,12 @@ H5AC_create_flush_dependency(H5F_t * f, void * parent_thing, void * child_thing) FUNC_ENTER_NOAPI(H5AC_create_flush_dependency, FAIL) /* Sanity check */ - HDassert(cache_ptr); HDassert(parent_thing); HDassert(child_thing); #if H5AC__TRACE_FILE_ENABLED - if ( ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { + if((H5C_get_trace_file_ptr_from_entry(parent_thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) sprintf(trace, "%s %lx %lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)parent_thing)->addr), @@ -1732,7 +1605,7 @@ H5AC_create_flush_dependency(H5F_t * f, void * parent_thing, void * child_thing) } /* end if */ #endif /* H5AC__TRACE_FILE_ENABLED */ - if(H5C_create_flush_dependency(cache_ptr, parent_thing, child_thing) < 0) + if(H5C_create_flush_dependency(parent_thing, child_thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "H5C_create_flush_dependency() failed.") done: @@ -1891,7 +1764,6 @@ H5AC_protect(H5F_t *f, thing = H5C_protect(f, dxpl_id, H5AC_noblock_dxpl_id, - f->shared->cache, type, addr, udata1, @@ -1941,104 +1813,65 @@ done: * Programmer: John Mainzer * 7/5/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t -H5AC_resize_pinned_entry(H5F_t * f, - void * thing, - size_t new_size) +H5AC_resize_pinned_entry(void *thing, size_t new_size) { - H5C_t *cache_ptr = f->shared->cache; - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ #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_resize_pinned_entry, FAIL) + /* Sanity check */ + HDassert(thing); + #if H5AC__TRACE_FILE_ENABLED /* For the resize pinned entry call, only the addr, and new_size are * really necessary in the trace file. Write the result to catch * occult errors. */ - if ( ( f != NULL ) && - ( f->shared != NULL ) && - ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC_resize_pinned_entry 0x%lx %d", + if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) + sprintf(trace, "%s 0x%lx %d", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr), (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 ); - HDassert( thing ); - - if ( ( ((H5AC_info_t *)thing)->is_dirty == FALSE ) && - ( NULL != cache_ptr->aux_ptr) ) { - - H5AC_info_t * entry_ptr; - - entry_ptr = (H5AC_info_t *)thing; - - if ( ! ( entry_ptr->is_pinned ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "Entry isn't pinned??") - } - - if ( entry_ptr->is_protected ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "Entry is protected??") - } - - result = H5AC_log_dirtied_entry(cache_ptr, - entry_ptr, - entry_ptr->addr, - TRUE, - new_size); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - if ( result < 0 ) { + if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) { + /* Check for usage errors */ + if(!entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry isn't pinned??") + if(entry_ptr->is_protected) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry is protected??") - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5AC_log_dirtied_entry() failed.") - } - } + if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr, TRUE, new_size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") + } /* end if */ +} #endif /* H5_HAVE_PARALLEL */ - result = H5C_resize_pinned_entry(cache_ptr, - thing, - new_size); - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "H5C_resize_pinned_entry() failed.") - - } + if(H5C_resize_pinned_entry(thing, new_size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "can't resize entry") done: - #if H5AC__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + 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_resize_pinned_entry() */ @@ -2053,59 +1886,42 @@ done: * Programmer: John Mainzer * 4/11/06 * - * Modifications: - * - * Added code supporting the trace file. JRM -- 6/7/06 - * *------------------------------------------------------------------------- */ herr_t -H5AC_unpin_entry(H5F_t * f, - void * thing) +H5AC_unpin_entry(void * thing) { - H5C_t *cache_ptr = f->shared->cache; - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ #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_unpin_entry, FAIL) + /* Sanity check */ + HDassert(thing); + #if H5AC__TRACE_FILE_ENABLED /* For the unpin entry call, only the addr is really necessary * in the trace file. Also write the result to catch occult errors. */ - if ( ( f != NULL ) && - ( f->shared != NULL ) && - ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC_unpin_entry %lx", + if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) + sprintf(trace, "%s %lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); - } #endif /* H5AC__TRACE_FILE_ENABLED */ - result = H5C_unpin_entry(cache_ptr, thing); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "H5C_unpin_entry() failed.") - } + if(H5C_unpin_entry(thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "can't unpin entry") done: - #if H5AC__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + 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_unpin_entry() */ @@ -2122,9 +1938,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_destroy_flush_dependency(H5F_t * f, void * parent_thing, void * child_thing) +H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing) { - H5C_t *cache_ptr = f->shared->cache; #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; FILE * trace_file_ptr = NULL; @@ -2134,13 +1949,12 @@ H5AC_destroy_flush_dependency(H5F_t * f, void * parent_thing, void * child_thing FUNC_ENTER_NOAPI(H5AC_destroy_flush_dependency, FAIL) /* Sanity check */ - HDassert(cache_ptr); HDassert(parent_thing); HDassert(child_thing); #if H5AC__TRACE_FILE_ENABLED - if ( ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { + if((H5C_get_trace_file_ptr_from_entry(parent_thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) sprintf(trace, "%s %lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)parent_thing)->addr), @@ -2148,7 +1962,7 @@ H5AC_destroy_flush_dependency(H5F_t * f, void * parent_thing, void * child_thing } /* end if */ #endif /* H5AC__TRACE_FILE_ENABLED */ - if(H5C_destroy_flush_dependency(cache_ptr, parent_thing, child_thing) < 0) + if(H5C_destroy_flush_dependency(parent_thing, child_thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "H5C_destroy_flush_dependency() failed.") done: @@ -2331,18 +2145,8 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #ifdef H5_HAVE_PARALLEL if ( ( dirtied ) && ( ((H5AC_info_t *)thing)->is_dirty == FALSE ) && ( NULL != (aux_ptr = f->shared->cache->aux_ptr) ) ) { - - result = H5AC_log_dirtied_entry(f->shared->cache, - (H5AC_info_t *)thing, - addr, - size_changed, - new_size); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ - "H5AC_log_dirtied_entry() failed.") - } + if(H5AC_log_dirtied_entry((H5AC_info_t *)thing, addr, size_changed, new_size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log dirtied entry") } if ( ( (flags & H5C__DELETED_FLAG) != 0 ) && @@ -2365,7 +2169,6 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, result = H5C_unprotect(f, dxpl_id, H5AC_noblock_dxpl_id, - f->shared->cache, type, addr, thing, @@ -2541,7 +2344,7 @@ done: */ herr_t -H5AC_get_cache_auto_resize_config(H5AC_t * cache_ptr, +H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, H5AC_cache_config_t *config_ptr) { herr_t result; @@ -2573,7 +2376,7 @@ H5AC_get_cache_auto_resize_config(H5AC_t * cache_ptr, } - result = H5C_get_cache_auto_resize_config((H5C_t *)cache_ptr, + result = H5C_get_cache_auto_resize_config((const H5C_t *)cache_ptr, &internal_config); if ( result < 0 ) { @@ -2582,7 +2385,7 @@ H5AC_get_cache_auto_resize_config(H5AC_t * cache_ptr, "H5C_get_cache_auto_resize_config() failed.") } - result = H5C_get_evictions_enabled((H5C_t *)cache_ptr, &evictions_enabled); + result = H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled); if ( result < 0 ) { @@ -2818,10 +2621,9 @@ done: */ herr_t -H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, +H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr) { - /* const char * fcn_name = "H5AC_set_cache_auto_resize_config"; */ herr_t result; herr_t ret_value = SUCCEED; /* Return value */ H5C_auto_size_ctl_t internal_config; @@ -2832,6 +2634,8 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, FUNC_ENTER_NOAPI(H5AC_set_cache_auto_resize_config, FAIL) + HDassert( cache_ptr ); + #if H5AC__TRACE_FILE_ENABLED /* Make note of the new configuration. Don't look up the trace file * pointer, as that may change before we use it. @@ -2922,30 +2726,14 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, } } - if ( H5AC_ext_config_2_int_config(config_ptr, &internal_config) != - SUCCEED ) { + if(H5AC_ext_config_2_int_config(config_ptr, &internal_config) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_ext_config_2_int_config() failed.") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5AC_ext_config_2_int_config() failed.") - } + if(H5C_set_cache_auto_resize_config(cache_ptr, &internal_config) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed.") - result = H5C_set_cache_auto_resize_config((H5C_t *)cache_ptr, - &internal_config); - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_set_cache_auto_resize_config() failed.") - } - - - result = H5C_set_evictions_enabled((H5C_t *)cache_ptr, - config_ptr->evictions_enabled); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_set_evictions_enabled() failed.") - } + if(H5C_set_evictions_enabled(cache_ptr, config_ptr->evictions_enabled) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed.") #ifdef H5_HAVE_PARALLEL if ( cache_ptr->aux_ptr != NULL ) { @@ -3817,26 +3605,28 @@ done: * * Programmer: John Mainzer, 6/29/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_log_dirtied_entry(H5AC_t * cache_ptr, - H5AC_info_t * entry_ptr, +H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, haddr_t addr, hbool_t size_changed, size_t new_size) { - herr_t ret_value = SUCCEED; /* Return value */ size_t entry_size; - H5AC_aux_t * aux_ptr = NULL; - H5AC_slist_entry_t * slist_entry_ptr = NULL; + H5AC_t * cache_ptr; + H5AC_aux_t * aux_ptr; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_log_dirtied_entry, FAIL) + HDassert( entry_ptr != NULL ); + HDassert( entry_ptr->addr == addr ); + HDassert( entry_ptr->is_dirty == FALSE ); + + cache_ptr = entry_ptr->cache_ptr; + HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -3845,10 +3635,6 @@ H5AC_log_dirtied_entry(H5AC_t * cache_ptr, HDassert( aux_ptr != NULL ); HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( entry_ptr != NULL ); - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->is_dirty == FALSE ); - if ( size_changed ) { entry_size = new_size; @@ -3859,6 +3645,7 @@ H5AC_log_dirtied_entry(H5AC_t * cache_ptr, } if ( aux_ptr->mpi_rank == 0 ) { + H5AC_slist_entry_t * slist_entry_ptr; HDassert( aux_ptr->d_slist_ptr != NULL ); HDassert( aux_ptr->c_slist_ptr != NULL ); @@ -4266,10 +4053,11 @@ done: #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_log_renamed_entry(H5AC_t * cache_ptr, +H5AC_log_renamed_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr) { + H5AC_t * cache_ptr; herr_t ret_value = SUCCEED; /* Return value */ hbool_t entry_in_cache; hbool_t entry_dirty; @@ -4279,7 +4067,12 @@ H5AC_log_renamed_entry(H5AC_t * cache_ptr, FUNC_ENTER_NOAPI(H5AC_log_renamed_entry, FAIL) - HDassert( cache_ptr != NULL ); + HDassert( f ); + HDassert( f->shared ); + + cache_ptr = (H5AC_t *)f->shared->cache; + + HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); aux_ptr = cache_ptr->aux_ptr; @@ -4288,7 +4081,7 @@ H5AC_log_renamed_entry(H5AC_t * cache_ptr, HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); /* get entry status, size, etc here */ - if ( H5C_get_entry_status(cache_ptr, old_addr, &entry_size, &entry_in_cache, + if ( H5C_get_entry_status(f, old_addr, &entry_size, &entry_in_cache, &entry_dirty, NULL, NULL, NULL, NULL) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get entry status.") @@ -4800,7 +4593,6 @@ H5AC_flush_entries(H5F_t *f) status = H5C_flush_cache(f, H5AC_noblock_dxpl_id, H5AC_noblock_dxpl_id, - f->shared->cache, H5AC__NO_FLAGS_SET); aux_ptr->write_permitted = FALSE; diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index cdb547e..85ff692 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -324,33 +324,25 @@ extern hid_t H5AC_ind_dxpl_id; H5_DLL herr_t H5AC_init(void); H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5AC_get_entry_status(H5F_t * f, haddr_t addr, +H5_DLL herr_t H5AC_get_entry_status(const H5F_t * f, haddr_t addr, unsigned * status_ptr); H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags); -H5_DLL herr_t H5AC_pin_protected_entry(H5F_t * f, void * thing); -H5_DLL herr_t H5AC_create_flush_dependency(H5F_t *f, void *parent_thing, - void *child_thing); +H5_DLL herr_t H5AC_pin_protected_entry(void *thing); +H5_DLL herr_t H5AC_create_flush_dependency(void *parent_thing, void *child_thing); H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, const void *udata1, void *udata2, H5AC_protect_t rw); -H5_DLL herr_t H5AC_resize_pinned_entry(H5F_t * f, - void * thing, - size_t new_size); -H5_DLL herr_t H5AC_unpin_entry(H5F_t * f, - void * thing); -H5_DLL herr_t H5AC_destroy_flush_dependency(H5F_t *f, void *parent_thing, - void *child_thing); +H5_DLL herr_t H5AC_resize_pinned_entry(void *thing, size_t new_size); +H5_DLL herr_t H5AC_unpin_entry(void *thing); +H5_DLL herr_t H5AC_destroy_flush_dependency(void *parent_thing, void *child_thing); H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5AC_mark_pinned_entry_dirty(H5F_t * f, - void * thing, - hbool_t size_changed, - size_t new_size); -H5_DLL herr_t H5AC_mark_pinned_or_protected_entry_dirty(H5F_t * f, - void * thing); +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_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr); @@ -364,7 +356,7 @@ H5_DLL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr, void (* write_done)(void)); H5_DLL herr_t H5AC_stats(const H5F_t *f); -H5_DLL herr_t H5AC_get_cache_auto_resize_config(H5AC_t * cache_ptr, +H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_get_cache_size(H5AC_t * cache_ptr, @@ -378,7 +370,7 @@ H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t * cache_ptr, H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr); -H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, +H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t * config_ptr); diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index f1d5d84..696eb89 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -350,11 +350,10 @@ H5B2_hdr_incr(H5B2_hdr_t *hdr) /* Sanity checks */ HDassert(hdr); - HDassert(hdr->f); /* Mark header as un-evictable when a B-tree node is depending on it */ if(hdr->rc == 0) - if(H5AC_pin_protected_entry(hdr->f, hdr) < 0) + if(H5AC_pin_protected_entry(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTPIN, FAIL, "unable to pin v2 B-tree header") /* Increment reference count on B-tree header */ @@ -387,7 +386,6 @@ H5B2_hdr_decr(H5B2_hdr_t *hdr) /* Sanity check */ HDassert(hdr); - HDassert(hdr->f); HDassert(hdr->rc > 0); /* Decrement reference count on B-tree header */ @@ -395,7 +393,7 @@ H5B2_hdr_decr(H5B2_hdr_t *hdr) /* Mark header as evictable again when no nodes depend on it */ if(hdr->rc == 0) - if(H5AC_unpin_entry(hdr->f, hdr) < 0) + if(H5AC_unpin_entry(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPIN, FAIL, "unable to unpin v2 B-tree header") done: @@ -482,10 +480,9 @@ H5B2_hdr_dirty(H5B2_hdr_t *hdr) /* Sanity check */ HDassert(hdr); - HDassert(hdr->f); /* Mark B-tree header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(hdr->f, hdr) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTMARKDIRTY, FAIL, "unable to mark v2 B-tree header as dirty") done: @@ -3439,9 +3439,9 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, herr_t H5C_dest(H5F_t * f, hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - H5C_t * cache_ptr) + hid_t secondary_dxpl_id) { + H5C_t * cache_ptr = f->shared->cache; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_dest, FAIL) @@ -3463,7 +3463,7 @@ H5C_dest(H5F_t * f, cache_ptr->magic = 0; - (void)H5FL_FREE(H5C_t, cache_ptr); + cache_ptr = H5FL_FREE(H5C_t, cache_ptr); done: FUNC_LEAVE_NOAPI(ret_value) @@ -3489,32 +3489,33 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5C_expunge_entry(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, unsigned flags) { + H5C_t * cache_ptr; herr_t result; hbool_t first_flush = TRUE; - hbool_t free_file_space; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_expunge_entry, FAIL) - free_file_space = ( (flags & H5C__FREE_FILE_SPACE_FLAG) != 0 ); + HDassert( f ); + HDassert( f->shared ); + + cache_ptr = f->shared->cache; - HDassert( H5F_addr_defined(addr) ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); HDassert( type->clear ); HDassert( type->dest ); + HDassert( H5F_addr_defined(addr) ); #if H5C_DO_EXTREME_SANITY_CHECKS if ( H5C_validate_lru_list(cache_ptr) < 0 ) { @@ -3548,15 +3549,12 @@ H5C_expunge_entry(H5F_t * f, } /* Pass along 'free file space' flag to cache client */ - - entry_ptr->free_file_space_on_destroy = free_file_space; - + entry_ptr->free_file_space_on_destroy = ( (flags & H5C__FREE_FILE_SPACE_FLAG) != 0 ); /* If we get this far, call H5C_flush_single_entry() with the * H5C__FLUSH_INVALIDATE_FLAG and the H5C__FLUSH_CLEAR_ONLY_FLAG. * This will clear the entry, and then delete it from the cache. */ - result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, @@ -3690,9 +3688,9 @@ herr_t H5C_flush_cache(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, unsigned flags) { + H5C_t * cache_ptr = f->shared->cache; herr_t status; herr_t ret_value = SUCCEED; hbool_t destroy; @@ -4244,8 +4242,7 @@ H5C_flush_to_min_clean(H5F_t * f, /* Flush the marked entries */ result = H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_IGNORE_PROTECTED_FLAG); + H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG); if ( result < 0 ) { @@ -4301,7 +4298,7 @@ done: */ herr_t -H5C_get_cache_auto_resize_config(H5C_t * cache_ptr, +H5C_get_cache_auto_resize_config(const H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -4483,7 +4480,7 @@ done: */ herr_t -H5C_get_entry_status(H5C_t * cache_ptr, +H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t * size_ptr, hbool_t * in_cache_ptr, @@ -4493,11 +4490,17 @@ H5C_get_entry_status(H5C_t * cache_ptr, hbool_t * is_flush_dep_parent_ptr, hbool_t * is_flush_dep_child_ptr) { + H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_get_entry_status, FAIL) + HDassert( f ); + HDassert( f->shared ); + + cache_ptr = f->shared->cache; + HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( H5F_addr_defined(addr) ); @@ -4581,7 +4584,7 @@ done: */ herr_t -H5C_get_evictions_enabled(H5C_t * cache_ptr, +H5C_get_evictions_enabled(const H5C_t * cache_ptr, hbool_t * evictions_enabled_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -4622,38 +4625,55 @@ done: * Programmer: John Mainzer * 1/20/06 * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t -H5C_get_trace_file_ptr(H5C_t * cache_ptr, - FILE ** trace_file_ptr_ptr) +H5C_get_trace_file_ptr(const H5C_t *cache_ptr, FILE **trace_file_ptr_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_NOAPI_NOFUNC(H5C_get_trace_file_ptr) - FUNC_ENTER_NOAPI(H5C_get_trace_file_ptr, FAIL) - - /* This would normally be an assert, but we need to use an HGOTO_ERROR - * call to shut up the compiler. - */ - if ( ( ! cache_ptr ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { + /* Sanity checks */ + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(trace_file_ptr_ptr); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr") - } + *trace_file_ptr_ptr = cache_ptr->trace_file_ptr; - if ( trace_file_ptr_ptr == NULL ) { + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5C_get_trace_file_ptr() */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL trace_file_ptr_ptr") - } + +/*------------------------------------------------------------------------- + * Function: H5C_get_trace_file_ptr_from_entry + * + * Purpose: Get the trace_file_ptr field from the cache, via an entry. + * + * This field will either be NULL (which indicates that trace + * file logging is turned off), or contain a pointer to the + * open file to which trace file data is to be written. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 6/9/08 + * + *------------------------------------------------------------------------- + */ +herr_t +H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, + FILE **trace_file_ptr_ptr) +{ + FUNC_ENTER_NOAPI_NOFUNC(H5C_get_trace_file_ptr_from_entry) - *trace_file_ptr_ptr = cache_ptr->trace_file_ptr; + /* Sanity checks */ + HDassert(entry_ptr); + HDassert(entry_ptr->cache_ptr); -done: - FUNC_LEAVE_NOAPI(ret_value) + /* Go get the trace file pointer for the cache */ + H5C_get_trace_file_ptr(entry_ptr->cache_ptr, trace_file_ptr_ptr); -} /* H5C_get_trace_file_ptr() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5C_get_trace_file_ptr_from_entry() */ /*------------------------------------------------------------------------- @@ -4768,12 +4788,12 @@ herr_t H5C_insert_entry(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, void * thing, unsigned int flags) { + H5C_t * cache_ptr; herr_t result; hbool_t first_flush = TRUE; hbool_t insert_pinned; @@ -4787,6 +4807,11 @@ H5C_insert_entry(H5F_t * f, FUNC_ENTER_NOAPI(H5C_insert_entry, FAIL) + HDassert( f ); + HDassert( f->shared ); + + cache_ptr = f->shared->cache; + HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); @@ -4839,6 +4864,7 @@ H5C_insert_entry(H5F_t * f, #ifndef NDEBUG entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; #endif /* NDEBUG */ + entry_ptr->cache_ptr = cache_ptr; entry_ptr->addr = addr; entry_ptr->type = type; @@ -5372,59 +5398,31 @@ done: * Programmer: John Mainzer * 3/22/06 * - * Modifications: - * - * Added code to do a flash cache size increase if - * appropriate. - * JRM -- 1/11/08 - * - * - * Added code to update the clean_index_size and - * dirty_index_size fields of H5C_t in cases where the - * the entry was clean on protect, was marked dirty in - * this call, and did not change its size. Do this via - * a call to H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(). - * - * If the size changed, this case is already dealt with by - * by the pre-existing call to - * H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(). - * - * JRM -- 11/5/08 - * *------------------------------------------------------------------------- */ herr_t -H5C_mark_pinned_entry_dirty(H5C_t * cache_ptr, - void * thing, - hbool_t size_changed, - size_t new_size) +H5C_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size) { - herr_t ret_value = SUCCEED; /* Return value */ - herr_t result; + H5C_t * cache_ptr; + H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; hbool_t was_clean; size_t size_increase; - H5C_cache_entry_t * entry_ptr; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_mark_pinned_entry_dirty, FAIL) - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( thing ); - HDassert( ( size_changed == TRUE ) || ( size_changed == FALSE ) ); - - entry_ptr = (H5C_cache_entry_t *)thing; - - if ( ! ( entry_ptr->is_pinned ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "Entry isn't pinned??") - } - - if ( entry_ptr->is_protected ) { + /* 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); - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "Entry is protected??") - } + /* 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??") /* make note of whether the entry was dirty to begin with */ was_clean = ! ( entry_ptr->is_dirty ); @@ -5443,17 +5441,9 @@ H5C_mark_pinned_entry_dirty(H5C_t * cache_ptr, 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.") - } + 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") } } } @@ -5494,9 +5484,7 @@ H5C_mark_pinned_entry_dirty(H5C_t * cache_ptr, H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_mark_pinned_entry_dirty() */ @@ -5521,16 +5509,6 @@ done: * Programmer: John Mainzer * 5/15/06 * - * Modifications: - * - * JRM -- 3/29/07 - * Added sanity check to verify that the pinned entry - * is not protected read only. - * - * This sanity check is commented out for now -- uncomment - * it once we deal with the problem of entries being protected - * read only, and then dirtied. - * * JRM -- 11/5/08 * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY() to * update the new clean_index_size and dirty_index_size @@ -5540,20 +5518,20 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr, - void * thing) +H5C_mark_pinned_or_protected_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 */ - hbool_t was_pinned_unprotected_and_clean; - H5C_cache_entry_t * entry_ptr; FUNC_ENTER_NOAPI(H5C_mark_pinned_or_protected_entry_dirty, FAIL) - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( thing ); - - entry_ptr = (H5C_cache_entry_t *)thing; + /* 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); if ( entry_ptr->is_protected ) { #if 0 /* JRM - uncomment this when possible */ @@ -5563,6 +5541,7 @@ H5C_mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr, entry_ptr->dirtied = TRUE; } else if ( entry_ptr->is_pinned ) { + hbool_t was_pinned_unprotected_and_clean; was_pinned_unprotected_and_clean = ! ( entry_ptr->is_dirty ); @@ -5588,9 +5567,7 @@ H5C_mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr, } done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_mark_pinned_or_protected_entry_dirty() */ @@ -5810,64 +5787,33 @@ done: * Programmer: John Mainzer * 7/5/06 * - * Modifications: - * - * Added code to apply a flash cache size increment if - * appropriate. - * JRM -- 1/11/08 - * - * Added code to update the clean_index_size and - * dirty_index_size fields of H5C_t in cases where the - * the entry was clean prior to this call, was marked dirty, - * and did not change its size. Do this via a call to - * H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(). - * - * If the size changed, this case is already dealt with by - * by the pre-existing call to - * H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(). - * - * JRM -- 11/5/08 - * - * *------------------------------------------------------------------------- */ herr_t -H5C_resize_pinned_entry(H5C_t * cache_ptr, - void * thing, - size_t new_size) +H5C_resize_pinned_entry(void *thing, size_t new_size) { - /* const char * fcn_name = "H5C_resize_pinned_entry()"; */ - herr_t ret_value = SUCCEED; /* Return value */ - herr_t result; - hbool_t was_clean; - H5C_cache_entry_t * entry_ptr; + H5C_t * cache_ptr; + H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; size_t size_increase; + hbool_t was_clean; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_resize_pinned_entry, FAIL) - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( thing ); - - entry_ptr = (H5C_cache_entry_t *)thing; - - if ( new_size <= 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "New size is non-positive.") - } - - if ( ! ( entry_ptr->is_pinned ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "Entry isn't pinned??") - } - - if ( entry_ptr->is_protected ) { + /* 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); - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "Entry is protected??") - } + /* Check for usage errors */ + if(new_size <= 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "New size is non-positive.") + if(!entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry isn't pinned??") + if(entry_ptr->is_protected) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry is protected??") /* make note of whether the entry was clean to begin with */ was_clean = ! ( entry_ptr->is_dirty ); @@ -5890,15 +5836,11 @@ H5C_resize_pinned_entry(H5C_t * cache_ptr, 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.") - } + 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") } } } @@ -5940,9 +5882,7 @@ H5C_resize_pinned_entry(H5C_t * cache_ptr, H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_resize_pinned_entry() */ @@ -6007,38 +5947,23 @@ done: * Programmer: John Mainzer * 4/26/06 * - * Modifications: - * - * JRM -- 4/26/06 - * Modified routine to allow it to operate on protected - * entries. - * - * JRM -- 2/16/07 - * Added conditional compile to avoid unused parameter - * warning in production compile. - * - * JRM -- 4/4/07 - * Fixed typo -- canged macro call to - * H5C__UPDATE_STATS_FOR_UNPIN to call to - * H5C__UPDATE_STATS_FOR_PIN. - * *------------------------------------------------------------------------- */ herr_t -H5C_pin_protected_entry(H5C_t * cache_ptr, - void * thing) +H5C_pin_protected_entry(void *thing) { - H5C_cache_entry_t * entry_ptr; /* Pointer to entry to pin */ + H5C_t * cache_ptr; + H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; /* Pointer to entry to pin */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_pin_protected_entry, FAIL) - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( thing ); - entry_ptr = (H5C_cache_entry_t *)thing; - HDassert( entry_ptr ); - HDassert( H5F_addr_defined(entry_ptr->addr) ); + /* 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); /* Only protected entries can be pinned */ if(!entry_ptr->is_protected) @@ -6160,7 +6085,6 @@ void * H5C_protect(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, const void * udata1, @@ -6168,6 +6092,7 @@ H5C_protect(H5F_t * f, unsigned flags) { /* const char * fcn_name = "H5C_protect()"; */ + H5C_t * cache_ptr; hbool_t hit; hbool_t first_flush; hbool_t have_write_permitted = FALSE; @@ -6182,6 +6107,9 @@ H5C_protect(H5F_t * f, FUNC_ENTER_NOAPI(H5C_protect, NULL) /* check args */ + HDassert( f ); + HDassert( f->shared ); + cache_ptr = f->shared->cache; HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); @@ -6609,14 +6537,13 @@ done: */ herr_t -H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, +H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr) { - /* const char *fcn_name = "H5C_set_cache_auto_resize_config()"; */ - herr_t ret_value = SUCCEED; /* Return value */ herr_t result; size_t new_max_cache_size; size_t new_min_clean_size; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_set_cache_auto_resize_config, FAIL) @@ -6892,7 +6819,7 @@ done: */ herr_t -H5C_set_evictions_enabled(H5C_t * cache_ptr, +H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) { herr_t ret_value = SUCCEED; /* Return value */ @@ -7756,20 +7683,19 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_unpin_entry(H5C_t * cache_ptr, - void * thing) +H5C_unpin_entry(void *thing) { - H5C_cache_entry_t * entry_ptr; /* Pointer to entry to unpin */ + H5C_t * cache_ptr; + H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; /* Pointer to entry to unpin */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_unpin_entry, FAIL) - /* Sanity checking */ - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( thing ); - entry_ptr = (H5C_cache_entry_t *)thing; - HDassert( entry_ptr ); + /* Sanity check */ + HDassert(entry_ptr); + cache_ptr = entry_ptr->cache_ptr; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); /* Unpin the entry */ if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, TRUE) < 0) @@ -7900,13 +7826,13 @@ herr_t H5C_unprotect(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, void * thing, unsigned int flags, size_t new_size) { + H5C_t * cache_ptr; hbool_t deleted; hbool_t dirtied; hbool_t set_flush_marker; @@ -7942,6 +7868,11 @@ H5C_unprotect(H5F_t * f, dirtied |= size_changed; + HDassert( f ); + HDassert( f->shared ); + + cache_ptr = f->shared->cache; + HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); @@ -8665,16 +8596,10 @@ H5C_adjust_flush_dependency_rc(H5C_cache_entry_t * cache_entry, * *------------------------------------------------------------------------- */ -#ifndef NDEBUG -herr_t -H5C_create_flush_dependency(H5C_t * cache_ptr, void * parent_thing, - void * child_thing) -#else herr_t -H5C_create_flush_dependency(H5C_t UNUSED * cache_ptr, void * parent_thing, - void * child_thing) -#endif +H5C_create_flush_dependency(void * parent_thing, void * child_thing) { + H5C_t * cache_ptr; H5C_cache_entry_t * parent_entry = (H5C_cache_entry_t *)parent_thing; /* Ptr to parent thing's entry */ H5C_cache_entry_t * child_entry = (H5C_cache_entry_t *)child_thing; /* Ptr to child thing's entry */ #ifndef NDEBUG @@ -8685,8 +8610,6 @@ H5C_create_flush_dependency(H5C_t UNUSED * cache_ptr, void * parent_thing, FUNC_ENTER_NOAPI(H5C_create_flush_dependency, FAIL) /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(parent_entry); HDassert(parent_entry->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(parent_entry->flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS); @@ -8695,6 +8618,10 @@ H5C_create_flush_dependency(H5C_t UNUSED * cache_ptr, void * parent_thing, HDassert(child_entry->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(H5F_addr_defined(child_entry->addr)); HDassert(child_entry->flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS); + cache_ptr = parent_entry->cache_ptr; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr == child_entry->cache_ptr); /* More sanity checks */ if(child_entry == parent_entry) @@ -8783,9 +8710,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_destroy_flush_dependency(H5C_t * cache_ptr, void *parent_thing, - void * child_thing) +H5C_destroy_flush_dependency(void *parent_thing, void * child_thing) { + H5C_t * cache_ptr; H5C_cache_entry_t * parent_entry = (H5C_cache_entry_t *)parent_thing; /* Ptr to parent entry */ H5C_cache_entry_t * child_entry = (H5C_cache_entry_t *)child_thing; /* Ptr to child entry */ #ifndef NDEBUG @@ -8796,8 +8723,6 @@ H5C_destroy_flush_dependency(H5C_t * cache_ptr, void *parent_thing, FUNC_ENTER_NOAPI(H5C_destroy_flush_dependency, FAIL) /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(parent_entry); HDassert(parent_entry->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(H5F_addr_defined(parent_entry->addr)); @@ -8806,6 +8731,10 @@ H5C_destroy_flush_dependency(H5C_t * cache_ptr, void *parent_thing, HDassert(child_entry->flush_dep_parent != child_entry); HDassert(child_entry->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(H5F_addr_defined(child_entry->addr)); + cache_ptr = parent_entry->cache_ptr; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr == child_entry->cache_ptr); /* Usage checks */ if(!parent_entry->is_pinned) @@ -11170,17 +11099,18 @@ H5C_flush_single_entry(H5F_t * f, /* Clear the dirty flag only, if requested */ if ( clear_only ) { -#ifndef NDEBUG if ( destroy ) { - /* we are about to call the clear callback with the +#ifndef NDEBUG + /* we are about to call the clear callback with the * destroy flag set -- this will result in *entry_ptr * being freed. Set the magic field to bad magic * so we can detect a freed cache entry if we see * one. */ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; - } #endif /* NDEBUG */ + entry_ptr->cache_ptr = NULL; + } /* Call the callback routine to clear all dirty flags for object */ if ( (entry_ptr->type->clear)(f, entry_ptr, destroy_entry) < 0 ) { @@ -11198,17 +11128,18 @@ H5C_flush_single_entry(H5F_t * f, } #endif /* H5C_DO_SANITY_CHECKS */ -#ifndef NDEBUG if ( destroy ) { - /* we are about to call the flush callback with the +#ifndef NDEBUG + /* we are about to call the flush callback with the * destroy flag set -- this will result in *entry_ptr * being freed. Set the magic field to bad magic * so we can detect a freed cache entry if we see * one. */ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; - } #endif /* NDEBUG */ + entry_ptr->cache_ptr = NULL; + } /* Only block for all the processes on the first piece of metadata */ @@ -11491,6 +11422,7 @@ H5C_load_entry(H5F_t * f, #ifndef NDEBUG entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; #endif /* NDEBUG */ + entry_ptr->cache_ptr = f->shared->cache; entry_ptr->addr = addr; entry_ptr->type = type; entry_ptr->is_protected = FALSE; diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 5c7fe9f..dc8d7b1 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -535,6 +535,7 @@ typedef struct H5C_cache_entry_t #ifndef NDEBUG uint32_t magic; #endif /* NDEBUG */ + H5C_t * cache_ptr; haddr_t addr; size_t size; const H5C_class_t * type; @@ -1023,13 +1024,11 @@ H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, H5_DLL herr_t H5C_dest(H5F_t * f, hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - H5C_t * cache_ptr); + hid_t secondary_dxpl_id); H5_DLL herr_t H5C_expunge_entry(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, unsigned flags); @@ -1037,7 +1036,6 @@ H5_DLL herr_t H5C_expunge_entry(H5F_t * f, H5_DLL herr_t H5C_flush_cache(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, unsigned flags); H5_DLL herr_t H5C_flush_to_min_clean(H5F_t * f, @@ -1045,7 +1043,7 @@ H5_DLL herr_t H5C_flush_to_min_clean(H5F_t * f, hid_t secondary_dxpl_id, H5C_t * cache_ptr); -H5_DLL herr_t H5C_get_cache_auto_resize_config(H5C_t * cache_ptr, +H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr); H5_DLL herr_t H5C_get_cache_size(H5C_t * cache_ptr, @@ -1057,7 +1055,7 @@ H5_DLL herr_t H5C_get_cache_size(H5C_t * cache_ptr, H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t * cache_ptr, double * hit_rate_ptr); -H5_DLL herr_t H5C_get_entry_status(H5C_t * cache_ptr, +H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t * size_ptr, hbool_t * in_cache_ptr, @@ -1067,16 +1065,17 @@ H5_DLL herr_t H5C_get_entry_status(H5C_t * cache_ptr, hbool_t * is_flush_dep_parent_ptr, hbool_t * is_flush_dep_child_ptr); -H5_DLL herr_t H5C_get_evictions_enabled(H5C_t * cache_ptr, +H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t * cache_ptr, hbool_t * evictions_enabled_ptr); -H5_DLL herr_t H5C_get_trace_file_ptr(H5C_t * cache_ptr, - FILE ** trace_file_ptr_ptr); +H5_DLL herr_t H5C_get_trace_file_ptr(const H5C_t *cache_ptr, + FILE **trace_file_ptr_ptr); +H5_DLL herr_t H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, + FILE **trace_file_ptr_ptr); H5_DLL herr_t H5C_insert_entry(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, void * thing, @@ -1089,29 +1088,24 @@ 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(H5C_t * cache_ptr, - void * thing, +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(H5C_t * cache_ptr, - void * thing); +H5_DLL herr_t H5C_mark_pinned_or_protected_entry_dirty(void *thing); H5_DLL herr_t H5C_rename_entry(H5C_t * cache_ptr, const H5C_class_t * type, haddr_t old_addr, haddr_t new_addr); -H5_DLL herr_t H5C_pin_protected_entry(H5C_t * cache_ptr, - void * thing); +H5_DLL herr_t H5C_pin_protected_entry(void *thing); -H5_DLL herr_t H5C_create_flush_dependency(H5C_t *cache_ptr, void *parent_thing, - void *child_thing); +H5_DLL herr_t H5C_create_flush_dependency(void *parent_thing, void *child_thing); H5_DLL void * H5C_protect(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, const void * udata1, @@ -1120,14 +1114,12 @@ H5_DLL void * H5C_protect(H5F_t * f, H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr); -H5_DLL herr_t H5C_resize_pinned_entry(H5C_t * cache_ptr, - void * thing, - size_t new_size); +H5_DLL herr_t H5C_resize_pinned_entry(void *thing, size_t new_size); -H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, +H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); -H5_DLL herr_t H5C_set_evictions_enabled(H5C_t * cache_ptr, +H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled); H5_DLL herr_t H5C_set_prefix(H5C_t * cache_ptr, char * prefix); @@ -1145,15 +1137,13 @@ H5_DLL herr_t H5C_stats(H5C_t * cache_ptr, H5_DLL void H5C_stats__reset(H5C_t * cache_ptr); -H5_DLL herr_t H5C_unpin_entry(H5C_t * cache_ptr, void * thing); +H5_DLL herr_t H5C_unpin_entry(void *thing); -H5_DLL herr_t H5C_destroy_flush_dependency(H5C_t *cache_ptr, void *parent_thing, - void *child_thing); +H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing); H5_DLL herr_t H5C_unprotect(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, void * thing, diff --git a/src/H5Dint.c b/src/H5Dint.c index 85f093d..9f65642 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -862,8 +862,8 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) done: /* Release pointer to object header itself */ - if(oloc != NULL && oh != NULL) - if(H5O_unpin(oloc, oh) < 0) + if(oh != NULL) + if(H5O_unpin(oh) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNPIN, FAIL, "unable to unpin dataset object header") /* Error cleanup */ @@ -2284,7 +2284,7 @@ H5D_flush_real(H5D_t *dataset, hid_t dxpl_id) done: /* Release pointer to object header */ if(oh != NULL) - if(H5O_unpin(&(dataset->oloc), oh) < 0) + if(H5O_unpin(oh) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNPIN, FAIL, "unable to unpin dataset object header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 5a5a9f6..d2ad2ac 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -254,7 +254,7 @@ H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, /* Insert "empty" name first */ if((size_t)(-1) == H5HL_insert(file, dxpl_id, heap, (size_t)1, "")) { - H5HL_unprotect(file, heap); + H5HL_unprotect(heap); HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap") } /* end if */ @@ -264,7 +264,7 @@ H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, /* Insert file name into heap */ if((size_t)(-1) == (offset = H5HL_insert(file, dxpl_id, heap, HDstrlen(efl->slot[u].name) + 1, efl->slot[u].name))) { - H5HL_unprotect(file, heap); + H5HL_unprotect(heap); HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap") } /* end if */ @@ -274,7 +274,7 @@ H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, } /* end for */ /* Release the heap */ - if(H5HL_unprotect(file, heap) < 0) + if(H5HL_unprotect(heap) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTUNPROTECT, FAIL, "unable to unprotect EFL file name heap") heap = NULL; @@ -821,7 +821,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); hdr->f = ea->f; /* Set up flush dependency between child_entry and metadata array 'thing' */ - if(H5EA__create_flush_depend(hdr, parent_entry, (H5AC_info_t *)hdr) < 0) + if(H5EA__create_flush_depend(parent_entry, (H5AC_info_t *)hdr) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency on file metadata") CATCH @@ -864,7 +864,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); hdr->f = ea->f; /* Remove flush dependency between child_entry and metadata array 'thing' */ - if(H5EA__destroy_flush_depend(hdr, parent_entry, (H5AC_info_t *)hdr) < 0) + if(H5EA__destroy_flush_depend(parent_entry, (H5AC_info_t *)hdr) < 0) H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency on file metadata") CATCH @@ -891,7 +891,6 @@ herr_t, SUCCEED, FAIL, H5EA_support(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, H5AC_info_t *child_entry)) /* Local variables */ - H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ void *thing = NULL; /* Pointer to the array metadata containing the array index we are interested in */ uint8_t *thing_elmt_buf; /* Pointer to the element buffer for the array metadata */ hsize_t thing_elmt_idx; /* Index of the element in the element buffer for the array metadata */ @@ -906,10 +905,6 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); * Check arguments. */ HDassert(ea); - HDassert(hdr); - - /* Set the shared array header's file context for this operation */ - hdr->f = ea->f; /* Look up the array metadata containing the element we want to set */ if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC_WRITE, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) @@ -921,7 +916,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); HDassert(thing_unprot_func); /* Set up flush dependency between child_entry and metadata array 'thing' */ - if(H5EA__create_flush_depend(hdr, (H5AC_info_t *)thing, child_entry) < 0) + if(H5EA__create_flush_depend((H5AC_info_t *)thing, child_entry) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency on array metadata") CATCH @@ -951,7 +946,6 @@ herr_t, SUCCEED, FAIL, H5EA_unsupport(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, H5AC_info_t *child_entry)) /* Local variables */ - H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ void *thing = NULL; /* Pointer to the array metadata containing the array index we are interested in */ uint8_t *thing_elmt_buf; /* Pointer to the element buffer for the array metadata */ hsize_t thing_elmt_idx; /* Index of the element in the element buffer for the array metadata */ @@ -966,10 +960,6 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); * Check arguments. */ HDassert(ea); - HDassert(hdr); - - /* Set the shared array header's file context for this operation */ - hdr->f = ea->f; /* Look up the array metadata containing the element we want to set */ if(H5EA__lookup_elmt(ea, dxpl_id, idx, H5AC_READ, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) @@ -981,7 +971,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); HDassert(thing_unprot_func); /* Remove flush dependency between child_entry and metadata array 'thing' */ - if(H5EA__destroy_flush_depend(hdr, (H5AC_info_t *)thing, child_entry) < 0) + if(H5EA__destroy_flush_depend((H5AC_info_t *)thing, child_entry) < 0) H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency on array metadata") CATCH diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 5138ae4..44b5668 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -863,13 +863,13 @@ H5EA__cache_iblock_notify(H5AC_notify_action_t action, H5EA_iblock_t *iblock)) switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: /* Create flush dependency on extensible array header */ - if(H5EA__create_flush_depend(iblock->hdr, (H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0) + if(H5EA__create_flush_depend((H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency between index block and header, address = %llu", (unsigned long long)iblock->addr) break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Destroy flush dependency on extensible array header */ - if(H5EA__destroy_flush_depend(iblock->hdr, (H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0) + if(H5EA__destroy_flush_depend((H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0) H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between index block and header, address = %llu", (unsigned long long)iblock->addr) break; @@ -1294,13 +1294,13 @@ H5EA__cache_sblock_notify(H5AC_notify_action_t action, H5EA_sblock_t *sblock)) switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: /* Create flush dependency on index block */ - if(H5EA__create_flush_depend(sblock->hdr, (H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0) + if(H5EA__create_flush_depend((H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency between super block and index block, address = %llu", (unsigned long long)sblock->addr) break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Destroy flush dependency on index block */ - if(H5EA__destroy_flush_depend(sblock->hdr, (H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0) + if(H5EA__destroy_flush_depend((H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0) H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between super block and index block, address = %llu", (unsigned long long)sblock->addr) break; @@ -1659,13 +1659,13 @@ H5EA__cache_dblock_notify(H5AC_notify_action_t action, H5EA_dblock_t *dblock)) switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: /* Create flush dependency on parent */ - if(H5EA__create_flush_depend(dblock->hdr, (H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0) + if(H5EA__create_flush_depend((H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency between data block and parent, address = %llu", (unsigned long long)dblock->addr) break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Destroy flush dependency on parent */ - if(H5EA__destroy_flush_depend(dblock->hdr, (H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0) + if(H5EA__destroy_flush_depend((H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0) H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between data block and parent, address = %llu", (unsigned long long)dblock->addr) break; @@ -2013,13 +2013,13 @@ H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, H5EA_dblk_page_t *dblk switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: /* Create flush dependency on parent */ - if(H5EA__create_flush_depend(dblk_page->hdr, (H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0) + if(H5EA__create_flush_depend((H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency between data block page and parent, address = %llu", (unsigned long long)dblk_page->addr) break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Destroy flush dependency on parent */ - if(H5EA__destroy_flush_depend(dblk_page->hdr, (H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0) + if(H5EA__destroy_flush_depend((H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0) H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between data block page and parent, address = %llu", (unsigned long long)dblk_page->addr) break; diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index b8d3334..d3cd260 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -478,7 +478,7 @@ H5EA__hdr_incr(H5EA_hdr_t *hdr)) /* Mark header as un-evictable when something is depending on it */ if(hdr->rc == 0) - if(H5AC_pin_protected_entry(hdr->f, hdr) < 0) + if(H5AC_pin_protected_entry(hdr) < 0) H5E_THROW(H5E_CANTPIN, "unable to pin extensible array header") /* Increment reference count on shared header */ @@ -516,7 +516,7 @@ H5EA__hdr_decr(H5EA_hdr_t *hdr)) /* Mark header as evictable again when nothing depend on it */ if(hdr->rc == 0) { HDassert(hdr->file_rc == 0); - if(H5AC_unpin_entry(hdr->f, hdr) < 0) + if(H5AC_unpin_entry(hdr) < 0) H5E_THROW(H5E_CANTUNPIN, "unable to unpin extensible array header") } /* end if */ @@ -603,7 +603,7 @@ H5EA__hdr_modified(H5EA_hdr_t *hdr)) HDassert(hdr->f); /* Mark header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(hdr->f, hdr) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(hdr) < 0) H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark extensible array header as dirty") CATCH @@ -628,6 +628,9 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id)) + /* Local variables */ + unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting header */ + /* Sanity check */ HDassert(hdr); HDassert(!hdr->file_rc); @@ -656,15 +659,13 @@ HDfprintf(stderr, "%s: hdr->idx_blk_addr = %a\n", FUNC, hdr->idx_blk_addr); H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array index block") } /* end if */ - /* Finished deleting header */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") - hdr = NULL; + /* Set flags to finish deleting header on unprotect */ + cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; CATCH - /* Unprotect the header, if an error occurred */ - if(hdr && H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) + /* Unprotect the header, deleting it if an error hasn't occurred */ + if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__hdr_delete() */ diff --git a/src/H5EAint.c b/src/H5EAint.c index 5ce88fc..12a9cda 100644 --- a/src/H5EAint.c +++ b/src/H5EAint.c @@ -95,16 +95,14 @@ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__create_flush_depend(H5EA_hdr_t *hdr, H5AC_info_t *parent_entry, - H5AC_info_t *child_entry)) +H5EA__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)) /* Sanity check */ - HDassert(hdr); HDassert(parent_entry); HDassert(child_entry); /* Create a flush dependency between parent and child entry */ - if(H5AC_create_flush_dependency(hdr->f, parent_entry, child_entry) < 0) + if(H5AC_create_flush_dependency(parent_entry, child_entry) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency") CATCH @@ -127,15 +125,14 @@ END_FUNC(PKG) /* end H5EA__create_flush_depend() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__destroy_flush_depend(H5EA_hdr_t *hdr, H5AC_info_t *parent_entry, H5AC_info_t *child_entry)) +H5EA__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)) /* Sanity check */ - HDassert(hdr); HDassert(parent_entry); HDassert(child_entry); /* Destroy a flush dependency between parent and child entry */ - if(H5AC_destroy_flush_dependency(hdr->f, parent_entry, child_entry) < 0) + if(H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency") CATCH diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 6e86a34..9b6b368 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -362,9 +362,9 @@ extern const H5EA_class_t *const H5EA_client_class_g[]; /******************************/ /* Generic routines */ -H5_DLL herr_t H5EA__create_flush_depend(H5EA_hdr_t *hdr, H5AC_info_t *parent_entry, +H5_DLL herr_t H5EA__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry); -H5_DLL herr_t H5EA__destroy_flush_depend(H5EA_hdr_t *hdr, H5AC_info_t *parent_entry, +H5_DLL herr_t H5EA__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry); /* Header routines */ @@ -1003,7 +1003,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) } /* end if */ /* Unpin the superblock, since we're about to destroy the cache */ - if(H5AC_unpin_entry(f, f->shared->sblock) < 0) + if(H5AC_unpin_entry(f->shared->sblock) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FSPACE, H5E_CANTUNPIN, FAIL, "unable to unpin superblock") f->shared->sblock = NULL; diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 94fb7b2..372caf8 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -264,7 +264,7 @@ H5FA__hdr_incr(H5FA_hdr_t *hdr)) /* Mark header as un-evictable when something is depending on it */ if(hdr->rc == 0) - if(H5AC_pin_protected_entry(hdr->f, hdr) < 0) + if(H5AC_pin_protected_entry(hdr) < 0) H5E_THROW(H5E_CANTPIN, "unable to pin fixed array header") /* Increment reference count on shared header */ @@ -301,7 +301,7 @@ H5FA__hdr_decr(H5FA_hdr_t *hdr)) /* Mark header as evictable again when nothing depend on it */ if(hdr->rc == 0) { HDassert(hdr->file_rc == 0); - if(H5AC_unpin_entry(hdr->f, hdr) < 0) + if(H5AC_unpin_entry(hdr) < 0) H5E_THROW(H5E_CANTUNPIN, "unable to unpin fixed array header") } /* end if */ @@ -382,10 +382,9 @@ H5FA__hdr_modified(H5FA_hdr_t *hdr)) /* Sanity check */ HDassert(hdr); - HDassert(hdr->f); /* Mark header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(hdr->f, hdr) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(hdr) < 0) H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark fixed array header as dirty") CATCH @@ -409,6 +408,9 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id)) + /* Local variables */ + unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting header */ + /* Sanity check */ HDassert(hdr); HDassert(!hdr->file_rc); @@ -438,15 +440,13 @@ HDfprintf(stderr, "%s: hdr->dblk_addr = %a\n", FUNC, hdr->dblk_addr); H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array data block") } /* end if */ - /* Finished deleting header */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") - hdr = NULL; + /* Set flags to finish deleting header on unprotect */ + cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; CATCH - /* Unprotect the header, if an error occurred */ - if(hdr && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) + /* Unprotect the header, deleting it if an error hasn't occurred */ + if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PKG) /* end H5FA__hdr_delete() */ @@ -382,7 +382,7 @@ HDfprintf(stderr, "%s: Real sections to store in file\n", FUNC); fspace->alloc_sect_size = (size_t)fspace->sect_size; /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(f, fspace) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end if */ } /* end if */ @@ -439,7 +439,7 @@ HDfprintf(stderr, "%s: Section info went 'go away'\n", FUNC); fspace->alloc_sect_size = 0; /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(f, fspace) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end else */ } /* end if */ @@ -455,7 +455,7 @@ HDfprintf(stderr, "%s: Section info is NOT for file free space\n", FUNC); fspace->alloc_sect_size = 0; /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(f, fspace) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") /* Free previous serialized sections disk space */ @@ -633,7 +633,7 @@ HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fsp /* Check if we should pin the header in the cache */ if(fspace->rc == 0 && H5F_addr_defined(fspace->addr)) - if(H5AC_pin_protected_entry(f, fspace) < 0) + if(H5AC_pin_protected_entry(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPIN, FAIL, "unable to pin free space header") /* Increment reference count on header */ @@ -679,7 +679,7 @@ HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fsp /* Check if we should unpin the header in the cache */ if(fspace->rc == 0) { if(H5F_addr_defined(fspace->addr)) { - if(H5AC_unpin_entry(f, fspace) < 0) + if(H5AC_unpin_entry(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPIN, FAIL, "unable to unpin free space header") } /* end if */ else { @@ -723,7 +723,7 @@ HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC); /* Check if the free space manager is persistant */ if(H5F_addr_defined(fspace->addr)) /* Mark header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(f, fspace) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") done: @@ -884,7 +884,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) if(hdr_status & H5AC_ES__IN_CACHE) { /* Unpin the free-space manager header */ - if(H5AC_unpin_entry(f, fspace) < 0) + if(H5AC_unpin_entry(fspace) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap header") /* Load the free-space manager header */ diff --git a/src/H5FScache.c b/src/H5FScache.c index 8a345fe..1761adf 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -1012,7 +1012,7 @@ H5FS_sinfo_free_node_cb(void *item, void UNUSED *key, void *op_data) *------------------------------------------------------------------------- */ herr_t -H5FS_cache_sinfo_dest(H5F_t *f, H5FS_sinfo_t *sinfo) +H5FS_cache_sinfo_dest(H5F_t UNUSED *f, H5FS_sinfo_t *sinfo) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index f80bf50..eb739dc 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -327,7 +327,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id) sblock_flags |= H5AC__DIRTIED_FLAG; /* Pin the superblock in the cache */ - if(H5AC_pin_protected_entry(f, sblock) < 0) + if(H5AC_pin_protected_entry(sblock) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPIN, FAIL, "unable to pin superblock") /* Set the pointer to the pinned superblock */ @@ -609,7 +609,7 @@ done: /* Check if we've cached it already */ if(sblock_in_cache) { /* Unpin superblock in cache */ - if(H5AC_unpin_entry(f, sblock) < 0) + if(H5AC_unpin_entry(sblock) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin superblock") /* Evict the superblock from the cache */ @@ -655,7 +655,7 @@ H5F_super_dirty(H5F_t *f) HDassert(f->shared->sblock); /* Mark superblock dirty in cache, so change to EOA will get encoded */ - if(H5AC_mark_pinned_or_protected_entry_dirty(f, f->shared->sblock) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(f->shared->sblock) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") done: @@ -788,7 +788,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, void *mesg, unsigned id, hbool_ done: /* Mark superblock dirty in cache, if necessary */ if(sblock_dirty) - if(H5AC_mark_pinned_or_protected_entry_dirty(f, f->shared->sblock) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(f->shared->sblock) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gnode.c b/src/H5Gnode.c index ca6cb6c..18125df 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -1328,7 +1328,7 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, } /* end of for (i=0; i<sn->nsyms; i++) */ done: - if(heap && H5HL_unprotect(f, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to unprotect symbol name") if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) @@ -1527,7 +1527,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, done: if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") - if(heap && H5HL_unprotect(f, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 271501f..7766280 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -921,7 +921,7 @@ H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) for(u = 0; u < linfo->nlinks; u++) if(H5O_msg_append_oh(oloc->file, dxpl_id, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { /* Release object header */ - if(H5O_unpin(oloc, oh) < 0) + if(H5O_unpin(oh) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPIN, FAIL, "unable to unpin group object header") HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") @@ -933,7 +933,7 @@ H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) } /* end if */ /* Release object header */ - if(H5O_unpin(oloc, oh) < 0) + if(H5O_unpin(oh) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUNPIN, FAIL, "unable to unpin group object header") /* Free link table information */ diff --git a/src/H5Groot.c b/src/H5Groot.c index 7dc98d1..e4cdc46 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -261,7 +261,7 @@ done: /* Mark superblock dirty in cache, if necessary */ if(sblock_dirty) - if(H5AC_mark_pinned_or_protected_entry_dirty(f, f->shared->sblock) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(f->shared->sblock) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 7dfb5ae..cba725f 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -136,7 +136,7 @@ H5G_stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t d done: /* Release resources */ - if(heap && H5HL_unprotect(f, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -250,7 +250,7 @@ H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name, done: /* Release resources */ - if(heap && H5HL_unprotect(f, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -343,7 +343,7 @@ H5G_stab_remove(H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, done: /* Release resources */ - if(heap && H5HL_unprotect(loc->file, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -401,7 +401,7 @@ H5G_stab_remove_by_idx(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *grp_full_ done: /* Release resources */ - if(heap && H5HL_unprotect(grp_oloc->file, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") /* Reset the link information, if we have a copy */ @@ -453,7 +453,7 @@ H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete symbol table B-tree") /* Release resources */ - if(H5HL_unprotect(f, heap) < 0) + if(H5HL_unprotect(heap) < 0) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") heap = NULL; @@ -463,7 +463,7 @@ H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) done: /* Release resources */ - if(heap && H5HL_unprotect(f, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -553,7 +553,7 @@ H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, done: /* Release resources */ - if(heap && H5HL_unprotect(oloc->file, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") if(ltable.lnks && H5G_link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -760,7 +760,7 @@ H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, done: /* Release resources */ - if(heap && H5HL_unprotect(oloc->file, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") /* Free the duplicated name */ @@ -859,7 +859,7 @@ H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, done: /* Release resources */ - if(heap && H5HL_unprotect(grp_oloc->file, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -973,7 +973,7 @@ H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, done: /* Release resources */ - if(heap && H5HL_unprotect(grp_oloc->file, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -1048,7 +1048,7 @@ H5G_stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) done: /* Release resources */ - if(heap && H5HL_unprotect(grp_oloc->file, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 44105cd..62c6bab 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -616,7 +616,7 @@ H5G_verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent) done: /* Release resources */ - if(heap && H5HL_unprotect(grp_oloc->file, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 0b4936d..8652f90 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -540,7 +540,7 @@ H5HF_hdr_incr(H5HF_hdr_t *hdr) /* Mark header as un-evictable when a block is depending on it */ if(hdr->rc == 0) - if(H5AC_pin_protected_entry(hdr->f, hdr) < 0) + if(H5AC_pin_protected_entry(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTPIN, FAIL, "unable to pin fractal heap header") /* Increment reference count on shared header */ @@ -581,7 +581,7 @@ H5HF_hdr_decr(H5HF_hdr_t *hdr) /* Mark header as evictable again when no child blocks depend on it */ if(hdr->rc == 0) { HDassert(hdr->file_rc == 0); - if(H5AC_unpin_entry(hdr->f, hdr) < 0) + if(H5AC_unpin_entry(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap header") } /* end if */ @@ -671,7 +671,7 @@ H5HF_hdr_dirty(H5HF_hdr_t *hdr) HDassert(hdr); /* Mark header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(hdr->f, hdr) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark fractal heap header as dirty") done: diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index c75a28a..809a720 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -116,7 +116,7 @@ H5HF_iblock_pin(H5HF_indirect_t *iblock) HDassert(iblock); /* Mark block as un-evictable */ - if(H5AC_pin_protected_entry(iblock->hdr->f, iblock) < 0) + if(H5AC_pin_protected_entry(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTPIN, FAIL, "unable to pin fractal heap indirect block") /* If this indirect block has a parent, update it's child iblock pointer */ @@ -200,7 +200,7 @@ H5HF_iblock_unpin(H5HF_indirect_t *iblock) } /* end if */ /* Mark block as evictable again */ - if(H5AC_unpin_entry(iblock->hdr->f, iblock) < 0) + if(H5AC_unpin_entry(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block") done: @@ -332,7 +332,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->hdr->f, iblock) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark fractal heap indirect block as dirty") done: @@ -238,7 +238,7 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) HDassert(heap->prfx); /* Resize the heap prefix in the cache */ - if(H5AC_resize_pinned_entry(f, heap->prfx, (size_t)(heap->prfx_size + new_heap_size)) < 0) + if(H5AC_resize_pinned_entry(heap->prfx, (size_t)(heap->prfx_size + new_heap_size)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap in cache") } /* end if */ else { @@ -247,7 +247,7 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) HDassert(heap->dblk); /* Resize the heap data block in the cache */ - if(H5AC_resize_pinned_entry(f, heap->dblk, (size_t)new_heap_size) < 0) + if(H5AC_resize_pinned_entry(heap->dblk, (size_t)new_heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap in cache") } /* end else */ } /* end if */ @@ -260,7 +260,7 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) /* Resize current heap prefix */ heap->prfx_size = H5HL_SIZEOF_HDR(f); - if(H5AC_resize_pinned_entry(f, heap->prfx, (size_t)heap->prfx_size) < 0) + if(H5AC_resize_pinned_entry(heap->prfx, (size_t)heap->prfx_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap prefix in cache") /* Insert data block into cache (pinned) */ @@ -276,7 +276,7 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) /* (ignore [unlikely] case where heap data block ends up * contiguous w/heap prefix again. */ - if(H5AC_resize_pinned_entry(f, heap->dblk, (size_t)new_heap_size) < 0) + if(H5AC_resize_pinned_entry(heap->dblk, (size_t)new_heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap data block in cache") /* Relocate the heap data block in the cache */ @@ -557,14 +557,13 @@ H5HL_offset_into(const H5HL_t *heap, size_t offset) *------------------------------------------------------------------------- */ herr_t -H5HL_unprotect(H5F_t *f, H5HL_t *heap) +H5HL_unprotect(H5HL_t *heap) { herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5HL_unprotect, FAIL) /* check arguments */ - HDassert(f); HDassert(heap); /* Decrement # of times heap is protected */ @@ -575,7 +574,7 @@ H5HL_unprotect(H5F_t *f, H5HL_t *heap) /* Check for separate heap data block */ if(heap->single_cache_obj) { /* Mark local heap prefix as evictable again */ - if(H5AC_unpin_entry(f, heap->prfx) < 0) + if(H5AC_unpin_entry(heap->prfx) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin local heap data block") } /* end if */ else { @@ -584,7 +583,7 @@ H5HL_unprotect(H5F_t *f, H5HL_t *heap) /* Mark local heap data block as evictable again */ /* (data block still pins prefix) */ - if(H5AC_unpin_entry(f, heap->dblk) < 0) + if(H5AC_unpin_entry(heap->dblk) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin local heap data block") } /* end else */ } /* end if */ @@ -640,14 +639,13 @@ H5HL_remove_free(H5HL_t *heap, H5HL_free_t *fl) *------------------------------------------------------------------------- */ static herr_t -H5HL_dirty(H5F_t *f, H5HL_t *heap) +H5HL_dirty(H5HL_t *heap) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HL_dirty) /* check arguments */ - HDassert(f); HDassert(heap); HDassert(heap->prfx); @@ -656,12 +654,12 @@ H5HL_dirty(H5F_t *f, H5HL_t *heap) /* Sanity check */ HDassert(heap->dblk); - if(H5AC_mark_pinned_or_protected_entry_dirty(f, heap->dblk) < 0) + if(H5AC_mark_pinned_or_protected_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(f, heap->prfx) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(heap->prfx) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap prefix as dirty") done: @@ -706,7 +704,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void * * so we just accept that an extra flush of the heap info could occur * if an error occurs -QAK) */ - if(H5HL_dirty(f, heap) < 0) + if(H5HL_dirty(heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, UFAIL, "unable to mark heap as dirty") /* @@ -785,12 +783,12 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void * /* Check for prefix & data block contiguous */ if(heap->single_cache_obj) { /* Resize prefix+data block */ - if(H5AC_resize_pinned_entry(f, heap->prfx, (size_t)(heap->prfx_size + new_dblk_size)) < 0) + if(H5AC_resize_pinned_entry(heap->prfx, (size_t)(heap->prfx_size + new_dblk_size)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, UFAIL, "unable to resize heap prefix in cache") } /* end if */ else { /* Resize 'standalone' data block */ - if(H5AC_resize_pinned_entry(f, heap->dblk, (size_t)new_dblk_size) < 0) + if(H5AC_resize_pinned_entry(heap->dblk, (size_t)new_dblk_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, UFAIL, "unable to resize heap data block in cache") } /* end else */ @@ -927,7 +925,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size) * so we just accept that an extra flush of the heap info could occur * if an error occurs -QAK) */ - if(H5HL_dirty(f, heap) < 0) + if(H5HL_dirty(heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap as dirty") /* @@ -1095,7 +1093,7 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) /* Pin the prefix, if the data block was loaded from file */ if(dblk_udata.loaded) { - if(H5AC_pin_protected_entry(f, prfx) < 0) + if(H5AC_pin_protected_entry(prfx) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTPIN, FAIL, "unable to pin local heap prefix") } /* end if */ } /* end if */ diff --git a/src/H5HLcache.c b/src/H5HLcache.c index a26477a..6e725ac 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -650,7 +650,7 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, done: /* Release the [possibly partially initialized] local heap on errors */ if(!ret_value && dblk) - if(H5HL_dblk_dest(f, dblk) < 0) + if(H5HL_dblk_dest(dblk) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block") FUNC_LEAVE_NOAPI(ret_value) @@ -702,7 +702,7 @@ H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, /* Should we destroy the memory version? */ if(destroy) - if(H5HL_dblk_dest(f, dblk) < 0) + if(H5HL_dblk_dest(dblk) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap data block") done: @@ -724,7 +724,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HL_datablock_dest(H5F_t *f, void *_thing) +H5HL_datablock_dest(H5F_t UNUSED *f, void *_thing) { H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ herr_t ret_value = SUCCEED; /* Return value */ @@ -732,7 +732,6 @@ H5HL_datablock_dest(H5F_t *f, void *_thing) FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_dest) /* check arguments */ - HDassert(f); HDassert(dblk); HDassert(dblk->heap); HDassert(!dblk->heap->single_cache_obj); @@ -753,7 +752,7 @@ H5HL_datablock_dest(H5F_t *f, void *_thing) } /* end if */ /* Destroy local heap data block */ - if(H5HL_dblk_dest(f, dblk) < 0) + if(H5HL_dblk_dest(dblk) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't destroy local heap data block") done: @@ -775,7 +774,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HL_datablock_clear(H5F_t *f, void *_thing, hbool_t destroy) +H5HL_datablock_clear(H5F_t UNUSED *f, void *_thing, hbool_t destroy) { H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ herr_t ret_value = SUCCEED; /* Return value */ @@ -783,14 +782,13 @@ H5HL_datablock_clear(H5F_t *f, void *_thing, hbool_t destroy) FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_clear) /* check arguments */ - HDassert(f); HDassert(dblk); /* Mark local heap data block as clean */ dblk->cache_info.is_dirty = FALSE; if(destroy) - if(H5HL_dblk_dest(f, dblk) < 0) + if(H5HL_dblk_dest(dblk) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap data block") done: diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index 8107164..b8a8d35 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -125,7 +125,7 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int H5_buffer_dump(stream, indent, h->dblk_image, marker, (size_t)0, h->dblk_size); done: - if(h && H5HL_unprotect(f, h) < 0) + if(h && H5HL_unprotect(h) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") H5MM_xfree(marker); diff --git a/src/H5HLint.c b/src/H5HLint.c index 23ffe00..c6d6839 100644 --- a/src/H5HLint.c +++ b/src/H5HLint.c @@ -382,7 +382,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HL_dblk_dest(H5F_t *f, H5HL_dblk_t *dblk) +H5HL_dblk_dest(H5HL_dblk_t *dblk) { herr_t ret_value = SUCCEED; /* Return value */ @@ -397,7 +397,7 @@ H5HL_dblk_dest(H5F_t *f, H5HL_dblk_t *dblk) dblk->heap->dblk = NULL; /* Unpin the local heap prefix */ - if(H5AC_unpin_entry(f, dblk->heap->prfx) < 0) + if(H5AC_unpin_entry(dblk->heap->prfx) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "can't unpin local heap prefix") /* Decrement ref. count on heap data structure */ diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 8052eb1..926ecd3 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -155,7 +155,7 @@ H5_DLL herr_t H5HL_prfx_dest(H5HL_prfx_t *prfx); /* Heap data block routines */ H5_DLL H5HL_dblk_t *H5HL_dblk_new(H5HL_t *heap); -H5_DLL herr_t H5HL_dblk_dest(H5F_t *f, H5HL_dblk_t *dblk); +H5_DLL herr_t H5HL_dblk_dest(H5HL_dblk_t *dblk); #endif /* _H5HLpkg_H */ diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index df2ec62..8679bee 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -65,7 +65,7 @@ H5_DLL H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_ H5_DLL void *H5HL_offset_into(const H5HL_t *heap, size_t offset); H5_DLL herr_t H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size); -H5_DLL herr_t H5HL_unprotect(H5F_t *f, H5HL_t *heap); +H5_DLL herr_t H5HL_unprotect(H5HL_t *heap); H5_DLL size_t H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t size, const void *buf); H5_DLL herr_t H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr); @@ -1599,7 +1599,7 @@ H5O_pin(H5O_loc_t *loc, hid_t dxpl_id) /* Check if the object header needs to be pinned */ if(0 == oh->npins) { /* Mark object header as un-evictable */ - if(H5AC_pin_protected_entry(loc->file, oh) < 0) + if(H5AC_pin_protected_entry(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, NULL, "unable to pin object header") } /* end if */ @@ -1634,22 +1634,19 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_unpin(H5O_loc_t *loc, H5O_t *oh) +H5O_unpin(H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5O_unpin, FAIL) /* check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5F_addr_defined(loc->addr)); HDassert(oh); /* Check if this is the last unpin operation */ if(1 == oh->npins) { /* Mark object header as evictable again */ - if(H5AC_unpin_entry(loc->file, oh) < 0) + if(H5AC_unpin_entry(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") } /* end if */ @@ -1735,7 +1732,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) } /* end else */ /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(f, oh) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end if */ diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 13a8337..087c3d3 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -1075,7 +1075,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(f, oh) < 0) + if(H5AC_mark_pinned_or_protected_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/H5Oefl.c b/src/H5Oefl.c index b16f415..0eb4ba2 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -130,7 +130,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, HDassert(s && !*s); - if(H5HL_unprotect(f, heap) < 0) + if(H5HL_unprotect(heap) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read unprotect link value") heap = NULL; #endif @@ -159,7 +159,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, HDassert(mesg->slot[u].size > 0); } /* end for */ - if(H5HL_unprotect(f, heap) < 0) + if(H5HL_unprotect(heap) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read unprotect link value") heap = NULL; @@ -482,7 +482,7 @@ H5O_efl_copy_file(H5F_t UNUSED *file_src, void *mesg_src, H5F_t *file_dst, done: /* Release resources */ - if(heap && H5HL_unprotect(file_dst, heap) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_EFL, H5E_PROTECT, NULL, "unable to unprotect EFL file name heap") if(!ret_value) if(efl_dst) diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 28be283..fc6146a 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1336,7 +1336,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(f, oh) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end if */ @@ -1993,7 +1993,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, HGOTO_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(f, oh) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") done: diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 5636243..da8c059 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -622,7 +622,7 @@ H5_DLL herr_t H5O_close(H5O_loc_t *loc); H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id); H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags); H5_DLL H5O_t *H5O_pin(H5O_loc_t *loc, hid_t dxpl_id); -H5_DLL herr_t H5O_unpin(H5O_loc_t *loc, H5O_t *oh); +H5_DLL herr_t H5O_unpin(H5O_t *oh); H5_DLL herr_t H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id); H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force); diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 6ea5b27..762b316 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -62,7 +62,7 @@ typedef struct H5Z_node { struct H5Z_data_xform_t { char* xform_exp; - struct H5Z_node* parse_root; + H5Z_node* parse_root; H5Z_datval_ptrs* dat_val_pointers; }; @@ -354,7 +354,7 @@ H5Z_unget_token(H5Z_token *current) static H5Z_token * H5Z_get_token(H5Z_token *current) { - void *ret_value = current; + H5Z_token *ret_value = current; FUNC_ENTER_NOAPI(H5Z_get_token, NULL) @@ -464,7 +464,7 @@ H5Z_get_token(H5Z_token *current) current->tok_type = H5Z_XFORM_END; /* Set return value */ - ret_value = (void *)current; + ret_value = current; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1369,7 +1369,7 @@ H5Z_xform_create(const char *expr) data_xform_prop->dat_val_pointers->num_ptrs = 0; /* we generate the parse tree right here and store a poitner to its root in the property. */ - if((data_xform_prop->parse_root = H5Z_xform_parse(expr, data_xform_prop->dat_val_pointers))==NULL) + if((data_xform_prop->parse_root = (H5Z_node *)H5Z_xform_parse(expr, data_xform_prop->dat_val_pointers))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to generate parse tree from expression") /* Sanity check |