summaryrefslogtreecommitdiffstats
path: root/src/H5C.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-06 13:32:07 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-06 13:32:07 (GMT)
commit5b2226efc3156536e262a2b24c78386eacdf0b73 (patch)
tree95bf9ac2d46009fe1a981af1e0e3d9004010483b /src/H5C.c
parent93170b425a30c328c3db0183d8870c6e535c9d7c (diff)
downloadhdf5-5b2226efc3156536e262a2b24c78386eacdf0b73.zip
hdf5-5b2226efc3156536e262a2b24c78386eacdf0b73.tar.gz
hdf5-5b2226efc3156536e262a2b24c78386eacdf0b73.tar.bz2
[svn-r18721] Description:
Bring r18720 from metadata journaling merging branch to trunk: Bring changes from metadata journaling branch to 'merging' branch: Rename H5[A]C_mark_pinned_or_protected_entry_dirty() to H5[A]C_mark_entry_dirty() and get rid of H5[A]C_mark_pinned_entry_dirty(). Tested on: 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-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5C.c')
-rw-r--r--src/H5C.c120
1 files changed, 5 insertions, 115 deletions
diff --git a/src/H5C.c b/src/H5C.c
index 8181f77..33402a8 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -2776,120 +2776,11 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5C_mark_pinned_entry_dirty
- *
- * Purpose: Mark a pinned entry as dirty. The target entry MUST be
- * be pinned, and MUST be unprotected.
- *
- * If the entry has changed size, the function updates
- * data structures for the size change.
- *
- * If the entry is not already dirty, the function places
- * the entry on the skip list.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: John Mainzer
- * 3/22/06
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5C_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size)
-{
- H5C_t * cache_ptr;
- H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing;
- hbool_t was_clean;
- size_t size_increase;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5C_mark_pinned_entry_dirty, FAIL)
-
- /* Sanity checks */
- HDassert(entry_ptr);
- HDassert(H5F_addr_defined(entry_ptr->addr));
- cache_ptr = entry_ptr->cache_ptr;
- HDassert(cache_ptr);
- HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
-
- /* 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 );
-
- /* mark the entry as dirty if it isn't already */
- entry_ptr->is_dirty = TRUE;
-
- /* update for change in entry size if necessary */
- if ( ( size_changed ) && ( entry_ptr->size != new_size ) ) {
-
- /* do a flash cache size increase if appropriate */
- if ( cache_ptr->flash_size_increase_possible ) {
-
- if ( new_size > entry_ptr->size ) {
-
- size_increase = new_size - entry_ptr->size;
-
- if ( size_increase >=
- cache_ptr->flash_size_increase_threshold ) {
- if(H5C__flash_increase_cache_size(cache_ptr, entry_ptr->size, new_size) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "flash cache increase failed")
- }
- }
- }
-
- /* update the pinned entry list */
- H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pel_len), \
- (cache_ptr->pel_size), \
- (entry_ptr->size), (new_size));
-
- /* update the hash table */
- H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size), \
- (new_size), (entry_ptr), (was_clean));
-
- /* if the entry is in the skip list, update that too */
- if ( entry_ptr->in_slist ) {
-
- H5C__UPDATE_SLIST_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\
- (new_size));
- }
-
- /* update statistics just before changing the entry size */
- H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_ptr), \
- (new_size));
-
- /* finally, update the entry size proper */
- entry_ptr->size = new_size;
-
- } else if ( ( was_clean ) && ( entry_ptr->is_dirty ) ) {
-
- H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr)
- }
-
- if ( ! (entry_ptr->in_slist) ) {
-
- H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL)
- }
-
- H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr)
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5C_mark_pinned_entry_dirty() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5C_mark_pinned_or_protected_entry_dirty
+ * Function: H5C_mark_entry_dirty
*
* Purpose: Mark a pinned or protected entry as dirty. The target entry
* MUST be either pinned or protected, and MAY be both.
*
- * At present, this funtion does not support size change.
- *
* In the protected case, this call is the functional
* equivalent of setting the H5C__DIRTIED_FLAG on an unprotect
* call.
@@ -2912,13 +2803,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5C_mark_pinned_or_protected_entry_dirty(void *thing)
+H5C_mark_entry_dirty(void *thing)
{
H5C_t * cache_ptr;
H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5C_mark_pinned_or_protected_entry_dirty, FAIL)
+ FUNC_ENTER_NOAPI(H5C_mark_entry_dirty, FAIL)
/* Sanity checks */
HDassert(entry_ptr);
@@ -2928,9 +2819,8 @@ H5C_mark_pinned_or_protected_entry_dirty(void *thing)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
if ( entry_ptr->is_protected ) {
-#if 0 /* JRM - uncomment this when possible */
HDassert( ! ((entry_ptr)->is_read_only) );
-#endif
+
/* set the dirtied flag */
entry_ptr->dirtied = TRUE;
@@ -2962,7 +2852,7 @@ H5C_mark_pinned_or_protected_entry_dirty(void *thing)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5C_mark_pinned_or_protected_entry_dirty() */
+} /* H5C_mark_entry_dirty() */
/*-------------------------------------------------------------------------