diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5AC.c | 55 | ||||
-rw-r--r-- | src/H5ACprivate.h | 3 | ||||
-rw-r--r-- | src/H5B.c | 56 | ||||
-rw-r--r-- | src/H5B2.c | 58 | ||||
-rw-r--r-- | src/H5B2dbg.c | 10 | ||||
-rw-r--r-- | src/H5B2int.c | 50 | ||||
-rw-r--r-- | src/H5B2stat.c | 2 | ||||
-rw-r--r-- | src/H5B2test.c | 10 | ||||
-rw-r--r-- | src/H5C.c | 83 | ||||
-rw-r--r-- | src/H5Cjournal.c | 11 | ||||
-rw-r--r-- | src/H5Cprivate.h | 19 | ||||
-rw-r--r-- | src/H5FS.c | 4 | ||||
-rw-r--r-- | src/H5FSdbg.c | 6 | ||||
-rw-r--r-- | src/H5FSsection.c | 2 | ||||
-rw-r--r-- | src/H5Gnode.c | 24 | ||||
-rw-r--r-- | src/H5HF.c | 6 | ||||
-rw-r--r-- | src/H5HFdbg.c | 10 | ||||
-rw-r--r-- | src/H5HFdblock.c | 2 | ||||
-rw-r--r-- | src/H5HFhdr.c | 4 | ||||
-rw-r--r-- | src/H5HFiblock.c | 6 | ||||
-rw-r--r-- | src/H5HFman.c | 4 | ||||
-rw-r--r-- | src/H5HFsection.c | 2 | ||||
-rw-r--r-- | src/H5HG.c | 8 | ||||
-rw-r--r-- | src/H5HGdbg.c | 2 | ||||
-rw-r--r-- | src/H5HL.c | 12 | ||||
-rw-r--r-- | src/H5O.c | 14 | ||||
-rw-r--r-- | src/H5Oalloc.c | 61 | ||||
-rw-r--r-- | src/H5Oattribute.c | 16 | ||||
-rw-r--r-- | src/H5Ochunk.c | 65 | ||||
-rw-r--r-- | src/H5Omessage.c | 8 | ||||
-rw-r--r-- | src/H5Opkg.h | 3 | ||||
-rwxr-xr-x | src/H5SM.c | 34 | ||||
-rw-r--r-- | src/H5SMtest.c | 2 |
33 files changed, 293 insertions, 359 deletions
@@ -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; diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 1bbeee5..fdad092 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -248,7 +248,6 @@ extern hid_t H5AC_ind_dxpl_id; #define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG #define H5AC__DELETED_FLAG H5C__DELETED_FLAG #define H5AC__DIRTIED_FLAG H5C__DIRTIED_FLAG -#define H5AC__SIZE_CHANGED_FLAG H5C__SIZE_CHANGED_FLAG #define H5AC__PIN_ENTRY_FLAG H5C__PIN_ENTRY_FLAG #define H5AC__UNPIN_ENTRY_FLAG H5C__UNPIN_ENTRY_FLAG #define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG @@ -312,7 +311,7 @@ H5_DLL herr_t H5AC_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5AC_unpin_entry(void *thing); H5_DLL 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); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags); H5_DLL herr_t H5AC_mark_entry_dirty(void *thing); H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, @@ -382,7 +382,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u } done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -549,14 +549,14 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, tmp_bt->left = *new_addr_p; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, (size_t)0, tmp_bt, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end if */ old_bt->right = *new_addr_p; done: - if(new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, (size_t)0, new_bt, new_bt_flags) < 0) + if(new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, new_bt, new_bt_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -633,7 +633,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, if(!lt_key_changed) HDmemcpy(lt_key, H5B_NKEY(bt,shared,0), type->sizeof_nkey); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release new child") bt = NULL; @@ -644,7 +644,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, if(!rt_key_changed) HDmemcpy(rt_key, H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, child, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release new child") bt = NULL; @@ -663,7 +663,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, bt->left = old_root; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, child, (size_t)0, bt, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release new child") bt = NULL; /* Make certain future references will be caught */ @@ -682,13 +682,13 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, if(NULL == (new_bt = H5B_copy(bt))) { HCOMMON_ERROR(H5E_BTREE, H5E_CANTCOPY, "unable to copy old root"); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release new child") HGOTO_DONE(FAIL) } /* end if */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release new child") bt = NULL; /* Make certain future references will be caught */ @@ -1086,8 +1086,8 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type done: { - herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, bt_flags) < 0); - herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, (size_t)0, twin, twin_flags) < 0); + herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) < 0); + herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, twin, twin_flags) < 0); if(e1 || e2) /*use vars to prevent short-circuit of side effects */ HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node(s)") } @@ -1150,7 +1150,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add haddr_t left_child = bt->child[0]; /* Address of left-most child in node */ /* Release current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node") bt = NULL; @@ -1177,7 +1177,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add HDmemcpy(child, bt->child, (nchildren * sizeof(haddr_t))); /* Release current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node") bt = NULL; @@ -1219,7 +1219,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add HDmemcpy(child, bt->child, nchildren * sizeof(haddr_t)); /* Unprotect node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node") bt = NULL; } /* end if */ @@ -1231,7 +1231,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add } /* end else */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node") if(native) (void)H5FL_BLK_FREE(native_block, native); @@ -1429,7 +1429,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type /* Make certain the native key for the right sibling is set up */ HDmemcpy(H5B_NKEY(sibling, shared, 0), H5B_NKEY(bt, shared, idx + 1), type->sizeof_nkey); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, (size_t)0, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ @@ -1456,7 +1456,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->right = bt->right; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, (size_t)0, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ @@ -1469,7 +1469,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->left = bt->left; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, (size_t)0, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ @@ -1477,7 +1477,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type bt->right = HADDR_UNDEF; H5_CHECK_OVERFLOW(shared->sizeof_rnode, size_t, hsize_t); if(H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)shared->sizeof_rnode) < 0 - || H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, bt_flags | H5AC__DELETED_FLAG) < 0) { + || H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags | H5AC__DELETED_FLAG) < 0) { bt = NULL; bt_flags = H5AC__NO_FLAGS_SET; HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to free B-tree node") @@ -1528,7 +1528,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDmemcpy(H5B_NKEY(sibling, shared, 0), H5B_NKEY(bt, shared, bt->nchildren), type->sizeof_nkey); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, (size_t)0, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ @@ -1557,7 +1557,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type ret_value = H5B_INS_NOOP; done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, bt_flags) < 0) + if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -1630,7 +1630,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void bt_flags |= H5AC__DIRTIED_FLAG; } /* end if */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, bt_flags) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release node") bt = NULL; /* Make certain future references will be caught */ @@ -1714,7 +1714,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree node") done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__DELETED_FLAG) < 0) + if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__DELETED_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node in cache") FUNC_LEAVE_NOAPI(ret_value) @@ -1952,7 +1952,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad info_udata->bt_info->num_nodes++; /* Release current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") bt = NULL; @@ -1974,7 +1974,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad info_udata->bt_info->num_nodes++; /* Unprotect node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") bt = NULL; } /* end while */ @@ -1987,7 +1987,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad } /* end if */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -2188,7 +2188,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f } /* end for */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -2256,7 +2256,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void cur->level = bt->level; head = tail = cur; - status = H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET); + status = H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET); HDassert(status >= 0); bt = NULL; /* Make certain future references will be caught */ @@ -2307,7 +2307,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void } /* end if */ /* Release node */ - status = H5AC_unprotect(f, dxpl_id, H5AC_BT, cur->addr, (size_t)0, bt, H5AC__NO_FLAGS_SET); + status = H5AC_unprotect(f, dxpl_id, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET); HDassert(status >= 0); bt = NULL; /* Make certain future references will be caught */ @@ -222,7 +222,7 @@ H5B2_insert(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, done: /* Release the B-tree header info */ - if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, bt2_flags) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, bt2_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") FUNC_LEAVE_NOAPI(ret_value) @@ -289,7 +289,7 @@ H5B2_iterate(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, depth = shared->depth; /* Release header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") bt2 = NULL; @@ -377,7 +377,7 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, depth = shared->depth; /* Release header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") bt2 = NULL; @@ -405,7 +405,7 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, next_node_ptr=internal->node_ptrs[idx]; /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Set pointer to next node to load */ @@ -415,14 +415,14 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, /* Make callback for current record */ if(op && (op)(H5B2_INT_NREC(internal, shared, idx), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_DONE(SUCCEED); @@ -447,7 +447,7 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if(cmp != 0) { /* Unlock leaf node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Note: don't push error on stack, leave that to next higher level, @@ -464,7 +464,7 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, /* Make callback for current record */ if(op && (op)(H5B2_LEAF_NREC(leaf, shared, idx), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") @@ -472,7 +472,7 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, } /* end else */ /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end block */ @@ -547,7 +547,7 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, depth = shared->depth; /* Release header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") bt2 = NULL; @@ -581,7 +581,7 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, next_node_ptr = internal->node_ptrs[u]; /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Set pointer to next node to load */ @@ -596,14 +596,14 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, /* Make callback for current record */ if((op)(H5B2_INT_NREC(internal, shared, u), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_DONE(SUCCEED); @@ -623,7 +623,7 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, next_node_ptr = internal->node_ptrs[u]; /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Set pointer to next node to load */ @@ -654,14 +654,14 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, /* Make callback for correct record */ if((op)(H5B2_LEAF_NREC(leaf, shared, idx), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end block */ @@ -752,7 +752,7 @@ H5B2_remove(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, done: /* Release the B-tree header info */ - if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, bt2_flags) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, bt2_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") FUNC_LEAVE_NOAPI(ret_value) @@ -846,7 +846,7 @@ H5B2_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, done: /* Release the B-tree header info */ - if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, bt2_flags) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, bt2_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") FUNC_LEAVE_NOAPI(ret_value) @@ -893,7 +893,7 @@ H5B2_get_nrec(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, done: /* Release B-tree header node */ - if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") FUNC_LEAVE_NOAPI(ret_value) @@ -968,7 +968,7 @@ H5B2_neighbor(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, done: /* Release the B-tree header info */ - if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") FUNC_LEAVE_NOAPI(ret_value) @@ -1034,7 +1034,7 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, done: /* Release the B-tree header info */ - if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__DELETED_FLAG) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__DELETED_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to delete B-tree header info") FUNC_LEAVE_NOAPI(ret_value) @@ -1108,7 +1108,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, depth = shared->depth; /* Release header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") bt2 = NULL; @@ -1137,7 +1137,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, next_node_ptr=internal->node_ptrs[idx]; /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Set pointer to next node to load */ @@ -1152,7 +1152,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, HDassert(changed==FALSE); /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree find operation") @@ -1162,7 +1162,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, internal_flags |= changed ? H5AC__DIRTIED_FLAG : 0; /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr,(size_t)0, internal, internal_flags) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, internal_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_DONE(SUCCEED); @@ -1189,7 +1189,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if(cmp != 0) { /* Unlock leaf node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Note: don't push error on stack, leave that to next higher level, @@ -1209,7 +1209,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, HDassert(changed==FALSE); /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree find operation") @@ -1220,7 +1220,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, leaf_flags |= (changed ? H5AC__DIRTIED_FLAG : 0); /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, leaf_flags) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, leaf_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } @@ -1291,7 +1291,7 @@ H5B2_iterate_size(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t add depth = shared->depth; /* Release header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") bt2 = NULL; diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index dd23432..ada729d 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -178,7 +178,7 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end for */ done: - if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") FUNC_LEAVE_NOAPI(ret_value) @@ -243,7 +243,7 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node") /* Release the B-tree header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, bt2, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") bt2 = NULL; @@ -310,7 +310,7 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, internal->node_ptrs[u].addr); done: - if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) @@ -379,7 +379,7 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree leaf node") /* Release the B-tree header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, bt2, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") bt2 = NULL; @@ -427,7 +427,7 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end for */ done: - if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, addr, leaf, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2int.c b/src/H5B2int.c index 072f9bd..a4be82b 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -531,9 +531,9 @@ H5B2_split1(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ #endif /* H5B2_DEBUG */ /* Release child nodes (marked as dirty) */ - if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, left_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") - if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, right_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") done: @@ -618,7 +618,7 @@ H5B2_split_root(H5F_t *f, hid_t dxpl_id, H5B2_t *bt2, unsigned *bt2_flags_ptr) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split old root node") /* Release new root node (marked as dirty) */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, bt2->root.addr, (size_t)0, new_root, new_root_flags) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, bt2->root.addr, new_root, new_root_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree internal node") done: @@ -844,9 +844,9 @@ H5B2_redistribute2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *int #endif /* H5B2_DEBUG */ /* Release child nodes (marked as dirty) */ - if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, left_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, right_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") done: @@ -1224,11 +1224,11 @@ H5B2_redistribute3(H5F_t *f, hid_t dxpl_id, unsigned depth, #endif /* H5B2_DEBUG */ /* Unlock child nodes (marked as dirty) */ - if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, left_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(H5AC_unprotect(f, dxpl_id, child_class, middle_addr, (size_t)0, middle_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, middle_addr, middle_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, right_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") done: @@ -1382,13 +1382,13 @@ H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, #endif /* H5B2_DEBUG */ /* Unlock left node (marked as dirty) */ - if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, left_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") /* Delete right node & remove from cache (marked as dirty) */ if(H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, right_addr, (hsize_t)shared->node_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree leaf node") - if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, right_child, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") done: @@ -1612,15 +1612,15 @@ H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, #endif /* H5B2_DEBUG */ /* Unlock left & middle nodes (marked as dirty) */ - if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, left_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(H5AC_unprotect(f, dxpl_id, child_class, middle_addr, (size_t)0, middle_child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, middle_addr, middle_child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") /* Delete right node & remove from cache (marked as dirty) */ if(H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, right_addr, (hsize_t)shared->node_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree leaf node") - if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, right_child, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") done: @@ -1719,7 +1719,7 @@ H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth, #endif /* H5B2_DEBUG */ /* Unlock child node */ - if(H5AC_unprotect(f, dxpl_id, child_class, child_addr, (size_t)0, child, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, child_class, child_addr, child, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") done: @@ -1805,7 +1805,7 @@ H5B2_insert_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, done: /* Release the B-tree leaf node (marked as dirty) */ - if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, (size_t)0, leaf, H5AC__DIRTIED_FLAG) < 0) + if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1945,7 +1945,7 @@ H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, (size_t)0, internal, internal_flags) < 0) + if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -2241,7 +2241,7 @@ H5B2_iterate_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth, HDmemcpy(native, node_native, (shared->type->nrec_size * curr_node->node_nrec)); /* Unlock the node */ - if(H5AC_unprotect(f, dxpl_id, curr_node_class, curr_node->addr, (size_t)0, node, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, curr_node_class, curr_node->addr, node, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") node = NULL; @@ -2364,7 +2364,7 @@ H5B2_remove_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, done: /* Release the B-tree leaf node */ - if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, (size_t)0, leaf, leaf_flags) < 0) + if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -2577,7 +2577,7 @@ H5B2_remove_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, internal_addr, (size_t)0, internal, internal_flags) < 0) + if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -2668,7 +2668,7 @@ H5B2_remove_leaf_by_idx(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, done: /* Release the B-tree leaf node */ - if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, (size_t)0, leaf, leaf_flags) < 0) + if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -2937,7 +2937,7 @@ H5B2_remove_internal_by_idx(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, internal_addr, (size_t)0, internal, internal_flags) < 0) + if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -3033,7 +3033,7 @@ H5B2_neighbor_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, done: /* Release the B-tree internal node */ - if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) @@ -3124,7 +3124,7 @@ H5B2_neighbor_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -3220,7 +3220,7 @@ H5B2_delete_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth, done: /* Unlock & delete current node */ if(node) - if(H5AC_unprotect(f, dxpl_id, curr_node_class, curr_node->addr, (size_t)0, node, H5AC__DELETED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, curr_node_class, curr_node->addr, node, H5AC__DELETED_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -3281,7 +3281,7 @@ H5B2_iterate_size_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned dep *btree_size += shared->node_size; done: - if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node->addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node->addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2stat.c b/src/H5B2stat.c index 8bf69ac..b50f25b 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -114,7 +114,7 @@ H5B2_stat_info(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, done: /* Release B-tree header node */ - if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2test.c b/src/H5B2test.c index 9e81551..9631267 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -280,7 +280,7 @@ H5B2_get_root_addr_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, done: /* Release B-tree header node */ - if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") FUNC_LEAVE_NOAPI(ret_value) @@ -344,7 +344,7 @@ H5B2_get_node_info_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr depth = shared->depth; /* Release header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") bt2 = NULL; @@ -372,7 +372,7 @@ H5B2_get_node_info_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr next_node_ptr = internal->node_ptrs[idx]; /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Set pointer to next node to load */ @@ -380,7 +380,7 @@ H5B2_get_node_info_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr } /* end if */ else { /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Fill in information about the node */ @@ -410,7 +410,7 @@ H5B2_get_node_info_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr cmp = H5B2_locate_record(shared->type, leaf->nrec, shared->nat_off, leaf->leaf_native, udata, &idx); /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Indicate the depth that the record was found */ @@ -3273,18 +3273,17 @@ H5C_resize_entry(void *thing, size_t new_size) } } - /* update the pinned or protected entry list */ + /* update the pinned and/or protected entry list */ if(entry_ptr->is_pinned) { H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pel_len), \ (cache_ptr->pel_size), \ (entry_ptr->size), (new_size)) } /* end if */ - else { - HDassert(entry_ptr->is_protected); + if(entry_ptr->is_protected) { H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pl_len), \ (cache_ptr->pl_size), \ (entry_ptr->size), (new_size)) - } /* end else */ + } /* end if */ /* update the hash table */ H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\ @@ -5052,14 +5051,12 @@ H5C_unprotect(H5F_t * f, const H5C_class_t * type, haddr_t addr, void * thing, - unsigned int flags, - size_t new_size) + unsigned int flags) { H5C_t * cache_ptr; hbool_t deleted; hbool_t dirtied; hbool_t set_flush_marker; - hbool_t size_changed; hbool_t pin_entry; hbool_t unpin_entry; #ifdef H5_HAVE_PARALLEL @@ -5076,16 +5073,9 @@ H5C_unprotect(H5F_t * f, deleted = ( (flags & H5C__DELETED_FLAG) != 0 ); dirtied = ( (flags & H5C__DIRTIED_FLAG) != 0 ); set_flush_marker = ( (flags & H5C__SET_FLUSH_MARKER_FLAG) != 0 ); - size_changed = ( (flags & H5C__SIZE_CHANGED_FLAG) != 0 ); pin_entry = ( (flags & H5C__PIN_ENTRY_FLAG) != 0 ); unpin_entry = ( (flags & H5C__UNPIN_ENTRY_FLAG) != 0 ); - /* Changing the size of an entry dirties it. Thus, set the - * dirtied flag if the size_changed flag is set. - */ - - dirtied |= size_changed; - HDassert( f ); HDassert( f->shared ); @@ -5097,9 +5087,6 @@ H5C_unprotect(H5F_t * f, HDassert( type ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); - HDassert( ( size_changed == TRUE ) || ( size_changed == FALSE ) ); - HDassert( ( ! size_changed ) || ( dirtied ) ); - HDassert( ( ! size_changed ) || ( new_size > 0 ) ); HDassert( ! ( pin_entry && unpin_entry ) ); entry_ptr = (H5C_cache_entry_t *)thing; @@ -5221,68 +5208,6 @@ H5C_unprotect(H5F_t * f, H5C__UPDATE_TL_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr, FAIL) } - /* update for change in entry size if necessary */ - if ( ( size_changed ) && ( entry_ptr->size != new_size ) ) { - - /* Release the current image */ - if( entry_ptr->image_ptr ) - entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); - - /* 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 ) { - - 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.") - } - } - } - } - - /* update the protected list */ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pl_len), \ - (cache_ptr->pl_size), \ - (entry_ptr->size), (new_size)); - - /* update the hash table */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\ - (new_size)); - - /* 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)); - } - - /* if journaling is enabled, and the entry is on the transaction - * list, update that list for the size changed. - */ - H5C__UPDATE_TL_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_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; - } - /* Pin or unpin the entry as requested. */ if ( pin_entry ) { diff --git a/src/H5Cjournal.c b/src/H5Cjournal.c index c3157d3..3f8a110 100644 --- a/src/H5Cjournal.c +++ b/src/H5Cjournal.c @@ -1042,10 +1042,17 @@ H5C_journal_transaction(H5F_t * f, "H5C_protect() failed.") } + result = H5C_resize_entry(thing, new_len); + + if ( result < 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_CANTJOURNAL, FAIL, \ + "H5C_resize_entry() failed.") + } + result = H5C_unprotect(f, dxpl_id, entry_ptr->type, entry_ptr->addr, - thing, H5C__SIZE_CHANGED_FLAG, - new_len); + thing, H5C__NO_FLAGS_SET); if ( result < 0 ) { diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 202221e..72d635e 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -1291,7 +1291,6 @@ typedef herr_t (*H5C_mdj_status_change_func_t)(const H5C_mdj_config_t * config_p * H5C__SET_FLUSH_MARKER_FLAG * H5C__DELETED_FLAG * H5C__DIRTIED_FLAG - * H5C__SIZE_CHANGED_FLAG * H5C__PIN_ENTRY_FLAG * H5C__UNPIN_ENTRY_FLAG * @@ -1315,14 +1314,13 @@ typedef herr_t (*H5C_mdj_status_change_func_t)(const H5C_mdj_config_t * config_p #define H5C__SET_FLUSH_MARKER_FLAG 0x0001 #define H5C__DELETED_FLAG 0x0002 #define H5C__DIRTIED_FLAG 0x0004 -#define H5C__SIZE_CHANGED_FLAG 0x0008 -#define H5C__PIN_ENTRY_FLAG 0x0010 -#define H5C__UNPIN_ENTRY_FLAG 0x0020 -#define H5C__FLUSH_INVALIDATE_FLAG 0x0040 -#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0080 -#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0100 -#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0200 -#define H5C__READ_ONLY_FLAG 0x0400 +#define H5C__PIN_ENTRY_FLAG 0x0008 +#define H5C__UNPIN_ENTRY_FLAG 0x0010 +#define H5C__FLUSH_INVALIDATE_FLAG 0x0020 +#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040 +#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080 +#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100 +#define H5C__READ_ONLY_FLAG 0x0200 H5_DLL H5C_t * H5C_create(size_t max_cache_size, size_t min_clean_size, @@ -1448,8 +1446,7 @@ H5_DLL herr_t H5C_unprotect(H5F_t * f, const H5C_class_t * type, haddr_t addr, void * thing, - unsigned int flags, - size_t new_size); + unsigned int flags); H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, unsigned int tests); @@ -216,7 +216,7 @@ HDfprintf(stderr, "%s: fspace->sinfo = %p\n", FUNC, fspace->sinfo); } /* end if */ /* Unlock free space header, now pinned */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, (size_t)0, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, NULL, "unable to release free space header") /* Set return value */ @@ -313,7 +313,7 @@ HDfprintf(stderr, "%s: Done expunging free space section info from cache\n", FUN HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to release free space header") /* Release the free space header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, (size_t)0, fspace, H5AC__DELETED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__DELETED_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space header") fspace = NULL; diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index ec5b562..4bd8732 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -167,7 +167,7 @@ H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fspace->alloc_sect_size); done: - if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, addr, (size_t)0, fspace, H5AC__NO_FLAGS_SET) < 0) + if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, addr, fspace, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header") FUNC_LEAVE_NOAPI(ret_value) @@ -267,7 +267,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, int client = fspace->client; /* Release the free space header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, (size_t)0, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header") fspace = NULL; @@ -289,7 +289,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, int } /* end switch */ done: - if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, (size_t)0, fspace, H5AC__NO_FLAGS_SET) < 0) + if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 09f75d6..6134b05 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -246,7 +246,7 @@ HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %a\n", HGOTO_ERROR(H5E_FSPACE, H5E_CANTPIN, NULL, "unable to pin free space sections") /* Unlock free space sections, now pinned */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, (size_t)0, sinfo, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, NULL, "unable to release free space sections") } /* end else */ #ifdef QAK diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 84459c1..98510ec 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -772,7 +772,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "iterator callback failed") done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, H5AC__NO_FLAGS_SET) < 0) + 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") FUNC_LEAVE_NOAPI(ret_value) @@ -943,9 +943,9 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, insert_into->nsyms += 1; done: - if(snrt && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, *new_node_p, (size_t)0, snrt, snrt_flags) < 0) + if(snrt && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, *new_node_p, snrt, snrt_flags) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, sn_flags) < 0) + if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) @@ -1094,7 +1094,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, *rt_key_changed = TRUE; sn->nsyms = 0; if(H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)H5G_node_size_real(f)) < 0 - || H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG) < 0) { + || H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG) < 0) { sn = NULL; HGOTO_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to free symbol table node") } /* end if */ @@ -1166,7 +1166,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, *rt_key_changed = TRUE; sn->nsyms = 0; if(H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)H5G_node_size_real(f)) < 0 - || H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG) < 0) { + || H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG) < 0) { sn = NULL; HGOTO_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to free symbol table node") } /* end if */ @@ -1175,7 +1175,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } /* end else */ done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, sn_flags) < 0) + if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) @@ -1254,7 +1254,7 @@ H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t ad done: /* Release resources */ - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1298,7 +1298,7 @@ H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr *num_objs += sn->nsyms; done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1359,7 +1359,7 @@ H5G_node_by_idx(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t add udata->num_objs += sn->nsyms; done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1568,7 +1568,7 @@ done: 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, (size_t)0, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1643,7 +1643,7 @@ H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_ done: /* Release the locked items */ - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1762,7 +1762,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, } /* end if */ done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, (size_t)0, sn, H5AC__NO_FLAGS_SET) < 0) + 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(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") @@ -194,7 +194,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); ret_value = fh; done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, (size_t)0, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release fractal heap header") if(!ret_value) { if(fh) @@ -268,7 +268,7 @@ HDfprintf(stderr, "%s: hdr->rc = %u, hdr->fspace = %p\n", FUNC, hdr->rc, hdr->fs ret_value = fh; done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, (size_t)0, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release fractal heap header") if(!ret_value) { if(fh) @@ -920,7 +920,7 @@ HDfprintf(stderr, "%s: fh_addr = %a\n", FUNC, fh_addr); done: /* Unprotect the header, if an error occurred */ - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, (size_t)0, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index e9c263d..e8ecdb4 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -282,7 +282,7 @@ H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end if */ done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, addr, (size_t)0, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) @@ -493,9 +493,9 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, H5_buffer_dump(stream, indent, dblock->blk, marker, (size_t)0, dblock->size); done: - if(dblock && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_DBLOCK, addr, (size_t)0, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_DBLOCK, addr, dblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap direct block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, (size_t)0, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") H5MM_xfree(marker); @@ -629,7 +629,7 @@ H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, done: if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap direct block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, (size_t)0, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) @@ -750,7 +750,7 @@ H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, } /* end if */ done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, (size_t)0, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 893ced8..c67874a 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -301,7 +301,7 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") /* Remove direct block from metadata cache */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, (size_t)0, dblock, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0) + if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") dblock = NULL; diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 3041bf1..7656469 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -1461,13 +1461,13 @@ H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap header") /* Finished deleting header */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, (size_t)0, hdr, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0) + if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap header") hdr = NULL; done: /* Unprotect the header, if an error occurred */ - if(hdr && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, (size_t)0, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index d56c093..3ce6816 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -424,7 +424,7 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si } /* end if */ /* Unlock first (previously the root) direct block */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, (size_t)0, dblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") dblock = NULL; } /* end if */ @@ -843,7 +843,7 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") done: - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, (size_t)0, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) @@ -1180,7 +1180,7 @@ H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, /* (as opposed to using an existing pointer to a pinned child indirect block) */ if(did_protect) { /* Unprotect the indirect block */ - if(H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock->addr, (size_t)0, iblock, cache_flags) < 0) + if(H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock->addr, iblock, cache_flags) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") } /* end if */ diff --git a/src/H5HFman.c b/src/H5HFman.c index 2bc9778..6d7dcde 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -187,7 +187,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj done: /* Release the direct block (marked as dirty) */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, (size_t)0, dblock, H5AC__DIRTIED_FLAG) < 0) + if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) @@ -327,7 +327,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, done: /* Unlock direct block */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, (size_t)0, dblock, dblock_cache_flags) < 0) + if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, dblock_cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 680487c..8885aad 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -1277,7 +1277,7 @@ H5HF_sect_single_valid(const H5FS_section_class_t UNUSED *cls, const H5FS_sectio (sect->sect_info.addr + sect->sect_info.size))); /* Release direct block */ - status = H5AC_unprotect(iblock->hdr->f, H5AC_dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, (size_t)0, dblock, H5AC__NO_FLAGS_SET); + status = H5AC_unprotect(iblock->hdr->f, H5AC_dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET); HDassert(status >= 0); } /* end if */ } /* end if */ @@ -651,7 +651,7 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ hobj->idx = idx; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, (size_t)0, heap, heap_flags) < 0) + if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to unprotect heap.") FUNC_LEAVE_NOAPI(ret_value) @@ -728,7 +728,7 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, ret_value = object; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, (size_t)0, heap, H5AC__NO_FLAGS_SET) < 0) + if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, NULL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -794,7 +794,7 @@ H5HG_link (H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) ret_value=heap->obj[hobj->idx].nrefs; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, (size_t)0, heap, heap_flags) < 0) + if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, heap_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value); @@ -901,7 +901,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) } /* end else */ done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, (size_t)0, heap, flags) < 0) + if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index d9767c6..38b7047 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -135,7 +135,7 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } done: - if (h && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, addr, (size_t)0, h, H5AC__NO_FLAGS_SET) < 0) + if (h && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, addr, h, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -507,11 +507,11 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) done: /* Release the prefix from the cache, now pinned */ - if(prfx && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, (size_t)0, prfx, prfx_cache_flags) < 0) + if(prfx && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, prfx_cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release local heap prefix") /* Release the data block from the cache, now pinned */ - if(dblk && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, (size_t)0, dblk, dblk_cache_flags) < 0) + if(dblk && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, dblk_cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release local heap data block") FUNC_LEAVE_NOAPI(ret_value) @@ -1136,11 +1136,11 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) done: /* Release the data block from the cache, now deleted */ - if(dblk && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, (size_t)0, dblk, cache_flags) < 0) + if(dblk && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release local heap data block") /* Release the prefix from the cache, now deleted */ - if(prfx && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, (size_t)0, prfx, cache_flags) < 0) + if(prfx && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release local heap prefix") FUNC_LEAVE_NOAPI(ret_value) @@ -1195,7 +1195,7 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size) *size = heap->dblk_size; done: - if(prfx && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, (size_t)0, prfx, H5AC__NO_FLAGS_SET) < 0) + if(prfx && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release local heap prefix") FUNC_LEAVE_NOAPI(ret_value) @@ -1250,7 +1250,7 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size) *heap_size += (hsize_t)(heap->prfx_size + heap->dblk_size); done: - if(prfx && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, (size_t)0, prfx, H5AC__NO_FLAGS_SET) < 0) + if(prfx && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release local heap prefix") FUNC_LEAVE_NOAPI(ret_value) @@ -1630,7 +1630,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) HDassert(oh->nchunks == (chkcnt + 1)); /* Release the chunk from the cache */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, (size_t)0, chk_proxy, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header chunk") /* Advance to next continuation message */ @@ -1722,7 +1722,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Unprotect chunk, marking it dirty */ - if(H5O_chunk_unprotect(loc->file, dxpl_id, oh, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(loc->file, dxpl_id, oh, chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ @@ -1741,7 +1741,7 @@ H5O_assert(oh); done: if(ret_value == NULL && oh) { - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, (size_t)0, oh, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") } /* end if */ @@ -1845,7 +1845,7 @@ H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, unsigned oh_flags) HDassert(oh); /* Unprotect the object header */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, oh->chunk[0].addr, (size_t)0, oh, oh_flags) < 0) + if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, oh->chunk[0].addr, oh, oh_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") done: @@ -1871,7 +1871,7 @@ herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ time_t now; /* Current time */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1925,7 +1925,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) /* Mark the message as dirty */ oh->mesg[idx].dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; } /* end if */ else { /* XXX: For now, update access time & change fields in the object header */ @@ -1940,7 +1940,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 4540d35..e349e5c 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -110,7 +110,7 @@ H5O_add_gap(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, unsigned idx, uint8_t *new_gap_loc, size_t new_gap_size) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ hbool_t merged_with_null; /* Whether the gap was merged with a null message */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -195,12 +195,12 @@ H5O_add_gap(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, unsigned idx, oh->chunk[chunkno].gap = new_gap_size; /* Mark the chunk as modified */ - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; } /* end if */ done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -232,7 +232,7 @@ H5O_eliminate_gap(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, uint8_t *gap_loc, size_t gap_size) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ uint8_t *move_start, *move_end; /* Pointers to area of messages to move */ hbool_t null_before_gap; /* Flag whether the null message is before the gap or not */ herr_t ret_value = SUCCEED; /* Return value */ @@ -314,11 +314,11 @@ H5O_eliminate_gap(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, /* Mark null message as dirty */ mesg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -344,7 +344,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, const H5O_msg_class_t *new_type, void *new_native, size_t new_size) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ H5O_mesg_t *alloc_msg; /* Pointer to null message to allocate out of */ herr_t ret_value = SUCCEED; /* Return value */ @@ -401,7 +401,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, null_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Check for gap in new null message's chunk */ @@ -430,11 +430,11 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, /* Mark the new message as dirty */ alloc_msg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -521,7 +521,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, size_t size, unsigned * msg_idx) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ size_t delta; /* Change in chunk's size */ size_t aligned_size = H5O_ALIGN_OH(oh, size); uint8_t *old_image; /* Old address of chunk's image in memory */ @@ -649,7 +649,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, /* Mark the extended message as dirty */ oh->mesg[extend_msg].dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Allocate more memory space for chunk's image */ old_image = oh->chunk[chunkno].image; @@ -680,7 +680,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, if(chunkno > 0 && (H5O_CONT_ID == oh->mesg[u].type->id) && (((H5O_cont_t *)(oh->mesg[u].native))->chunkno == chunkno)) { H5O_chunk_proxy_t *chk_proxy2 = NULL; /* Chunk that continuation message is in */ - unsigned chk_flags2 = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied2 = FALSE; /* Flags for unprotecting chunk */ unsigned cont_chunkno = oh->mesg[u].chunkno; /* Chunk # for continuation message */ /* Protect chunk containing continuation message */ @@ -693,23 +693,24 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, /* Flag continuation message as dirty */ oh->mesg[u].dirty = TRUE; - chk_flags2 |= H5AC__DIRTIED_FLAG; + chk_dirtied2 = TRUE; /* Release chunk containing continuation message */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy2, chk_flags2) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy2, chk_dirtied2) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ - /* Mark the chunk size in the cache as changed */ - chk_flags |= H5AC__SIZE_CHANGED_FLAG; + /* Resize the chunk in the cache */ + if(H5O_chunk_resize(oh, chk_proxy) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize object header chunk") /* Set return value */ *msg_idx = (unsigned)extend_msg; done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1004,7 +1005,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size) null_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, UFAIL, "unable to unprotect object header chunk") } /* end if */ HDassert(found_null >= 0); @@ -1150,7 +1151,7 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5O_release_mesg, FAIL) @@ -1184,10 +1185,10 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, /* Mark the message as modified */ mesg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") chk_proxy = NULL; @@ -1202,7 +1203,7 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1288,7 +1289,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") @@ -1348,9 +1349,9 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) null_msg->dirty = TRUE; /* Release chunks, marking them dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") - if(H5O_chunk_unprotect(f, dxpl_id, oh, curr_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, curr_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Check for gap in null message's chunk */ @@ -1376,7 +1377,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) null_msg->dirty = TRUE; /* Release null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Add the gap to the chunk */ @@ -1395,7 +1396,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) null_msg->dirty = TRUE; /* Release null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Create new null message for previous location of non-null message */ @@ -1422,7 +1423,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) oh->mesg[new_null_msg].dirty = TRUE; /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, curr_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, curr_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Check for gap in new null message's chunk */ @@ -1556,7 +1557,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, curr_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, curr_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Remove second message from list of messages */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 0f1cdc6..6e7c3ac 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -822,7 +822,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, { H5O_iter_wrt_t *udata = (H5O_iter_wrt_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_write_cb) @@ -851,10 +851,10 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Mark the message as modified */ mesg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; @@ -875,7 +875,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1030,7 +1030,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_rename_mod_cb) @@ -1058,10 +1058,10 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Mark the message as modified */ mesg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; @@ -1125,7 +1125,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index fb4bfe1..769b8a5 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -207,7 +207,7 @@ done: */ herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_chunk_proxy_t *chk_proxy, - unsigned chk_flags) + hbool_t dirtied) { herr_t ret_value = SUCCEED; /* Return value */ @@ -217,33 +217,22 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_chunk_proxy_t *chk_p HDassert(f); HDassert(oh); HDassert(chk_proxy); - HDassert(!(chk_flags & (unsigned)~(H5AC__DIRTIED_FLAG | H5AC__SIZE_CHANGED_FLAG))); /* Check for releasing first chunk */ if(0 == chk_proxy->chunkno) { - /* Check for resizing the first chunk */ - if(chk_flags & H5AC__SIZE_CHANGED_FLAG) { - /* Resize object header in cache */ - if(H5AC_resize_entry(oh, oh->chunk[0].size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize chunk in cache") - } /* end if */ /* Check for dirtying the first chunk */ - else if(chk_flags & H5AC__DIRTIED_FLAG) { + if(dirtied) { /* Mark object header as dirty in cache */ if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end else/if */ - else { - /* Sanity check */ - HDassert(0 && "Unknown chunk proxy flag(s)?!?"); - } /* end else */ /* Free fake chunk proxy */ chk_proxy = H5FL_FREE(H5O_chunk_proxy_t, chk_proxy); } /* end if */ else { - /* Release the chunk proxy from the cache, marking it dirty */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[chk_proxy->chunkno].addr, oh->chunk[chk_proxy->chunkno].size, chk_proxy, chk_flags) < 0) + /* Release the chunk proxy from the cache, possibly marking it dirty */ + if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[chk_proxy->chunkno].addr, chk_proxy, (dirtied ? H5AC__DIRTIED_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") } /* end else */ @@ -253,6 +242,48 @@ done: /*------------------------------------------------------------------------- + * Function: H5O_chunk_resize + * + * Purpose: Resize an object header chunk + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 6 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5O_chunk_resize, FAIL) + + /* check args */ + HDassert(oh); + HDassert(chk_proxy); + + /* Check for resizing first chunk */ + if(0 == chk_proxy->chunkno) { + /* Resize object header in cache */ + if(H5AC_resize_entry(oh, oh->chunk[0].size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize chunk in cache") + } /* end if */ + else { + /* Resize chunk in cache */ + if(H5AC_resize_entry(chk_proxy, oh->chunk[chk_proxy->chunkno].size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize chunk in cache") + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_chunk_resize() */ + + +/*------------------------------------------------------------------------- * Function: H5O_chunk_update_idx * * Purpose: Update the chunk index for a chunk proxy @@ -295,7 +326,7 @@ H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) chk_proxy->chunkno = idx; /* Release the chunk proxy from the cache, marking it deleted */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, (size_t)0, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") done: @@ -347,7 +378,7 @@ H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HDassert(chk_proxy->chunkno == idx); /* Release the chunk proxy from the cache, marking it deleted */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, (size_t)0, chk_proxy, (H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG)) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, (H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") done: diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 39a5256..bdbc726 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1996,7 +1996,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ H5O_mesg_t *idx_msg = &oh->mesg[idx]; /* Pointer to message to modify */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_copy_mesg) @@ -2024,10 +2024,10 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, /* Mark the message as modified */ idx_msg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") chk_proxy = NULL; @@ -2038,7 +2038,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, done: /* Release chunk, if not already released */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 70eeec8..57bdc0e 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -547,8 +547,9 @@ H5_DLL herr_t H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); H5_DLL H5O_chunk_proxy_t *H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); H5_DLL herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5O_chunk_proxy_t *chk_proxy, unsigned chk_flags); + H5O_chunk_proxy_t *chk_proxy, hbool_t dirtied); H5_DLL herr_t H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); +H5_DLL herr_t H5O_chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy); H5_DLL herr_t H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); /* Collect storage info for btree and heap */ @@ -376,7 +376,7 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) done: /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, (size_t)0, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI(ret_value) @@ -426,7 +426,7 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad done: /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, (size_t)0, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI(ret_value) @@ -735,7 +735,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, } /* end for */ /* Unprotect list in cache and release heap */ - if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, (size_t)0, list, H5AC__DELETED_FLAG) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to release SOHM list") *_list = list = NULL; @@ -812,7 +812,7 @@ H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_i done: /* Release the SOHM list from the cache */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, (size_t)0, list, H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to unprotect SOHM index") FUNC_LEAVE_NOAPI(ret_value) @@ -932,7 +932,7 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, done: /* Release the master SOHM table, if we protected it */ - if(my_table && my_table != table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, (size_t)0, my_table, H5AC__NO_FLAGS_SET) < 0) + if(my_table && my_table != table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, my_table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI(ret_value) @@ -1055,7 +1055,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, done: /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, (size_t)0, table, cache_flags) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, cache_flags) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI(ret_value) @@ -1348,7 +1348,7 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close fractal heap") /* If we got a list out of the cache, release it (it is always dirty after writing a message) */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, (size_t)0, list, H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") if(encoding_buf) @@ -1416,7 +1416,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index") /* Release the master SOHM table */ - if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, (size_t)0, table, cache_flags) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, cache_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table") table = NULL; @@ -1434,7 +1434,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) done: /* Release the master SOHM table (should only happen on error) */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, (size_t)0, table, cache_flags) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, cache_flags) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table") /* Release any native message we decoded */ @@ -1727,7 +1727,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, if(header->num_messages == 0) { /* Unprotect cache and release heap */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, (size_t)0, list, H5AC__DELETED_FLAG) < 0) + if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to release SOHM list") list = NULL; @@ -1751,7 +1751,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, done: /* Release the SOHM list */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, (size_t)0, list, H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") /* Release the fractal heap if we opened it */ @@ -1872,7 +1872,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) done: /* Release the master SOHM table if we took it out of the cache */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, shared->sohm_addr, (size_t)0, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI(ret_value) @@ -2127,9 +2127,9 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, done: /* Release resources */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, (size_t)0, list, H5AC__NO_FLAGS_SET) < 0) + if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, (size_t)0, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table") if(fheap && H5HF_close(fheap, dxpl_id) < 0) HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close fractal heap") @@ -2479,7 +2479,7 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, } /* end for */ done: - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, (size_t)0, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI(ret_value) @@ -2569,7 +2569,7 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, } /* end for */ done: - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, (size_t)0, list, H5AC__NO_FLAGS_SET) < 0) + if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, list, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") FUNC_LEAVE_NOAPI(ret_value) @@ -2651,7 +2651,7 @@ done: /* Release resources */ if(fheap && H5HF_close(fheap, dxpl_id) < 0) HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, (size_t)0, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 7350f28..7321da0 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -115,7 +115,7 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, done: /* Release resources */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, (size_t)0, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI(ret_value) |