mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-19 16:50:46 +08:00
[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,
This commit is contained in:
parent
0b761d78c7
commit
032766b521
516
src/H5AC.c
516
src/H5AC.c
@ -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 );
|
||||
HDassert(cache_ptr);
|
||||
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
|
||||
|
||||
if ( ( ((H5AC_info_t *)thing)->is_dirty == FALSE ) &&
|
||||
( NULL != cache_ptr->aux_ptr) ) {
|
||||
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??")
|
||||
|
||||
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);
|
||||
|
||||
if ( result < 0 ) {
|
||||
|
||||
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 );
|
||||
HDassert(cache_ptr);
|
||||
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
|
||||
|
||||
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 ) {
|
||||
|
||||
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 );
|
||||
HDassert(cache_ptr);
|
||||
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
|
||||
|
||||
if ( ( ((H5AC_info_t *)thing)->is_dirty == FALSE ) &&
|
||||
( NULL != cache_ptr->aux_ptr) ) {
|
||||
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??")
|
||||
|
||||
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);
|
||||
|
||||
if ( result < 0 ) {
|
||||
|
||||
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;
|
||||
|
@ -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);
|
||||
|
@ -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:
|
||||
|
406
src/H5C.c
406
src/H5C.c
@ -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,39 +4625,56 @@ 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 ) ) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr")
|
||||
}
|
||||
|
||||
if ( trace_file_ptr_ptr == NULL ) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL trace_file_ptr_ptr")
|
||||
}
|
||||
/* Sanity checks */
|
||||
HDassert(cache_ptr);
|
||||
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
|
||||
HDassert(trace_file_ptr_ptr);
|
||||
|
||||
*trace_file_ptr_ptr = cache_ptr->trace_file_ptr;
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* H5C_get_trace_file_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)
|
||||
|
||||
/* Sanity checks */
|
||||
HDassert(entry_ptr);
|
||||
HDassert(entry_ptr->cache_ptr);
|
||||
|
||||
/* Go get the trace file pointer for the cache */
|
||||
H5C_get_trace_file_ptr(entry_ptr->cache_ptr, trace_file_ptr_ptr);
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* H5C_get_trace_file_ptr_from_entry() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5C_insert_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 ) );
|
||||
/* 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);
|
||||
|
||||
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 ) {
|
||||
|
||||
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 );
|
||||
/* 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);
|
||||
|
||||
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 ) {
|
||||
|
||||
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,
|
||||
|
||||
if(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.")
|
||||
}
|
||||
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;
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
|
18
src/H5EA.c
18
src/H5EA.c
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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() */
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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() */
|
||||
|
14
src/H5FS.c
14
src/H5FS.c
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
32
src/H5HL.c
32
src/H5HL.c
@ -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 */
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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);
|
||||
|
11
src/H5O.c
11
src/H5O.c
@ -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 */
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
3222
test/cache.c
3222
test/cache.c
File diff suppressed because it is too large
Load Diff
@ -27,11 +27,6 @@
|
||||
|
||||
/* global variable declarations: */
|
||||
|
||||
const char *FILENAME[] = {
|
||||
"cache_api",
|
||||
NULL
|
||||
};
|
||||
|
||||
/* macro definitions */
|
||||
|
||||
#define RESIZE_CONFIGS_ARE_EQUAL(a, b, compare_init) \
|
||||
@ -331,7 +326,7 @@ check_fapl_mdc_api_calls(void)
|
||||
/* setup the file name */
|
||||
if ( pass ) {
|
||||
|
||||
if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
|
||||
if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
|
||||
== NULL ) {
|
||||
|
||||
pass = FALSE;
|
||||
@ -354,7 +349,7 @@ check_fapl_mdc_api_calls(void)
|
||||
/* get a pointer to the files internal data structure */
|
||||
if ( pass ) {
|
||||
|
||||
file_ptr = H5I_object_verify(file_id, H5I_FILE);
|
||||
file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
|
||||
|
||||
if ( file_ptr == NULL ) {
|
||||
|
||||
@ -480,7 +475,7 @@ check_fapl_mdc_api_calls(void)
|
||||
/* setup the file name */
|
||||
if ( pass ) {
|
||||
|
||||
if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
|
||||
if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
|
||||
== NULL ) {
|
||||
|
||||
pass = FALSE;
|
||||
@ -503,7 +498,7 @@ check_fapl_mdc_api_calls(void)
|
||||
/* get a pointer to the files internal data structure */
|
||||
if ( pass ) {
|
||||
|
||||
file_ptr = H5I_object_verify(file_id, H5I_FILE);
|
||||
file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
|
||||
|
||||
if ( file_ptr == NULL ) {
|
||||
|
||||
@ -651,7 +646,7 @@ validate_mdc_config(hid_t file_id,
|
||||
/* get a pointer to the files internal data structure */
|
||||
if ( pass ) {
|
||||
|
||||
file_ptr = H5I_object_verify(file_id, H5I_FILE);
|
||||
file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
|
||||
|
||||
if ( file_ptr == NULL ) {
|
||||
|
||||
@ -919,7 +914,7 @@ check_file_mdc_api_calls(void)
|
||||
/* setup the file name */
|
||||
if ( pass ) {
|
||||
|
||||
if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
|
||||
if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
|
||||
== NULL ) {
|
||||
|
||||
pass = FALSE;
|
||||
@ -1123,7 +1118,7 @@ check_and_validate_cache_hit_rate(hid_t file_id,
|
||||
/* get a pointer to the files internal data structure */
|
||||
if ( pass ) {
|
||||
|
||||
file_ptr = H5I_object_verify(file_id, H5I_FILE);
|
||||
file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
|
||||
|
||||
if ( file_ptr == NULL ) {
|
||||
|
||||
@ -1262,7 +1257,7 @@ check_and_validate_cache_size(hid_t file_id,
|
||||
/* get a pointer to the files internal data structure */
|
||||
if ( pass ) {
|
||||
|
||||
file_ptr = H5I_object_verify(file_id, H5I_FILE);
|
||||
file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
|
||||
|
||||
if ( file_ptr == NULL ) {
|
||||
|
||||
@ -1525,7 +1520,7 @@ mdc_api_call_smoke_check(int express_test)
|
||||
/* setup the file name */
|
||||
if ( pass ) {
|
||||
|
||||
if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
|
||||
if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
|
||||
== NULL ) {
|
||||
|
||||
pass = FALSE;
|
||||
@ -3609,7 +3604,7 @@ check_file_mdc_api_errs(void)
|
||||
HDfprintf(stdout, "%s: calling h5_fixname().\n", fcn_name);
|
||||
}
|
||||
|
||||
if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
|
||||
if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
|
||||
== NULL ) {
|
||||
|
||||
pass = FALSE;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -81,7 +81,11 @@
|
||||
|
||||
#define MAX_ENTRIES (10 * 1024)
|
||||
|
||||
#define PICO_BASE_ADDR (haddr_t)0
|
||||
/* The choice of the BASE_ADDR below is arbitrary -- it just has to be
|
||||
* larger than the superblock.
|
||||
*/
|
||||
#define BASE_ADDR (haddr_t)1024
|
||||
#define PICO_BASE_ADDR BASE_ADDR
|
||||
#define NANO_BASE_ADDR (haddr_t)(PICO_BASE_ADDR + \
|
||||
(PICO_ENTRY_SIZE * NUM_PICO_ENTRIES))
|
||||
#define MICRO_BASE_ADDR (haddr_t)(NANO_BASE_ADDR + \
|
||||
@ -125,6 +129,9 @@
|
||||
(MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES))
|
||||
#define NOTIFY_ALT_BASE_ADDR (haddr_t)(VARIABLE_ALT_BASE_ADDR + \
|
||||
(VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES))
|
||||
#define MAX_ADDR (haddr_t)(NOTIFY_ALT_BASE_ADDR + \
|
||||
(NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES))
|
||||
#define ADDR_SPACE_SIZE (haddr_t)(MAX_ADDR - BASE_ADDR)
|
||||
|
||||
#define MAX_PINS 8 /* Maximum number of entries that can be
|
||||
* directly pinned by a single entry.
|
||||
@ -474,15 +481,15 @@ struct expected_entry_status
|
||||
int entry_type;
|
||||
int entry_index;
|
||||
size_t size;
|
||||
hbool_t in_cache;
|
||||
hbool_t at_main_addr;
|
||||
hbool_t is_dirty;
|
||||
hbool_t is_protected;
|
||||
hbool_t is_pinned;
|
||||
hbool_t loaded;
|
||||
hbool_t cleared;
|
||||
hbool_t flushed;
|
||||
hbool_t destroyed;
|
||||
unsigned char in_cache;
|
||||
unsigned char at_main_addr;
|
||||
unsigned char is_dirty;
|
||||
unsigned char is_protected;
|
||||
unsigned char is_pinned;
|
||||
unsigned char loaded;
|
||||
unsigned char cleared;
|
||||
unsigned char flushed;
|
||||
unsigned char destroyed;
|
||||
int flush_dep_par_type; /* Entry type of flush dependency parent */
|
||||
int flush_dep_par_idx; /* Index of flush dependency parent */
|
||||
uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS];
|
||||
@ -644,29 +651,27 @@ haddr_t type_and_index_to_addr(int32_t type,
|
||||
int32_t idx);
|
||||
#endif
|
||||
|
||||
void dirty_entry(H5C_t * cache_ptr,
|
||||
void dirty_entry(H5F_t * file_ptr,
|
||||
int32_t type,
|
||||
int32_t idx,
|
||||
hbool_t dirty_pin);
|
||||
|
||||
void expunge_entry(H5C_t * cache_ptr,
|
||||
void expunge_entry(H5F_t * file_ptr,
|
||||
int32_t type,
|
||||
int32_t idx);
|
||||
|
||||
void insert_entry(H5C_t * cache_ptr,
|
||||
void insert_entry(H5F_t * file_ptr,
|
||||
int32_t type,
|
||||
int32_t idx,
|
||||
hbool_t dirty,
|
||||
unsigned int flags);
|
||||
|
||||
void mark_pinned_entry_dirty(H5C_t * cache_ptr,
|
||||
int32_t type,
|
||||
void mark_pinned_entry_dirty(int32_t type,
|
||||
int32_t idx,
|
||||
hbool_t size_changed,
|
||||
size_t new_size);
|
||||
|
||||
void mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr,
|
||||
int32_t type,
|
||||
void mark_pinned_or_protected_entry_dirty(int32_t type,
|
||||
int32_t idx);
|
||||
|
||||
void rename_entry(H5C_t * cache_ptr,
|
||||
@ -674,36 +679,30 @@ void rename_entry(H5C_t * cache_ptr,
|
||||
int32_t idx,
|
||||
hbool_t main_addr);
|
||||
|
||||
void protect_entry(H5C_t * cache_ptr,
|
||||
void protect_entry(H5F_t * file_ptr,
|
||||
int32_t type,
|
||||
int32_t idx);
|
||||
|
||||
void protect_entry_ro(H5C_t * cache_ptr,
|
||||
void protect_entry_ro(H5F_t * file_ptr,
|
||||
int32_t type,
|
||||
int32_t idx);
|
||||
|
||||
void pin_entry(H5C_t * cache_ptr,
|
||||
int32_t type,
|
||||
void pin_entry(int32_t type,
|
||||
int32_t idx);
|
||||
|
||||
hbool_t entry_in_cache(H5C_t * cache_ptr,
|
||||
int32_t type,
|
||||
int32_t idx);
|
||||
|
||||
void create_pinned_entry_dependency(H5C_t * cache_ptr,
|
||||
void create_pinned_entry_dependency(H5F_t * file_ptr,
|
||||
int pinning_type,
|
||||
int pinning_idx,
|
||||
int pinned_type,
|
||||
int pinned_idx);
|
||||
|
||||
void execute_flush_op(H5C_t * cache_ptr,
|
||||
struct test_entry_t * entry_ptr,
|
||||
struct flush_op * op_ptr,
|
||||
unsigned * flags_ptr);
|
||||
|
||||
void reset_entries(void);
|
||||
|
||||
void resize_entry(H5C_t * cache_ptr,
|
||||
void resize_entry(H5F_t * file_ptr,
|
||||
int32_t type,
|
||||
int32_t idx,
|
||||
size_t new_size,
|
||||
@ -714,9 +713,9 @@ void resize_pinned_entry(H5C_t * cache_ptr,
|
||||
int32_t idx,
|
||||
size_t new_size);
|
||||
|
||||
H5C_t * setup_cache(size_t max_cache_size, size_t min_clean_size);
|
||||
H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size);
|
||||
|
||||
void row_major_scan_forward(H5C_t * cache_ptr,
|
||||
void row_major_scan_forward(H5F_t * file_ptr,
|
||||
int32_t lag,
|
||||
hbool_t verbose,
|
||||
hbool_t reset_stats,
|
||||
@ -731,7 +730,7 @@ void row_major_scan_forward(H5C_t * cache_ptr,
|
||||
int dirty_destroys,
|
||||
int dirty_unprotects);
|
||||
|
||||
void hl_row_major_scan_forward(H5C_t * cache_ptr,
|
||||
void hl_row_major_scan_forward(H5F_t * file_ptr,
|
||||
int32_t max_index,
|
||||
hbool_t verbose,
|
||||
hbool_t reset_stats,
|
||||
@ -740,7 +739,7 @@ void hl_row_major_scan_forward(H5C_t * cache_ptr,
|
||||
hbool_t do_inserts,
|
||||
hbool_t dirty_inserts);
|
||||
|
||||
void row_major_scan_backward(H5C_t * cache_ptr,
|
||||
void row_major_scan_backward(H5F_t * file_ptr,
|
||||
int32_t lag,
|
||||
hbool_t verbose,
|
||||
hbool_t reset_stats,
|
||||
@ -755,7 +754,7 @@ void row_major_scan_backward(H5C_t * cache_ptr,
|
||||
int dirty_destroys,
|
||||
int dirty_unprotects);
|
||||
|
||||
void hl_row_major_scan_backward(H5C_t * cache_ptr,
|
||||
void hl_row_major_scan_backward(H5F_t * file_ptr,
|
||||
int32_t max_index,
|
||||
hbool_t verbose,
|
||||
hbool_t reset_stats,
|
||||
@ -764,7 +763,7 @@ void hl_row_major_scan_backward(H5C_t * cache_ptr,
|
||||
hbool_t do_inserts,
|
||||
hbool_t dirty_inserts);
|
||||
|
||||
void col_major_scan_forward(H5C_t * cache_ptr,
|
||||
void col_major_scan_forward(H5F_t * file_ptr,
|
||||
int32_t lag,
|
||||
hbool_t verbose,
|
||||
hbool_t reset_stats,
|
||||
@ -774,7 +773,7 @@ void col_major_scan_forward(H5C_t * cache_ptr,
|
||||
hbool_t dirty_inserts,
|
||||
int dirty_unprotects);
|
||||
|
||||
void hl_col_major_scan_forward(H5C_t * cache_ptr,
|
||||
void hl_col_major_scan_forward(H5F_t * file_ptr,
|
||||
int32_t max_index,
|
||||
hbool_t verbose,
|
||||
hbool_t reset_stats,
|
||||
@ -784,7 +783,7 @@ void hl_col_major_scan_forward(H5C_t * cache_ptr,
|
||||
hbool_t dirty_inserts,
|
||||
int dirty_unprotects);
|
||||
|
||||
void col_major_scan_backward(H5C_t * cache_ptr,
|
||||
void col_major_scan_backward(H5F_t * file_ptr,
|
||||
int32_t lag,
|
||||
hbool_t verbose,
|
||||
hbool_t reset_stats,
|
||||
@ -794,7 +793,7 @@ void col_major_scan_backward(H5C_t * cache_ptr,
|
||||
hbool_t dirty_inserts,
|
||||
int dirty_unprotects);
|
||||
|
||||
void hl_col_major_scan_backward(H5C_t * cache_ptr,
|
||||
void hl_col_major_scan_backward(H5F_t * file_ptr,
|
||||
int32_t max_index,
|
||||
hbool_t verbose,
|
||||
hbool_t reset_stats,
|
||||
@ -804,26 +803,25 @@ void hl_col_major_scan_backward(H5C_t * cache_ptr,
|
||||
hbool_t dirty_inserts,
|
||||
int dirty_unprotects);
|
||||
|
||||
void takedown_cache(H5C_t * cache_ptr,
|
||||
void takedown_cache(H5F_t * file_ptr,
|
||||
hbool_t dump_stats,
|
||||
hbool_t dump_detailed_stats);
|
||||
|
||||
void flush_cache(H5C_t * cache_ptr,
|
||||
void flush_cache(H5F_t * file_ptr,
|
||||
hbool_t destroy_entries,
|
||||
hbool_t dump_stats,
|
||||
hbool_t dump_detailed_stats);
|
||||
|
||||
void unpin_entry(H5C_t * cache_ptr,
|
||||
int32_t type,
|
||||
void unpin_entry(int32_t type,
|
||||
int32_t idx);
|
||||
|
||||
void unprotect_entry(H5C_t * cache_ptr,
|
||||
void unprotect_entry(H5F_t * file_ptr,
|
||||
int32_t type,
|
||||
int32_t idx,
|
||||
int dirty,
|
||||
unsigned int flags);
|
||||
|
||||
void unprotect_entry_with_size_change(H5C_t * cache_ptr,
|
||||
void unprotect_entry_with_size_change(H5F_t * file_ptr,
|
||||
int32_t type,
|
||||
int32_t idx,
|
||||
unsigned int flags,
|
||||
@ -838,14 +836,12 @@ void verify_entry_status(H5C_t * cache_ptr,
|
||||
|
||||
void verify_unprotected(void);
|
||||
|
||||
void create_flush_dependency(H5C_t * cache_ptr,
|
||||
int32_t parent_type,
|
||||
void create_flush_dependency(int32_t parent_type,
|
||||
int32_t parent_idx,
|
||||
int32_t child_type,
|
||||
int32_t child_idx);
|
||||
|
||||
void destroy_flush_dependency(H5C_t * cache_ptr,
|
||||
int32_t parent_type,
|
||||
void destroy_flush_dependency(int32_t parent_type,
|
||||
int32_t parent_idx,
|
||||
int32_t child_type,
|
||||
int32_t child_idx);
|
||||
|
@ -104,7 +104,7 @@ main(void)
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
if(H5HL_unprotect(f, heap) < 0) {
|
||||
if(H5HL_unprotect(heap) < 0) {
|
||||
H5_FAILED();
|
||||
H5Eprint2(H5E_DEFAULT, stdout);
|
||||
goto error;
|
||||
@ -151,7 +151,7 @@ main(void)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if(H5HL_unprotect(f, heap) < 0) {
|
||||
if(H5HL_unprotect(heap) < 0) {
|
||||
H5_FAILED();
|
||||
H5Eprint2(H5E_DEFAULT, stdout);
|
||||
goto error;
|
||||
|
@ -360,19 +360,14 @@ void lock_and_unlock_random_entries(H5C_t * cache_ptr, H5F_t * file_ptr,
|
||||
void lock_and_unlock_random_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
|
||||
int min_idx, int max_idx);
|
||||
void lock_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx);
|
||||
void mark_pinned_entry_dirty(H5C_t * cache_ptr, H5F_t * file_ptr,
|
||||
int32_t idx, hbool_t size_changed, size_t new_size);
|
||||
void mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr,
|
||||
H5F_t * file_ptr,
|
||||
int32_t idx);
|
||||
void mark_pinned_entry_dirty(int32_t idx, hbool_t size_changed, size_t new_size);
|
||||
void mark_pinned_or_protected_entry_dirty(int32_t idx);
|
||||
void pin_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx,
|
||||
hbool_t global, hbool_t dirty);
|
||||
void pin_protected_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
|
||||
int32_t idx, hbool_t global);
|
||||
void pin_protected_entry(int32_t idx, hbool_t global);
|
||||
void rename_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
|
||||
int32_t old_idx, int32_t new_idx);
|
||||
void resize_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
|
||||
int32_t idx, size_t new_size);
|
||||
void resize_entry(int32_t idx, size_t new_size);
|
||||
hbool_t setup_cache_for_test(hid_t * fid_ptr, H5F_t ** file_ptr_ptr,
|
||||
H5C_t ** cache_ptr_ptr);
|
||||
void setup_rand(void);
|
||||
@ -2227,7 +2222,7 @@ expunge_entry(H5C_t * cache_ptr,
|
||||
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
|
||||
HDassert( ! ((entry_ptr->header).is_dirty) );
|
||||
|
||||
result = H5C_get_entry_status(cache_ptr, entry_ptr->base_addr,
|
||||
result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr,
|
||||
NULL, &in_cache, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
if ( result < 0 ) {
|
||||
@ -2740,7 +2735,7 @@ lock_entry(H5C_t * cache_ptr,
|
||||
|
||||
HDassert( ! (entry_ptr->locked) );
|
||||
|
||||
cache_entry_ptr = H5AC_protect(file_ptr, -1, &(types[0]),
|
||||
cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, -1, &(types[0]),
|
||||
entry_ptr->base_addr,
|
||||
NULL, NULL, H5AC_WRITE);
|
||||
|
||||
@ -2786,9 +2781,7 @@ lock_entry(H5C_t * cache_ptr,
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
mark_pinned_entry_dirty(H5C_t * cache_ptr,
|
||||
H5F_t * file_ptr,
|
||||
int32_t idx,
|
||||
mark_pinned_entry_dirty(int32_t idx,
|
||||
hbool_t size_changed,
|
||||
size_t new_size)
|
||||
{
|
||||
@ -2798,8 +2791,6 @@ mark_pinned_entry_dirty(H5C_t * cache_ptr,
|
||||
|
||||
if ( nerrors == 0 ) {
|
||||
|
||||
HDassert( file_ptr );
|
||||
HDassert( cache_ptr );
|
||||
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
|
||||
HDassert( idx < virt_num_data_entries );
|
||||
|
||||
@ -2811,8 +2802,7 @@ mark_pinned_entry_dirty(H5C_t * cache_ptr,
|
||||
(entry_ptr->ver)++;
|
||||
entry_ptr->dirty = TRUE;
|
||||
|
||||
result = H5AC_mark_pinned_entry_dirty(file_ptr,
|
||||
(void *)entry_ptr,
|
||||
result = H5AC_mark_pinned_entry_dirty((void *)entry_ptr,
|
||||
size_changed,
|
||||
new_size);
|
||||
|
||||
@ -2854,9 +2844,7 @@ mark_pinned_entry_dirty(H5C_t * cache_ptr,
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr,
|
||||
H5F_t * file_ptr,
|
||||
int32_t idx)
|
||||
mark_pinned_or_protected_entry_dirty(int32_t idx)
|
||||
{
|
||||
const char * fcn_name = "mark_pinned_or_protected_entry_dirty()";
|
||||
herr_t result;
|
||||
@ -2864,8 +2852,6 @@ mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr,
|
||||
|
||||
if ( nerrors == 0 ) {
|
||||
|
||||
HDassert( file_ptr );
|
||||
HDassert( cache_ptr );
|
||||
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
|
||||
HDassert( idx < virt_num_data_entries );
|
||||
|
||||
@ -2876,8 +2862,7 @@ mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr,
|
||||
(entry_ptr->ver)++;
|
||||
entry_ptr->dirty = TRUE;
|
||||
|
||||
result = H5AC_mark_pinned_or_protected_entry_dirty(file_ptr,
|
||||
(void *)entry_ptr);
|
||||
result = H5AC_mark_pinned_or_protected_entry_dirty((void *)entry_ptr);
|
||||
|
||||
if ( result < 0 ) {
|
||||
|
||||
@ -2991,17 +2976,13 @@ pin_entry(H5C_t * cache_ptr,
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
pin_protected_entry(H5C_t * cache_ptr,
|
||||
H5F_t * file_ptr,
|
||||
int32_t idx,
|
||||
pin_protected_entry(int32_t idx,
|
||||
hbool_t global)
|
||||
{
|
||||
const char * fcn_name = "pin_protected_entry()";
|
||||
herr_t result;
|
||||
struct datum * entry_ptr;
|
||||
|
||||
HDassert( cache_ptr );
|
||||
HDassert( file_ptr );
|
||||
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
|
||||
HDassert( idx < virt_num_data_entries );
|
||||
|
||||
@ -3011,7 +2992,7 @@ pin_protected_entry(H5C_t * cache_ptr,
|
||||
|
||||
if ( nerrors == 0 ) {
|
||||
|
||||
result = H5AC_pin_protected_entry(file_ptr, (void *)entry_ptr);
|
||||
result = H5AC_pin_protected_entry((void *)entry_ptr);
|
||||
|
||||
if ( ( result < 0 ) ||
|
||||
( entry_ptr->header.type != &(types[0]) ) ||
|
||||
@ -3180,9 +3161,7 @@ rename_entry(H5C_t * cache_ptr,
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
resize_entry(H5C_t * cache_ptr,
|
||||
H5F_t * file_ptr,
|
||||
int32_t idx,
|
||||
resize_entry(int32_t idx,
|
||||
size_t new_size)
|
||||
{
|
||||
const char * fcn_name = "resize_entry()";
|
||||
@ -3191,8 +3170,6 @@ resize_entry(H5C_t * cache_ptr,
|
||||
|
||||
if ( nerrors == 0 ) {
|
||||
|
||||
HDassert( cache_ptr );
|
||||
HDassert( file_ptr );
|
||||
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
|
||||
HDassert( idx < virt_num_data_entries );
|
||||
|
||||
@ -3208,8 +3185,7 @@ resize_entry(H5C_t * cache_ptr,
|
||||
HDassert( new_size > 0 );
|
||||
HDassert( new_size <= entry_ptr->len );
|
||||
|
||||
result = H5AC_resize_pinned_entry(file_ptr, (void *)entry_ptr,
|
||||
new_size);
|
||||
result = H5AC_resize_pinned_entry((void *)entry_ptr, new_size);
|
||||
|
||||
if ( result < 0 ) {
|
||||
|
||||
@ -3295,7 +3271,7 @@ setup_cache_for_test(hid_t * fid_ptr,
|
||||
world_mpi_rank, fcn_name);
|
||||
}
|
||||
} else {
|
||||
file_ptr = H5I_object_verify(fid, H5I_FILE);
|
||||
file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE);
|
||||
}
|
||||
|
||||
if ( file_ptr == NULL ) {
|
||||
@ -3778,12 +3754,11 @@ unpin_entry(H5C_t * cache_ptr,
|
||||
|
||||
if ( dirty ) {
|
||||
|
||||
mark_pinned_entry_dirty(cache_ptr, file_ptr, idx, FALSE,
|
||||
(size_t)0);
|
||||
mark_pinned_entry_dirty(idx, FALSE, (size_t)0);
|
||||
|
||||
}
|
||||
|
||||
result = H5AC_unpin_entry(file_ptr, (void *)entry_ptr);
|
||||
result = H5AC_unpin_entry((void *)entry_ptr);
|
||||
|
||||
if ( result < 0 ) {
|
||||
|
||||
@ -5227,7 +5202,7 @@ smoke_check_5(void)
|
||||
|
||||
if ( i % 2 == 0 )
|
||||
{
|
||||
mark_pinned_or_protected_entry_dirty(cache_ptr, file_ptr, i);
|
||||
mark_pinned_or_protected_entry_dirty(i);
|
||||
}
|
||||
|
||||
unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
|
||||
@ -5259,23 +5234,21 @@ smoke_check_5(void)
|
||||
{
|
||||
if ( i % 8 <= 4 ) {
|
||||
|
||||
resize_entry(cache_ptr, file_ptr, i, data[i].len / 2);
|
||||
resize_entry(i, data[i].len / 2);
|
||||
}
|
||||
|
||||
if ( i % 4 == 0 )
|
||||
{
|
||||
mark_pinned_or_protected_entry_dirty(cache_ptr,
|
||||
file_ptr, i);
|
||||
mark_pinned_or_protected_entry_dirty(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
mark_pinned_entry_dirty(cache_ptr, file_ptr, i,
|
||||
FALSE, (size_t)0);
|
||||
mark_pinned_entry_dirty(i, FALSE, (size_t)0);
|
||||
}
|
||||
|
||||
if ( i % 8 <= 4 ) {
|
||||
|
||||
resize_entry(cache_ptr, file_ptr, i, data[i].len);
|
||||
resize_entry(i, data[i].len);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5541,22 +5514,22 @@ trace_file_check(void)
|
||||
insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET);
|
||||
|
||||
lock_entry(cache_ptr, file_ptr, 0);
|
||||
mark_pinned_or_protected_entry_dirty(cache_ptr, file_ptr, 0);
|
||||
mark_pinned_or_protected_entry_dirty(0);
|
||||
unlock_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET);
|
||||
|
||||
lock_entry(cache_ptr, file_ptr, 1);
|
||||
pin_protected_entry(cache_ptr, file_ptr, 1, TRUE);
|
||||
pin_protected_entry(1, TRUE);
|
||||
unlock_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET);
|
||||
unpin_entry(cache_ptr, file_ptr, 1, TRUE, FALSE, FALSE);
|
||||
|
||||
expunge_entry(cache_ptr,file_ptr, 1);
|
||||
|
||||
lock_entry(cache_ptr, file_ptr, 2);
|
||||
pin_protected_entry(cache_ptr, file_ptr, 2, TRUE);
|
||||
pin_protected_entry(2, TRUE);
|
||||
unlock_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET);
|
||||
mark_pinned_entry_dirty(cache_ptr, file_ptr, 2, FALSE, 0);
|
||||
resize_entry(cache_ptr, file_ptr, 2, data[2].len / 2);
|
||||
resize_entry(cache_ptr, file_ptr, 2, data[2].len);
|
||||
mark_pinned_entry_dirty(2, FALSE, 0);
|
||||
resize_entry(2, data[2].len / 2);
|
||||
resize_entry(2, data[2].len);
|
||||
unpin_entry(cache_ptr, file_ptr, 2, TRUE, FALSE, FALSE);
|
||||
|
||||
rename_entry(cache_ptr, file_ptr, 0, 20);
|
||||
|
Loading…
x
Reference in New Issue
Block a user