diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-24 20:12:44 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-24 20:12:44 (GMT) |
commit | fdedcd9ceb2b9d58ad0cf1ef29a593e824fca81e (patch) | |
tree | 68032dbecb39a8834d5182c84754ff2e213f628e /src/H5AC.c | |
parent | 667b34c713318b7a70af5c9b63fccb9ac653a201 (diff) | |
download | hdf5-fdedcd9ceb2b9d58ad0cf1ef29a593e824fca81e.zip hdf5-fdedcd9ceb2b9d58ad0cf1ef29a593e824fca81e.tar.gz hdf5-fdedcd9ceb2b9d58ad0cf1ef29a593e824fca81e.tar.bz2 |
[svn-r16606] Description:
Add H5AC_create_flush_dependency() and H5AC_destroy_flush_dependency()
wrappers for similarly named routines in H5C layer.
Tested on:
FreeBSD/32 6.3 (duty)
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 |