diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-24 20:14:07 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-24 20:14:07 (GMT) |
commit | 5f2e591745df8a05950c07e4c86de00d6678828e (patch) | |
tree | 57701de8528379a7889a7405e950e0b1c0416d78 /src/H5AC.c | |
parent | 53e4b5b90b3f5cb9dc7fbe47e6787a5280b2fa04 (diff) | |
download | hdf5-5f2e591745df8a05950c07e4c86de00d6678828e.zip hdf5-5f2e591745df8a05950c07e4c86de00d6678828e.tar.gz hdf5-5f2e591745df8a05950c07e4c86de00d6678828e.tar.bz2 |
[svn-r16607] Description:
Bring r16600:16606 back trom trunk to revise_chunks branch.
Tested:
Mac OS X/32 10.5.6 (amazon)
Too minor to require h5committest
Diffstat (limited to 'src/H5AC.c')
-rw-r--r-- | src/H5AC.c | 105 |
1 files changed, 105 insertions, 0 deletions
@@ -1826,6 +1826,59 @@ done: /*------------------------------------------------------------------------- + * Function: H5AC_create_flush_dependency() + * + * Purpose: Create a flush dependency between two entries in the metadata + * cache. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 3/24/09 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_create_flush_dependency(H5F_t * f, 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; +#endif /* H5AC__TRACE_FILE_ENABLED */ + herr_t ret_value = SUCCEED; /* Return value */ + + 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 ) ) { + sprintf(trace, "%s %lx %lx", + FUNC, + (unsigned long)(((H5C_cache_entry_t *)parent_thing)->addr), + (unsigned long)(((H5C_cache_entry_t *)child_thing)->addr)); + } /* end if */ +#endif /* H5AC__TRACE_FILE_ENABLED */ + + if(H5C_create_flush_dependency(cache_ptr, parent_thing, child_thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "H5C_create_flush_dependency() failed.") + +done: +#if H5AC__TRACE_FILE_ENABLED + if(trace_file_ptr != NULL) + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); +#endif /* H5AC__TRACE_FILE_ENABLED */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_create_flush_dependency() */ + + +/*------------------------------------------------------------------------- * Function: H5AC_protect * * Purpose: If the target entry is not in the cache, load it. If @@ -2190,6 +2243,58 @@ done: /*------------------------------------------------------------------------- + * Function: H5AC_destroy_flush_dependency() + * + * Purpose: Destroy a flush dependency between two entries. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 3/24/09 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_destroy_flush_dependency(H5F_t * f, 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; +#endif /* H5AC__TRACE_FILE_ENABLED */ + herr_t ret_value = SUCCEED; /* Return value */ + + 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 ) ) { + sprintf(trace, "%s %lx", + FUNC, + (unsigned long)(((H5C_cache_entry_t *)parent_thing)->addr), + (unsigned long)(((H5C_cache_entry_t *)child_thing)->addr)); + } /* end if */ +#endif /* H5AC__TRACE_FILE_ENABLED */ + + if(H5C_destroy_flush_dependency(cache_ptr, parent_thing, child_thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "H5C_destroy_flush_dependency() failed.") + +done: +#if H5AC__TRACE_FILE_ENABLED + if( trace_file_ptr != NULL ) + HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); +#endif /* H5AC__TRACE_FILE_ENABLED */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_destroy_flush_dependency() */ + + +/*------------------------------------------------------------------------- * Function: H5AC_unprotect * * Purpose: Undo an H5AC_protect() call -- specifically, mark the |