summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c55
1 files changed, 14 insertions, 41 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index f9cba5a..6f3c3f5 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -157,9 +157,7 @@ static herr_t H5AC_log_deleted_entry(H5AC_t * cache_ptr,
unsigned int flags);
static herr_t H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
- haddr_t addr,
- hbool_t size_changed,
- size_t new_size);
+ haddr_t addr);
static herr_t H5AC_log_flushed_entry(H5C_t * cache_ptr,
haddr_t addr,
@@ -1961,7 +1959,7 @@ H5AC_mark_entry_dirty(void *thing)
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)
+ if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry")
} /* end if */
}
@@ -2354,6 +2352,9 @@ H5AC_resize_entry(void *thing, size_t new_size)
(int)new_size);
#endif /* H5AC__TRACE_FILE_ENABLED */
+ if(H5C_resize_entry(thing, new_size) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "can't resize entry")
+
#ifdef H5_HAVE_PARALLEL
{
H5AC_info_t * entry_ptr = (H5AC_info_t *)thing;
@@ -2363,19 +2364,12 @@ H5AC_resize_entry(void *thing, size_t new_size)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) {
- /* Check for usage errors */
- if(!(entry_ptr->is_pinned || entry_ptr->is_protected))
- HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry isn't pinned or protected??")
-
- if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr, TRUE, new_size) < 0)
+ if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry")
} /* end if */
}
#endif /* H5_HAVE_PARALLEL */
- if(H5C_resize_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)
@@ -2527,17 +2521,13 @@ done:
* Modified code in support of revised cache API needed
* to permit journaling.
*
- * Note that the H5AC__SIZE_CHANGED_FLAG must now be set if
- * the size of the entry has changed.
- *
*-------------------------------------------------------------------------
*/
herr_t
H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
- size_t new_size, void *thing, unsigned flags)
+ void *thing, unsigned flags)
{
herr_t result;
- hbool_t size_changed = FALSE;
hbool_t dirtied;
#ifdef H5_HAVE_PARALLEL
H5AC_aux_t * aux_ptr = NULL;
@@ -2583,13 +2573,10 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
dirtied = (hbool_t)( ( (flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG ) ||
( ((H5AC_info_t *)thing)->dirtied ) );
- size_changed = ( (flags & H5AC__SIZE_CHANGED_FLAG) ==
- H5AC__SIZE_CHANGED_FLAG );
-
#ifdef H5_HAVE_PARALLEL
if ( ( dirtied ) && ( ((H5AC_info_t *)thing)->is_dirty == FALSE ) &&
( NULL != (aux_ptr = f->shared->cache->aux_ptr) ) ) {
- if(H5AC_log_dirtied_entry((H5AC_info_t *)thing, addr, size_changed, new_size) < 0)
+ if(H5AC_log_dirtied_entry((H5AC_info_t *)thing, addr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log dirtied entry")
}
@@ -2615,8 +2602,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
type,
addr,
thing,
- flags,
- new_size);
+ flags);
if ( result < 0 ) {
@@ -2646,9 +2632,8 @@ done:
#if H5AC__TRACE_FILE_ENABLED
if ( trace_file_ptr != NULL ) {
- HDfprintf(trace_file_ptr, "%s %d %x %d\n",
+ HDfprintf(trace_file_ptr, "%s %x %d\n",
trace,
- (int)new_size,
(unsigned)flags,
(int)ret_value);
}
@@ -4593,11 +4578,8 @@ done:
#ifdef H5_HAVE_PARALLEL
static herr_t
H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
- haddr_t addr,
- hbool_t size_changed,
- size_t new_size)
+ haddr_t addr)
{
- size_t entry_size;
H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
herr_t ret_value = SUCCEED; /* Return value */
@@ -4618,15 +4600,6 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
HDassert( aux_ptr != NULL );
HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- if ( size_changed ) {
-
- entry_size = new_size;
-
- } else {
-
- entry_size = entry_ptr->size;
- }
-
if ( aux_ptr->mpi_rank == 0 ) {
H5AC_slist_entry_t * slist_entry_ptr;
@@ -4655,9 +4628,9 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
}
aux_ptr->d_slist_len += 1;
- aux_ptr->dirty_bytes += entry_size;
+ aux_ptr->dirty_bytes += entry_ptr->size;
#if H5AC_DEBUG_DIRTY_BYTES_CREATION
- aux_ptr->unprotect_dirty_bytes += entry_size;
+ aux_ptr->unprotect_dirty_bytes += entry_ptr->size;
aux_ptr->unprotect_dirty_bytes_updates += 1;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
}
@@ -4692,7 +4665,7 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
}
} else {
- aux_ptr->dirty_bytes += entry_size;
+ aux_ptr->dirty_bytes += entry_ptr->size;
#if H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->unprotect_dirty_bytes += entry_size;
aux_ptr->unprotect_dirty_bytes_updates += 1;