From 1c425ac9d2dead1c028370a068ac7add6634ed85 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 4 Apr 2008 22:21:41 -0500 Subject: [svn-r14796] Description: Switch v1 B-tree nodes from using previous cache to use the new journaling cache code. This is a major switch for the cache callbacks. Switched the metadata caching code from having a pointer to the file it's in to receiving a pointer to the file, when needed. This was necessary in order to avoid crashing when two files IDs were open on the same underlying file and one of those files was closed with cache entries using the file pointers. Also took out the check in the caching code for reading off the end of the file, which didn't play nicely with the multi-file VFD. Switching the cache from having a pointer internally to requiring one externally meant tweaking almost all the test code. :-/ Added correct exit codes to cache2 tests that didn't have them already, so the 'make check' will stop when they fail. Use the path to the h5diff in this build in the tools/h5recover testing script, since we can't guarantee a user has HDF5 already installed. Assorted minor tweaks to get everything to compile more cleanly and pass all the tests (on my Mac :-). Tested on: Mac OS X (10.5.2) w/C++ (more testing coming up shortly, I just didn't have my "rsync testbed" set up for this branch when I started making changes to the code) --- src/H5.c | 1 + src/H5AC2.c | 73 +- src/H5AC2private.h | 4 +- src/H5Atest.c | 1 + src/H5B.c | 287 ++-- src/H5Bcache.c | 401 ++---- src/H5Bpkg.h | 27 +- src/H5Bprivate.h | 10 +- src/H5C2.c | 221 ++- src/H5C2journal.c | 119 +- src/H5C2pkg.h | 11 +- src/H5C2private.h | 63 +- src/H5D.c | 1 + src/H5Ddbg.c | 1 + src/H5Ddeprec.c | 1 + src/H5Dfill.c | 1 + src/H5Distore.c | 46 +- src/H5F.c | 81 +- src/H5Fpkg.h | 3 +- src/H5Fprivate.h | 17 +- src/H5Gnode.c | 60 +- src/H5I.c | 1 + src/H5Omdj_msg.c | 25 +- src/H5Pdcpl.c | 1 + src/H5Pfapl.c | 1 + src/H5R.c | 1 + src/H5Rdeprec.c | 1 + src/H5T.c | 1 + src/H5Tcommit.c | 1 + src/H5Tdeprec.c | 1 + src/H5Zscaleoffset.c | 1 + test/cache2.c | 2643 ++++++++++++++++++----------------- test/cache2_api.c | 78 +- test/cache2_common.c | 304 ++-- test/cache2_common.h | 54 +- test/cache2_journal.c | 68 +- tools/h5recover/testh5recover.sh.in | 7 +- 37 files changed, 2369 insertions(+), 2248 deletions(-) diff --git a/src/H5.c b/src/H5.c index 39f7b3a..049501c 100644 --- a/src/H5.c +++ b/src/H5.c @@ -22,6 +22,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ diff --git a/src/H5AC2.c b/src/H5AC2.c index 49e4934..c4575b7 100644 --- a/src/H5AC2.c +++ b/src/H5AC2.c @@ -196,7 +196,7 @@ static herr_t H5AC2_receive_and_apply_clean_list(H5F_t * f, hid_t dxpl_id, H5AC2_t * cache_ptr); -static herr_t H5AC2_log_renamed_entry(H5AC2_t * cache_ptr, +static herr_t H5AC2_log_renamed_entry(H5F_t * f, haddr_t old_addr, haddr_t new_addr); #endif /* H5_HAVE_PARALLEL */ @@ -617,8 +617,7 @@ H5AC2_create(const H5F_t *f, if ( aux_ptr->mpi_rank == 0 ) { - f->shared->cache2 = H5C2_create(f, - H5AC2__DEFAULT_MAX_CACHE_SIZE, + f->shared->cache2 = H5C2_create(H5AC2__DEFAULT_MAX_CACHE_SIZE, H5AC2__DEFAULT_MIN_CLEAN_SIZE, (H5AC2_NTYPES - 1), (const char **)H5AC2_entry_type_names, @@ -629,8 +628,7 @@ H5AC2_create(const H5F_t *f, } else { - f->shared->cache2 = H5C2_create(f, - H5AC2__DEFAULT_MAX_CACHE_SIZE, + f->shared->cache2 = H5C2_create(H5AC2__DEFAULT_MAX_CACHE_SIZE, H5AC2__DEFAULT_MIN_CLEAN_SIZE, (H5AC2_NTYPES - 1), (const char **)H5AC2_entry_type_names, @@ -646,8 +644,7 @@ H5AC2_create(const H5F_t *f, } else { - f->shared->cache2 = H5C2_create(f, - H5AC2__DEFAULT_MAX_CACHE_SIZE, + f->shared->cache2 = H5C2_create(H5AC2__DEFAULT_MAX_CACHE_SIZE, H5AC2__DEFAULT_MIN_CLEAN_SIZE, (H5AC2_NTYPES - 1), (const char **)H5AC2_entry_type_names, @@ -663,8 +660,7 @@ H5AC2_create(const H5F_t *f, * -- JRM */ - f->shared->cache2 = H5C2_create(f, - H5AC2__DEFAULT_MAX_CACHE_SIZE, + f->shared->cache2 = H5C2_create(H5AC2__DEFAULT_MAX_CACHE_SIZE, H5AC2__DEFAULT_MIN_CLEAN_SIZE, (H5AC2_NTYPES - 1), (const char **)H5AC2_entry_type_names, @@ -694,7 +690,7 @@ H5AC2_create(const H5F_t *f, } #endif /* H5_HAVE_PARALLEL */ - result = H5AC2_set_cache_auto_resize_config(f->shared->cache2, config_ptr); + result = H5AC2_set_cache_auto_resize_config(f, config_ptr); if ( result != SUCCEED ) { @@ -803,7 +799,7 @@ H5AC2_dest(H5F_t *f, hid_t dxpl_id) } #endif /* H5AC2__TRACE_FILE_ENABLED */ - if ( H5C2_dest(cache, dxpl_id) < 0 ) { + if ( H5C2_dest(f, dxpl_id) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache") } @@ -895,7 +891,7 @@ H5AC2_expunge_entry(H5F_t *f, } #endif /* H5AC2__TRACE_FILE_ENABLED */ - result = H5C2_expunge_entry(cache_ptr, + result = H5C2_expunge_entry(f, dxpl_id, type, addr); @@ -1076,7 +1072,7 @@ H5AC2_flush(H5F_t *f, hid_t dxpl_id, unsigned flags) aux_ptr->write_permitted = TRUE; - status = H5C2_flush_cache(f->shared->cache2, + status = H5C2_flush_cache(f, dxpl_id, init_flush_flags); @@ -1101,7 +1097,7 @@ H5AC2_flush(H5F_t *f, hid_t dxpl_id, unsigned flags) } /* end if ( aux_ptr != NULL ) */ #endif /* H5_HAVE_PARALLEL */ - status = H5C2_flush_cache(f->shared->cache2, + status = H5C2_flush_cache(f, dxpl_id, flags); @@ -1157,7 +1153,6 @@ H5AC2_get_entry_status(H5F_t * f, haddr_t addr, unsigned * status_ptr) { - H5C2_t *cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ herr_t result; hbool_t in_cache; @@ -1169,15 +1164,15 @@ H5AC2_get_entry_status(H5F_t * f, FUNC_ENTER_NOAPI(H5AC2_get_entry_status, FAIL) - if ( ( cache_ptr == NULL ) || - ( cache_ptr->magic != H5C2__H5C2_T_MAGIC ) || + if ( ( f->shared->cache2 == NULL ) || + ( f->shared->cache2->magic != H5C2__H5C2_T_MAGIC ) || ( ! H5F_addr_defined(addr) ) || ( status_ptr == NULL ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.") } - result = H5C2_get_entry_status(cache_ptr, addr, &entry_size, &in_cache, + result = H5C2_get_entry_status(f, addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); if ( result < 0 ) { @@ -1282,7 +1277,6 @@ H5AC2_set(H5F_t *f, hid_t dxpl_id, const H5AC2_class_t *type, haddr_t addr, size { herr_t result; H5AC2_info_t *info; - H5AC2_t *cache; herr_t ret_value=SUCCEED; /* Return value */ #ifdef H5_HAVE_PARALLEL H5AC2_aux_t * aux_ptr = NULL; @@ -1325,7 +1319,6 @@ H5AC2_set(H5F_t *f, hid_t dxpl_id, const H5AC2_class_t *type, haddr_t addr, size #endif /* H5AC2__TRACE_FILE_ENABLED */ /* Get local copy of this information */ - cache = f->shared->cache2; info = (H5AC2_info_t *)thing; info->addr = addr; @@ -1350,7 +1343,7 @@ H5AC2_set(H5F_t *f, hid_t dxpl_id, const H5AC2_class_t *type, haddr_t addr, size } #endif /* H5_HAVE_PARALLEL */ - result = H5C2_insert_entry(cache, + result = H5C2_insert_entry(f, dxpl_id, type, addr, @@ -1432,7 +1425,9 @@ H5AC2_mark_pinned_entry_dirty(H5F_t * f, hbool_t size_changed, size_t new_size) { +#ifdef H5_HAVE_PARALLEL H5C2_t *cache_ptr = f->shared->cache2; +#endif /* H5_HAVE_PARALLEL */ herr_t result; herr_t ret_value = SUCCEED; /* Return value */ #if H5AC2__TRACE_FILE_ENABLED @@ -1501,7 +1496,7 @@ H5AC2_mark_pinned_entry_dirty(H5F_t * f, } #endif /* H5_HAVE_PARALLEL */ - result = H5C2_mark_pinned_entry_dirty(cache_ptr, + result = H5C2_mark_pinned_entry_dirty(f, thing, size_changed, new_size); @@ -1553,8 +1548,8 @@ herr_t H5AC2_mark_pinned_or_protected_entry_dirty(H5F_t * f, void * thing) { - H5C2_t * cache_ptr = f->shared->cache2; #ifdef H5_HAVE_PARALLEL + H5C2_t * cache_ptr = f->shared->cache2; H5AC2_info_t * info_ptr; #endif /* H5_HAVE_PARALLEL */ herr_t result; @@ -1609,7 +1604,7 @@ H5AC2_mark_pinned_or_protected_entry_dirty(H5F_t * f, } #endif /* H5_HAVE_PARALLEL */ - result = H5C2_mark_pinned_or_protected_entry_dirty(cache_ptr, thing); + result = H5C2_mark_pinned_or_protected_entry_dirty(f, thing); if ( result < 0 ) { @@ -1724,7 +1719,7 @@ H5AC2_rename(H5F_t *f, const H5AC2_class_t *type, haddr_t old_addr, haddr_t new_ #ifdef H5_HAVE_PARALLEL if ( NULL != (aux_ptr = f->shared->cache2->aux_ptr) ) { - result = H5AC2_log_renamed_entry(f->shared->cache2, + result = H5AC2_log_renamed_entry(f, old_addr, new_addr); @@ -1801,7 +1796,6 @@ herr_t H5AC2_pin_protected_entry(H5F_t * f, void * thing) { - H5C2_t *cache_ptr = f->shared->cache2; herr_t result; herr_t ret_value = SUCCEED; /* Return value */ #if H5AC2__TRACE_FILE_ENABLED @@ -1826,7 +1820,7 @@ H5AC2_pin_protected_entry(H5F_t * f, } #endif /* H5AC2__TRACE_FILE_ENABLED */ - result = H5C2_pin_protected_entry(cache_ptr, thing); + result = H5C2_pin_protected_entry(f, thing); if ( result < 0 ) { @@ -1995,7 +1989,7 @@ H5AC2_protect(H5F_t *f, protect_flags |= H5C2__READ_ONLY_FLAG; } - thing = H5C2_protect(f->shared->cache2, + thing = H5C2_protect(f, dxpl_id, type, addr, @@ -2059,7 +2053,9 @@ H5AC2_resize_pinned_entry(H5F_t * f, void * thing, size_t new_size) { +#ifdef H5_HAVE_PARALLEL H5C2_t *cache_ptr = f->shared->cache2; +#endif /* H5_HAVE_PARALLEL */ herr_t result; herr_t ret_value = SUCCEED; /* Return value */ #if H5AC2__TRACE_FILE_ENABLED @@ -2125,7 +2121,7 @@ H5AC2_resize_pinned_entry(H5F_t * f, } #endif /* H5_HAVE_PARALLEL */ - result = H5C2_resize_pinned_entry(cache_ptr, + result = H5C2_resize_pinned_entry(f, thing, new_size); if ( result < 0 ) { @@ -2173,7 +2169,6 @@ herr_t H5AC2_unpin_entry(H5F_t * f, void * thing) { - H5C2_t *cache_ptr = f->shared->cache2; herr_t result; herr_t ret_value = SUCCEED; /* Return value */ #if H5AC2__TRACE_FILE_ENABLED @@ -2198,7 +2193,7 @@ H5AC2_unpin_entry(H5F_t * f, } #endif /* H5AC2__TRACE_FILE_ENABLED */ - result = H5C2_unpin_entry(cache_ptr, thing); + result = H5C2_unpin_entry(f, thing); if ( result < 0 ) { @@ -2406,7 +2401,7 @@ H5AC2_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC2_class_t *type, } #endif /* H5_HAVE_PARALLEL */ - result = H5C2_unprotect(f->shared->cache2, + result = H5C2_unprotect(f, dxpl_id, type, addr, @@ -2883,10 +2878,11 @@ done: */ herr_t -H5AC2_set_cache_auto_resize_config(H5AC2_t * cache_ptr, +H5AC2_set_cache_auto_resize_config(const H5F_t * f, H5AC2_cache_config_t *config_ptr) { /* const char * fcn_name = "H5AC2_set_cache_auto_resize_config"; */ + H5AC2_t * cache_ptr = (H5AC2_t *)f->shared->cache2; herr_t result; herr_t ret_value = SUCCEED; /* Return value */ H5C2_auto_size_ctl_t internal_config; @@ -2994,7 +2990,7 @@ H5AC2_set_cache_auto_resize_config(H5AC2_t * cache_ptr, "H5AC2_ext_config_2_int_config() failed.") } - result = H5C2_set_cache_auto_resize_config((H5C2_t *)cache_ptr, + result = H5C2_set_cache_auto_resize_config(f, &internal_config); if ( result < 0 ) { @@ -3003,7 +2999,7 @@ H5AC2_set_cache_auto_resize_config(H5AC2_t * cache_ptr, } - result = H5C2_set_evictions_enabled((H5C2_t *)cache_ptr, + result = H5C2_set_evictions_enabled(f, config_ptr->evictions_enabled); if ( result < 0 ) { @@ -4333,11 +4329,12 @@ done: #ifdef H5_HAVE_PARALLEL static herr_t -H5AC2_log_renamed_entry(H5AC2_t * cache_ptr, +H5AC2_log_renamed_entry(H5F_t * f, haddr_t old_addr, haddr_t new_addr) { herr_t ret_value = SUCCEED; /* Return value */ + H5AC2_t * cache_ptr = (H5AC2_t *)f->shared->cache2; hbool_t entry_in_cache; hbool_t entry_dirty; size_t entry_size; @@ -4355,7 +4352,7 @@ H5AC2_log_renamed_entry(H5AC2_t * cache_ptr, HDassert( aux_ptr->magic == H5AC2__H5AC2_AUX_T_MAGIC ); /* get entry status, size, etc here */ - if ( H5C2_get_entry_status(cache_ptr, old_addr, &entry_size, &entry_in_cache, + if ( H5C2_get_entry_status(f, old_addr, &entry_size, &entry_in_cache, &entry_dirty, NULL, NULL) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get entry status.") @@ -4609,7 +4606,7 @@ H5AC2_propagate_flushed_and_still_clean_entries_list(H5F_t * f, aux_ptr->write_permitted = TRUE; - result = H5C2_flush_to_min_clean(cache_ptr, dxpl_id); + result = H5C2_flush_to_min_clean(f, dxpl_id); aux_ptr->write_permitted = FALSE; diff --git a/src/H5AC2private.h b/src/H5AC2private.h index ca2522f..6676d7e 100644 --- a/src/H5AC2private.h +++ b/src/H5AC2private.h @@ -128,7 +128,7 @@ typedef enum { typedef H5C2_deserialize_func_t H5AC2_deserialize_func_t; typedef H5C2_image_len_func_t H5AC2_image_len_func_t; typedef H5C2_serialize_func_t H5AC2_serialize_func_t; -typedef H5C2_free_icr_func_t H5CA2_free_icr_func_t; +typedef H5C2_free_icr_func_t H5AC2_free_icr_func_t; typedef H5C2_clear_dirty_bits_func_t H5AC2_clear_dirty_bits_func_t; typedef H5C2_class_t H5AC2_class_t; @@ -305,7 +305,7 @@ H5_DLL herr_t H5AC2_get_cache_hit_rate(H5AC2_t * cache_ptr, H5_DLL herr_t H5AC2_reset_cache_hit_rate_stats(H5AC2_t * cache_ptr); -H5_DLL herr_t H5AC2_set_cache_auto_resize_config(H5AC2_t * cache_ptr, +H5_DLL herr_t H5AC2_set_cache_auto_resize_config(const H5F_t * f, H5AC2_cache_config_t *config_ptr); H5_DLL herr_t H5AC2_validate_config(H5AC2_cache_config_t * config_ptr); diff --git a/src/H5Atest.c b/src/H5Atest.c index df88472..845c6c8 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -37,6 +37,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5SMprivate.h" /* Shared object header messages */ diff --git a/src/H5B.c b/src/H5B.c index 9847b7a..01dc119 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -236,6 +236,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, bt->nchildren = 0; if((bt->rc_shared=(type->get_shared)(f, udata))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree node buffer") + H5RC_INC(bt->rc_shared); shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); if (NULL==(bt->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) || @@ -247,7 +248,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, /* * Cache the new B-tree node. */ - if (H5AC_set(f, dxpl_id, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC2_set(f, dxpl_id, H5AC2_BT, *addr_p, shared->sizeof_rnode, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache") #ifdef H5B_DEBUG H5B_assert(f, dxpl_id, *addr_p, shared->type, udata); @@ -260,7 +261,7 @@ done: (void)H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, *addr_p, (hsize_t)shared->sizeof_rnode); } /* end if */ if (bt) - (void)H5B_dest(f,bt); + (void)H5B_dest(bt); } FUNC_LEAVE_NOAPI(ret_value) @@ -297,8 +298,10 @@ herr_t H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) { H5B_t *bt = NULL; - H5B_shared_t *shared; /* Pointer to shared B-tree info */ - unsigned idx=0, lt = 0, rt; /* Final, left & right key indices */ + H5RC_t *rc_shared; /* Ref-counted shared info */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ + unsigned idx=0, lt = 0, rt; /* Final, left & right key indices */ int cmp = 1; /* Key comparison value */ int ret_value = SUCCEED; /* Return value */ @@ -314,14 +317,21 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u assert(type->found); assert(H5F_addr_defined(addr)); + /* Get shared info for B-tree */ + if(NULL == (rc_shared = (type->get_shared)(f, udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree's shared ref. count object") + shared = (H5B_shared_t *)H5RC_GET_OBJ(rc_shared); + HDassert(shared); + /* * Perform a binary search to locate the child which contains * the thing for which we're searching. */ - if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) + cache_udata.f = f; + cache_udata.type = type; + cache_udata.rc_shared = rc_shared; + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node") - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); rt = bt->nchildren; while (lt < rt && cmp) { @@ -375,8 +385,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, bt, H5AC__NO_FLAGS_SET) - < 0) + if(bt && H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -425,6 +434,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, { H5P_genplist_t *dx_plist; /* Data transfer property list */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ unsigned new_bt_flags = H5AC__NO_FLAGS_SET; H5B_t *new_bt = NULL; unsigned nleft, nright; /* Number of keys in left & right halves */ @@ -507,7 +517,10 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, */ if (H5B_create(f, dxpl_id, shared->type, udata, new_addr_p/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create B-tree") - if (NULL==(new_bt=(H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, *new_addr_p, shared->type, udata, H5AC_WRITE))) + cache_udata.f = f; + cache_udata.type = shared->type; + cache_udata.rc_shared = old_bt->rc_shared; + if(NULL == (new_bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, *new_addr_p, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to protect B-tree") new_bt->level = old_bt->level; @@ -544,24 +557,26 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, new_bt->left = old_addr; new_bt->right = old_bt->right; - if (H5F_addr_defined(old_bt->right)) { + if(H5F_addr_defined(old_bt->right)) { H5B_t *tmp_bt; + H5B_cache_ud_t cache_udata2; /* User-data for metadata cache callback */ - if (NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, old_bt->right, shared->type, udata, H5AC_WRITE))) + cache_udata2.f = f; + cache_udata2.type = shared->type; + cache_udata2.rc_shared = old_bt->rc_shared; + if(NULL == (tmp_bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, old_bt->right, shared->sizeof_rnode, &cache_udata2, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load right sibling") tmp_bt->left = *new_addr_p; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, - H5AC__DIRTIED_FLAG) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, old_bt->right, (size_t)0, tmp_bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, 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, new_bt, - new_bt_flags) < 0) + if(new_bt && H5AC2_unprotect(f, dxpl_id, H5AC2_BT, *new_addr_p, (size_t)0, new_bt, new_bt_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -618,7 +633,9 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, unsigned level; H5B_t *bt; H5B_t *new_bt; /* Copy of B-tree info */ + H5RC_t *rc_shared; /* Ref-counted shared info */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ H5B_ins_t my_ins = H5B_INS_ERROR; herr_t ret_value = SUCCEED; @@ -635,31 +652,38 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key") if (H5B_INS_NOOP == my_ins) HGOTO_DONE(SUCCEED) - assert(H5B_INS_RIGHT == my_ins); + HDassert(H5B_INS_RIGHT == my_ins); + + /* Get shared info for B-tree */ + if(NULL == (rc_shared = (type->get_shared)(f, udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree's shared ref. count object") + shared = (H5B_shared_t *)H5RC_GET_OBJ(rc_shared); + HDassert(shared); /* the current root */ - if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) + cache_udata.f = f; + cache_udata.type = type; + cache_udata.rc_shared = rc_shared; + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to locate root of B-tree") - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); level = bt->level; if (!lt_key_changed) HDmemcpy(lt_key, H5B_NKEY(bt,shared,0), type->sizeof_nkey); - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; /* the new node */ - if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child, type, udata, H5AC_READ))) + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, child, shared->sizeof_rnode, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load new node") 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, bt, H5AC__NO_FLAGS_SET) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, child, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; @@ -673,21 +697,21 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate file space to move root") /* update the new child's left pointer */ - if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child, type, udata, H5AC_WRITE))) + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, child, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load new child") bt->left = old_root; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, H5AC__DIRTIED_FLAG) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, child, (size_t)0, bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") - bt=NULL; /* Make certain future references will be caught */ + bt = NULL; /* Make certain future references will be caught */ /* * Move the node to the new location by checking it out & checking it in * at the new location -QAK */ /* Bring the old root into the cache if it's not already */ - if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load new child") /* Make certain the old root info is marked as dirty before moving it, */ @@ -697,18 +721,18 @@ 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_CANTLOAD, "unable to copy old root"); - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__DIRTIED_FLAG) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") HGOTO_DONE(FAIL) } - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__DIRTIED_FLAG) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") - bt=NULL; /* Make certain future references will be caught */ + bt = NULL; /* Make certain future references will be caught */ /* Move the location of the old root on the disk */ - if (H5AC_rename(f, H5AC_BT, addr, old_root) < 0) + if(H5AC2_rename(f, H5AC2_BT, addr, old_root) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node") /* clear the old root info at the old address (we already copied it) */ @@ -728,7 +752,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HDmemcpy(H5B_NKEY(new_bt,shared,2), rt_key, shared->type->sizeof_nkey); /* Insert the modified copy of the old root into the file again */ - if (H5AC_set(f, dxpl_id, H5AC_BT, addr, new_bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC2_set(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, new_bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to flush old B-tree root node") #ifdef H5B_DEBUG @@ -885,7 +909,9 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type { unsigned bt_flags = H5AC__NO_FLAGS_SET, twin_flags = H5AC__NO_FLAGS_SET; H5B_t *bt = NULL, *twin = NULL; + H5RC_t *rc_shared; /* Ref-counted shared info */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ unsigned lt = 0, idx = 0, rt; /* Left, final & right index values */ int cmp = -1; /* Key comparison value */ haddr_t child_addr = HADDR_UNDEF; @@ -912,15 +938,22 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type *lt_key_changed = FALSE; *rt_key_changed = FALSE; + /* Get shared info for B-tree */ + if(NULL == (rc_shared = (type->get_shared)(f, udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree's shared ref. count object") + shared = (H5B_shared_t *)H5RC_GET_OBJ(rc_shared); + HDassert(shared); + /* * Use a binary search to find the child that will receive the new * data. When the search completes IDX points to the child that * should get the new data. */ - if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + cache_udata.f = f; + cache_udata.type = type; + cache_udata.rc_shared = rc_shared; + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to load node") - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); rt = bt->nchildren; while (lt < rt && cmp) { @@ -1088,7 +1121,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type if (bt->nchildren == shared->two_k) { if (H5B_split(f, dxpl_id, bt, &bt_flags, addr, idx, udata, new_node_p/*out*/)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, H5B_INS_ERROR, "unable to split node") - if (NULL == (twin = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, *new_node_p, type, udata, H5AC_WRITE))) + if(NULL == (twin = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, *new_node_p, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to load node") if (idxnchildren) { tmp_bt = bt; @@ -1130,10 +1163,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, bt, - bt_flags) < 0); - herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, - twin, twin_flags)<0); + herr_t e1 = (bt && H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, bt_flags) < 0); + herr_t e2 = (twin && H5AC2_unprotect(f, dxpl_id, H5AC2_BT, *new_node_p, (size_t)0, twin, twin_flags) < 0); if (e1 || e2) /*use vars to prevent short-circuit of side effects */ HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node(s)") } @@ -1175,6 +1206,9 @@ herr_t H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op, haddr_t addr, void *udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ + H5RC_t *rc_shared; /* Ref-counted shared info */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ herr_t ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5B_iterate, FAIL) @@ -1188,8 +1222,17 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op, HDassert(H5F_addr_defined(addr)); HDassert(udata); + /* Get shared info for B-tree */ + if(NULL == (rc_shared = (type->get_shared)(f, udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree's shared ref. count object") + shared = (H5B_shared_t *)H5RC_GET_OBJ(rc_shared); + HDassert(shared); + /* Protect the initial/current node */ - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) + cache_udata.f = f; + cache_udata.type = type; + cache_udata.rc_shared = rc_shared; + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node") if(bt->level > 0) { @@ -1226,7 +1269,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op, /* Protect the next node to the right, if there is one */ if(H5F_addr_defined(bt->right)) { next_addr = bt->right; - if(NULL == (next_bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, next_addr, type, udata, H5AC_READ))) + if(NULL == (next_bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, next_addr, shared->sizeof_rnode, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "B-tree node") } /* end if */ else { @@ -1235,10 +1278,10 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op, } /* end if */ /* Unprotect this node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) { + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) { if(next_bt) { HDassert(H5F_addr_defined(next_addr)); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, next_addr, next_bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, next_addr, (size_t)0, next_bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") } /* end if */ HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") @@ -1252,7 +1295,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op, } /* end else */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1300,7 +1343,9 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type { H5B_t *bt = NULL, *sibling = NULL; unsigned bt_flags = H5AC__NO_FLAGS_SET; - H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5RC_t *rc_shared; /* Ref-counted shared info */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ unsigned idx=0, lt=0, rt; /* Final, left & right indices */ int cmp=1; /* Key comparison value */ H5B_ins_t ret_value = H5B_INS_ERROR; @@ -1316,14 +1361,21 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type assert(udata); assert(rt_key && rt_key_changed); + /* Get shared info for B-tree */ + if(NULL == (rc_shared = (type->get_shared)(f, udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree's shared ref. count object") + shared = (H5B_shared_t *)H5RC_GET_OBJ(rc_shared); + HDassert(shared); + /* * Perform a binary search to locate the child which contains the thing * for which we're searching. */ - if (NULL==(bt=(H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + cache_udata.f = f; + cache_udata.type = type; + cache_udata.rc_shared = rc_shared; + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to load B-tree node") - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); rt = bt->nchildren; while (lt0) { if (H5F_addr_defined(bt->right)) { - if (NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, type, udata, H5AC_WRITE))) + if(NULL == (sibling = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, bt->right, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to unlink node from tree") /* 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, sibling, - H5AC__DIRTIED_FLAG) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, bt->right, (size_t)0, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ } @@ -1431,18 +1482,17 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type bt->nchildren = 0; if (level>0) { if (H5F_addr_defined(bt->left)) { - if (NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, type, udata, H5AC_WRITE))) + if(NULL == (sibling = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, bt->left, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to load node from tree") sibling->right = bt->right; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, - H5AC__DIRTIED_FLAG) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, bt->left, (size_t)0, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ } if (H5F_addr_defined(bt->right)) { - if (NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, type, udata, H5AC_WRITE))) + if(NULL == (sibling = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, bt->right, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to unlink node from tree") /* Copy left-most key from deleted node to left-most key in it's right neighbor */ @@ -1450,8 +1500,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, sibling, - H5AC__DIRTIED_FLAG) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, bt->right, (size_t)0, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ } @@ -1459,7 +1508,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, bt, bt_flags | H5C__DELETED_FLAG)<0) { + || H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, bt_flags | H5C__DELETED_FLAG) < 0) { bt = NULL; bt_flags = H5AC__NO_FLAGS_SET; HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to free B-tree node") @@ -1507,13 +1556,12 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ if (level>0) { if (H5F_addr_defined(bt->right)) { - if (NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, type, udata, H5AC_WRITE))) + if(NULL == (sibling = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, bt->right, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to unlink node from tree") 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, sibling, - H5AC__DIRTIED_FLAG) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, bt->right, (size_t)0, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ } @@ -1545,7 +1593,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type } done: - if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags)<0) + if(bt && H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, bt_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -1588,6 +1636,9 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void hbool_t rt_key_changed = FALSE; /*right key changed?*/ unsigned bt_flags = H5AC__NO_FLAGS_SET; H5B_t *bt = NULL; /*btree node */ + H5RC_t *rc_shared; /* Ref-counted shared info */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5B_remove, FAIL) @@ -1603,11 +1654,20 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void udata, rt_key, &rt_key_changed)==H5B_INS_ERROR) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree") + /* Get shared info for B-tree */ + if(NULL == (rc_shared = (type->get_shared)(f, udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree's shared ref. count object") + shared = (H5B_shared_t *)H5RC_GET_OBJ(rc_shared); + HDassert(shared); + /* * If the B-tree is now empty then make sure we mark the root node as * being at level zero */ - if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + cache_udata.f = f; + cache_udata.type = type; + cache_udata.rc_shared = rc_shared; + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree root node") if (0==bt->nchildren && 0!=bt->level) { @@ -1615,7 +1675,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void bt_flags |= H5AC__DIRTIED_FLAG; } - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) != SUCCEED) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, bt_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node") bt=NULL; /* Make certain future references will be caught */ @@ -1650,8 +1710,10 @@ done: herr_t H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) { - H5B_t *bt; /* B-tree node being operated on */ - H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_t *bt = NULL; /* B-tree node being operated on */ + H5RC_t *rc_shared; /* Ref-counted shared info */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ @@ -1662,11 +1724,18 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void assert(type); assert(H5F_addr_defined(addr)); + /* Get shared info for B-tree */ + if(NULL == (rc_shared = (type->get_shared)(f, udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree's shared ref. count object") + shared = (H5B_shared_t *)H5RC_GET_OBJ(rc_shared); + HDassert(shared); + /* Lock this B-tree node into memory for now */ - if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + cache_udata.f = f; + cache_udata.type = type; + cache_udata.rc_shared = rc_shared; + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node") - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); /* Iterate over all children in tree, deleting them */ if (bt->level > 0) { @@ -1696,7 +1765,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, bt, H5C__DELETED_FLAG)<0) + if(bt && H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5C__DELETED_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node in cache") FUNC_LEAVE_NOAPI(ret_value) @@ -1846,7 +1915,9 @@ H5B_iterate_size(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op, haddr_t addr, H5B_info_ud_t *bh_udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ - H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5RC_t *rc_shared; /* Ref-counted shared info */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5B_iterate_size, FAIL) @@ -1859,11 +1930,18 @@ H5B_iterate_size(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, HDassert(H5F_addr_defined(addr)); HDassert(bh_udata); + /* Get shared info for B-tree */ + if(NULL == (rc_shared = (type->get_shared)(f, bh_udata->udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree's shared ref. count object") + shared = (H5B_shared_t *)H5RC_GET_OBJ(rc_shared); + HDassert(shared); + /* Protect the initial/current node */ - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, bh_udata->udata, H5AC_READ))) + cache_udata.f = f; + cache_udata.type = type; + cache_udata.rc_shared = rc_shared; + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node") - shared = H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); /* Keep following the left-most child until we reach a leaf node. */ if(bt->level > 0) @@ -1893,13 +1971,13 @@ H5B_iterate_size(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, next_addr = bt->right; /* Unprotect current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") /* Protect bt's next node to the right, if there is one */ if(H5F_addr_defined(next_addr)) { addr = next_addr; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, bh_udata->udata, H5AC_READ))) + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "B-tree node") } /* end if */ else @@ -1907,7 +1985,7 @@ H5B_iterate_size(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, } /* end while */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1915,6 +1993,38 @@ done: /*------------------------------------------------------------------------- + * Function: H5B_dest + * + * Purpose: Destroy/release an "in core representation" of a B-tree node + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 26, 2008 + * + *------------------------------------------------------------------------- + */ +herr_t +H5B_dest(H5B_t *bt) +{ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_dest) + + /* check arguments */ + HDassert(bt); + HDassert(bt->rc_shared); + + H5FL_SEQ_FREE(haddr_t, bt->child); + H5FL_BLK_FREE(native_block, bt->native); + H5RC_DEC(bt->rc_shared); + H5FL_FREE(H5B_t, bt); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B_dest() */ + + +/*------------------------------------------------------------------------- * Function: H5B_debug * * Purpose: Prints debugging info about a B-tree. @@ -1935,7 +2045,9 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f const H5B_class_t *type, void *udata) { H5B_t *bt = NULL; - H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5RC_t *rc_shared; /* Ref-counted shared info */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ @@ -1951,13 +2063,20 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f assert(fwidth >= 0); assert(type); + /* Get shared info for B-tree */ + if(NULL == (rc_shared = (type->get_shared)(f, udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree's shared ref. count object") + shared = (H5B_shared_t *)H5RC_GET_OBJ(rc_shared); + HDassert(shared); + /* * Load the tree node. */ - if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) + cache_udata.f = f; + cache_udata.type = type; + cache_udata.rc_shared = rc_shared; + if(NULL == (bt = (H5B_t *)H5AC2_protect(f, dxpl_id, H5AC2_BT, addr, shared->sizeof_rnode, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node") - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); /* * Print the values. @@ -2018,7 +2137,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f } done: - if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC2_unprotect(f, dxpl_id, H5AC2_BT, addr, (size_t)0, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 2748963..553876a 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -38,176 +38,112 @@ #include "H5Bpkg.h" /* B-link trees */ #include "H5Eprivate.h" /* Error handling */ + /****************/ /* Local Macros */ /****************/ + /******************/ /* Local Typedefs */ /******************/ + /********************/ /* Local Prototypes */ /********************/ -/* General routines */ -static herr_t H5B_serialize(const H5F_t *f, const H5B_t *bt); - /* Metadata cache callbacks */ -static H5B_t *H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata); -static herr_t H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b, unsigned UNUSED * flags_ptr); -static herr_t H5B_clear(H5F_t *f, H5B_t *b, hbool_t destroy); -static herr_t H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr); +static void *H5B_deserialize(haddr_t addr, size_t len, const void *image, + const void *udata, hbool_t *dirty); +static herr_t H5B_serialize(haddr_t addr, size_t len, void *image, + void *thing, unsigned *flags, haddr_t *new_addr, + size_t *new_len, void **new_image); +static herr_t H5B_free_icr(haddr_t addr, size_t len, void *thing); + /*********************/ /* Package Variables */ /*********************/ /* H5B inherits cache-like properties from H5AC */ -const H5AC_class_t H5AC_BT[1] = {{ - H5AC_BT_ID, - (H5AC_load_func_t)H5B_load, - (H5AC_flush_func_t)H5B_flush, - (H5AC_dest_func_t)H5B_dest, - (H5AC_clear_func_t)H5B_clear, - (H5AC_size_func_t)H5B_compute_size, +const H5AC2_class_t H5AC2_BT[1] = {{ + H5AC2_BT_ID, + "v1 B-tree", + H5FD_MEM_BTREE, + H5B_deserialize, + NULL, + H5B_serialize, + H5B_free_icr, + NULL }}; /*******************/ /* Local Variables */ /*******************/ + /*------------------------------------------------------------------------- - * Function: H5B_serialize + * Function: H5B_deserialize * - * Purpose: Serialize the data structure for writing to disk. + * Purpose: Deserialize the data structure from disk. * * Return: Success: SUCCEED * Failure: FAIL * - * Programmer: Bill Wendling - * wendling@ncsa.uiuc.edu - * Sept. 15, 2003 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 24, 2008 * *------------------------------------------------------------------------- */ -static herr_t -H5B_serialize(const H5F_t *f, const H5B_t *bt) +static void * +H5B_deserialize(haddr_t UNUSED addr, size_t UNUSED len, const void *image, const void *_udata, + hbool_t UNUSED *dirty) { - H5B_shared_t *shared=NULL; /* Pointer to shared B-tree info */ - unsigned u; - uint8_t *p; /* Pointer into raw data buffer */ - uint8_t *native; /* Pointer to native keys */ - herr_t ret_value = SUCCEED; /* Return value */ + H5B_t *bt = NULL; /* Pointer to the deserialized B-tree node */ + const H5B_cache_ud_t *udata = (const H5B_cache_ud_t *)_udata; /* User data for callback */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + const uint8_t *p; /* Pointer into image buffer */ + uint8_t *native; /* Pointer to native keys */ + unsigned u; /* Local index variable */ + H5B_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5B_serialize, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5B_deserialize) /* check arguments */ - HDassert(f); - HDassert(bt); - HDassert(bt->rc_shared); - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); + HDassert(image); - p = shared->page; + /* Allocate the B-tree node in memory */ + if(NULL == (bt = H5FL_MALLOC(H5B_t))) + HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "can't allocate B-tree struct") + HDmemset(&bt->cache_info, 0, sizeof(bt->cache_info)); - /* magic number */ - HDmemcpy(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC); - p += 4; - - /* node type and level */ - *p++ = (uint8_t)shared->type->id; - H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t); - *p++ = (uint8_t)bt->level; - - /* entries used */ - UINT16ENCODE(p, bt->nchildren); - - /* sibling pointers */ - H5F_addr_encode(f, &p, bt->left); - H5F_addr_encode(f, &p, bt->right); + /* Set & increment the ref-counted "shared" B-tree information for the node */ + bt->rc_shared = udata->rc_shared; + H5RC_INC(bt->rc_shared); - /* child keys and pointers */ - native=bt->native; - for (u = 0; u < bt->nchildren; ++u) { - /* encode the key */ - if (shared->type->encode(f, bt, p, native) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") - p += shared->sizeof_rkey; - native += shared->type->sizeof_nkey; - - /* encode the child address */ - H5F_addr_encode(f, &p, bt->child[u]); - } /* end for */ - if(bt->nchildren>0) { - /* Encode the final key */ - if (shared->type->encode(f, bt, p, native) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_serialize() */ - - -/*------------------------------------------------------------------------- - * Function: H5B_load - * - * Purpose: Loads a B-tree node from the disk. - * - * Return: Success: Pointer to a new B-tree node. - * - * Failure: NULL - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 - * - *------------------------------------------------------------------------- - */ -static H5B_t * -H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata) -{ - const H5B_class_t *type = (const H5B_class_t *) _type; - H5B_t *bt = NULL; - H5B_shared_t *shared; /* Pointer to shared B-tree info */ - uint8_t *p; /* Pointer into raw data buffer */ - uint8_t *native; /* Pointer to native keys */ - unsigned u; /* Local index variable */ - H5B_t *ret_value; - - FUNC_ENTER_NOAPI(H5B_load, NULL) - - /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(type); - HDassert(type->get_shared); - - if (NULL==(bt = H5FL_MALLOC(H5B_t))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - HDmemset(&bt->cache_info,0,sizeof(H5AC_info_t)); - if((bt->rc_shared=(type->get_shared)(f, udata))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "can't retrieve B-tree node buffer") - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); + /* Get a pointer to the shared info, for convenience */ + shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); - if (NULL==(bt->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) || - NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if (H5F_block_read(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page)<0) - HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree node") + /* Allocate space for the native keys and child addresses */ + if(NULL == (bt->native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys))) + HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "can't allocate buffer for native keys") + if(NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k))) + HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "can't allocate buffer for child addresses") - p = shared->page; + /* Set the pointer into the image */ + p = image; /* magic number */ - if (HDmemcmp(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC)) + if(HDmemcmp(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree signature") p += 4; /* node type and level */ - if (*p++ != (uint8_t)type->id) + if(*p++ != (uint8_t)udata->type->id) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "incorrect B-tree node type") bt->level = *p++; @@ -215,26 +151,26 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata) UINT16DECODE(p, bt->nchildren); /* sibling pointers */ - H5F_addr_decode(f, (const uint8_t **) &p, &(bt->left)); - H5F_addr_decode(f, (const uint8_t **) &p, &(bt->right)); + H5F_addr_decode(udata->f, (const uint8_t **)&p, &(bt->left)); + H5F_addr_decode(udata->f, (const uint8_t **)&p, &(bt->right)); /* the child/key pairs */ - native=bt->native; - for (u = 0; u < bt->nchildren; u++) { + native = bt->native; + for(u = 0; u < bt->nchildren; u++) { /* Decode native key value */ - if ((type->decode) (f, bt, p, native) < 0) + if((udata->type->decode)(shared, p, native) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key") p += shared->sizeof_rkey; - native += type->sizeof_nkey; + native += udata->type->sizeof_nkey; /* Decode address value */ - H5F_addr_decode(f, (const uint8_t **) &p, bt->child + u); - } + H5F_addr_decode(udata->f, (const uint8_t **)&p, bt->child + u); + } /* end for */ /* Decode final key */ - if(bt->nchildren>0) { + if(bt->nchildren > 0) { /* Decode native key value */ - if ((type->decode) (f, bt, p, native) < 0) + if((udata->type->decode)(shared, p, native) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key") } /* end if */ @@ -242,182 +178,119 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata) ret_value = bt; done: - if (!ret_value && bt) - (void)H5B_dest(f,bt); + if(!ret_value && bt) + (void)H5B_dest(bt); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5B_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5B_flush - * - * Purpose: Flushes a dirty B-tree node to disk. + * Function: H5B_serialize * - * Return: Non-negative on success/Negative on failure + * Purpose: Serialize the data structure for writing to disk. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Return: Success: SUCCEED + * Failure: FAIL * - * Changes: JRM -- 8/21/06 - * Added the flags_ptr parameter. This parameter exists to - * allow the flush routine to report to the cache if the - * entry is resized or renamed as a result of the flush. - * *flags_ptr is set to H5C_CALLBACK__NO_FLAGS_SET on entry. + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 24, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, unsigned UNUSED * flags_ptr) +H5B_serialize(haddr_t UNUSED addr, size_t UNUSED len, void *image, void *_thing, + unsigned *flags, haddr_t UNUSED *new_addr, size_t UNUSED *new_len, + void UNUSED **new_image) { - H5B_shared_t *shared; /* Pointer to shared B-tree info */ + H5B_t *bt = (H5B_t *)_thing; /* Pointer to the B-tree node */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + uint8_t *p; /* Pointer into image buffer */ + uint8_t *native; /* Pointer to native keys */ + unsigned u; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B_flush, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5B_serialize) /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(bt); - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); + HDassert(bt->rc_shared); + HDassert(flags); + shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); - HDassert(shared->type); - HDassert(shared->type->encode); - - if (bt->cache_info.is_dirty) { - if (H5B_serialize(f, bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTSERIALIZE, FAIL, "unable to serialize B-tree") - - /* - * Write the disk page. We always write the header, but we don't - * bother writing data for the child entries that don't exist or - * for the final unchanged children. - */ - if (H5F_block_write(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree node to disk") - - bt->cache_info.is_dirty = FALSE; - } /* end if */ - - if (destroy) - if (H5B_dest(f,bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_flush() */ - - -/*------------------------------------------------------------------------- - * Function: H5B_dest - * - * Purpose: Destroys a B-tree node in memory. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -herr_t -H5B_dest(H5F_t UNUSED *f, H5B_t *bt) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_dest) - /* - * Check arguments. - */ - HDassert(bt); - HDassert(bt->rc_shared); + /* Set the local pointer into the serialized image */ + p = image; - H5FL_SEQ_FREE(haddr_t,bt->child); - H5FL_BLK_FREE(native_block,bt->native); - H5RC_DEC(bt->rc_shared); - H5FL_FREE(H5B_t,bt); + /* magic number */ + HDmemcpy(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC); + p += 4; - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5B_dest() */ + /* node type and level */ + *p++ = (uint8_t)shared->type->id; + H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t); + *p++ = (uint8_t)bt->level; - -/*------------------------------------------------------------------------- - * Function: H5B_clear - * - * Purpose: Mark a B-tree node in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5B_clear(H5F_t *f, H5B_t *bt, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; + /* entries used */ + UINT16ENCODE(p, bt->nchildren); - FUNC_ENTER_NOAPI_NOINIT(H5B_clear) + /* sibling pointers */ + H5F_addr_encode_len(&p, bt->left, shared->sizeof_addr); + H5F_addr_encode_len(&p, bt->right, shared->sizeof_addr); - /* - * Check arguments. - */ - HDassert(bt); + /* child keys and pointers */ + native = bt->native; + for(u = 0; u < bt->nchildren; ++u) { + /* encode the key */ + if(shared->type->encode(shared, p, native) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") + p += shared->sizeof_rkey; + native += shared->type->sizeof_nkey; - /* Reset the dirty flag. */ - bt->cache_info.is_dirty = FALSE; + /* encode the child address */ + H5F_addr_encode_len(&p, bt->child[u], shared->sizeof_addr); + } /* end for */ + if(bt->nchildren > 0) { + /* Encode the final key */ + if(shared->type->encode(shared, p, native) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") + } /* end if */ - if (destroy) - if (H5B_dest(f, bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") + /* Reset the cache flags for this operation (metadata not resized or renamed) */ + *flags = 0; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_clear() */ +} /* end H5B_serialize() */ /*------------------------------------------------------------------------- - * Function: H5B_compute_size + * Function: H5B_free_icr * - * Purpose: Compute the size in bytes of the specified instance of - * H5B_t on disk, and return it in *len_ptr. On failure, - * the value of *len_ptr is undefined. + * Purpose: Destroy/release an "in core representation" of a data structure * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: John Mainzer - * 5/13/04 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 26, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr) +H5B_free_icr(haddr_t UNUSED addr, size_t UNUSED len, void *thing) { - H5B_shared_t *shared; /* Pointer to shared B-tree info */ - size_t size; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5B_compute_size) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_free_icr) - /* check arguments */ - HDassert(f); - HDassert(bt); - HDassert(bt->rc_shared); - shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); - HDassert(shared->type); - HDassert(size_ptr); + /* Check arguments */ + HDassert(thing); - /* Check node's size */ - if ((size = H5B_nodesize(f, shared, NULL)) == 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, "H5B_nodesize() failed") + /* Destroy B-tree node */ + H5B_dest(thing); - /* Set size value */ - *size_ptr = size; + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B_free_icr() */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B_compute_size() */ diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index cd79cf7..ed03b99 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -32,20 +32,22 @@ #include "H5Bprivate.h" /* Other private headers needed by this file */ -#include "H5RCprivate.h" /* Reference counted objects */ +#include "H5AC2private.h" /* Metadata cache #2 */ + /**************************/ /* Package Private Macros */ /**************************/ + /****************************/ /* Package Private Typedefs */ /****************************/ /* The B-tree node as stored in memory... */ -struct H5B_t { - H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */ - /* first field in structure */ +typedef struct H5B_t { + H5AC2_info_t cache_info; /* Information for H5AC2 cache functions */ + /* _must_ be first field in structure */ H5RC_t *rc_shared; /*ref-counted shared info */ unsigned level; /*node level */ unsigned nchildren; /*number of child pointers */ @@ -53,14 +55,21 @@ struct H5B_t { haddr_t right; /*address of right sibling */ uint8_t *native; /*array of keys in native format */ haddr_t *child; /*2k child pointers */ -}; +} H5B_t; + +/* Callback info for loading a B-tree node into the cache */ +typedef struct H5B_cache_ud_t { + H5F_t *f; /* File that B-tree node is within */ + const struct H5B_class_t *type; /* Type of tree */ + H5RC_t *rc_shared; /* Ref-counted shared info */ +} H5B_cache_ud_t; /*****************************/ /* Package Private Variables */ /*****************************/ -/* H5B header inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_BT[1]; +/* H5B header inherits cache-like properties from H5AC2 */ +H5_DLLVAR const H5AC2_class_t H5AC2_BT[1]; /* Declare a free list to manage the haddr_t sequence information */ H5FL_SEQ_EXTERN(haddr_t); @@ -71,9 +80,11 @@ H5FL_BLK_EXTERN(native_block); /* Declare a free list to manage the H5B_t struct */ H5FL_EXTERN(H5B_t); + /******************************/ /* Package Private Prototypes */ /******************************/ -herr_t H5B_dest(H5F_t *f, H5B_t *b); +herr_t H5B_dest(H5B_t *bt); #endif /*_H5Bpkg_H*/ + diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index 4dfea84..ef2a159 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -33,7 +33,6 @@ /* Private headers needed by this file */ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free Lists */ #include "H5RCprivate.h" /* Reference counted object functions */ @@ -73,9 +72,6 @@ typedef enum H5B_ins_t { typedef int (*H5B_operator_t)(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -/* Typedef for B-tree in memory (defined in H5Bpkg.h) */ -typedef struct H5B_t H5B_t; - /* Each B-tree has certain information that can be shared across all * the instances of nodes in that B-tree. */ @@ -85,6 +81,8 @@ typedef struct H5B_shared_t { size_t sizeof_rkey; /* Size of raw (disk) key */ size_t sizeof_rnode; /* Size of raw (disk) node */ size_t sizeof_keys; /* Size of native (memory) key node */ + size_t sizeof_addr; /* Size of file address (in bytes) */ + size_t sizeof_len; /* Size of file lengths (in bytes) */ uint8_t *page; /* Disk page */ size_t *nkey; /* Offsets of each native key in native key buffer */ } H5B_shared_t; @@ -119,8 +117,8 @@ typedef struct H5B_class_t { hbool_t*); /* encode, decode, debug key values */ - herr_t (*decode)(const H5F_t*, const struct H5B_t*, const uint8_t*, void*); - herr_t (*encode)(const H5F_t*, const struct H5B_t*, uint8_t*, void*); + herr_t (*decode)(const H5B_shared_t*, const uint8_t*, void*); + herr_t (*encode)(const H5B_shared_t*, uint8_t*, const void*); herr_t (*debug_key)(FILE*, H5F_t*, hid_t, int, int, const void*, const void*); } H5B_class_t; diff --git a/src/H5C2.c b/src/H5C2.c index 987c518..a9de919 100644 --- a/src/H5C2.c +++ b/src/H5C2.c @@ -2565,20 +2565,23 @@ H5FL_DEFINE_STATIC(H5C2_t); * Private file-scope function declarations: */ -static herr_t H5C2__auto_adjust_cache_size(H5C2_t * cache_ptr, +static herr_t H5C2__auto_adjust_cache_size(H5F_t * f, hid_t dxpl_id, + H5C2_t * cache_ptr, hbool_t write_permitted); -static herr_t H5C2__autoadjust__ageout(H5C2_t * cache_ptr, +static herr_t H5C2__autoadjust__ageout(H5F_t * f, + hid_t dxpl_id, + H5C2_t * cache_ptr, double hit_rate, enum H5C2_resize_status * status_ptr, size_t * new_max_cache_size_ptr, - hid_t dxpl_id, hbool_t write_permitted); static herr_t H5C2__autoadjust__ageout__cycle_epoch_marker(H5C2_t * cache_ptr); -static herr_t H5C2__autoadjust__ageout__evict_aged_out_entries(hid_t dxpl_id, +static herr_t H5C2__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, + hid_t dxpl_id, H5C2_t * cache_ptr, hbool_t write_permitted); @@ -2600,7 +2603,8 @@ static herr_t H5C2_flush_single_entry(H5F_t * f, unsigned flags, hbool_t del_entry_from_slist_on_destroy); -static herr_t H5C2_flush_invalidate_cache(hid_t dxpl_id, +static herr_t H5C2_flush_invalidate_cache(H5F_t * f, + hid_t dxpl_id, H5C2_t * cache_ptr, unsigned flags); @@ -2612,7 +2616,8 @@ static void * H5C2_load_entry(H5F_t * f, hbool_t chk_len, const void * udata_ptr); -static herr_t H5C2_make_space_in_cache(hid_t dxpl_id, +static herr_t H5C2_make_space_in_cache(H5F_t * f, + hid_t dxpl_id, H5C2_t * cache_ptr, size_t space_needed, hbool_t write_permitted); @@ -2866,8 +2871,7 @@ done: */ H5C2_t * -H5C2_create(const H5F_t * f, - size_t max_cache_size, +H5C2_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, const char * (* type_name_table_ptr), @@ -2882,8 +2886,6 @@ H5C2_create(const H5F_t * f, FUNC_ENTER_NOAPI(H5C2_create, NULL) - HDassert( f ); - HDassert( max_cache_size >= H5C2__MIN_MAX_CACHE_SIZE ); HDassert( max_cache_size <= H5C2__MAX_MAX_CACHE_SIZE ); HDassert( min_clean_size <= max_cache_size ); @@ -2917,8 +2919,6 @@ H5C2_create(const H5F_t * f, cache_ptr->magic = H5C2__H5C2_T_MAGIC; - cache_ptr->f = (H5F_t *)f; - cache_ptr->flush_in_progress = FALSE; cache_ptr->trace_file_ptr = NULL; @@ -3328,9 +3328,10 @@ H5C2_def_auto_resize_rpt_fcn(H5C2_t * cache_ptr, *------------------------------------------------------------------------- */ herr_t -H5C2_dest(H5C2_t * cache_ptr, +H5C2_dest(H5F_t * f, hid_t dxpl_id) { + H5C2_t * cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C2_dest, FAIL) @@ -3338,7 +3339,7 @@ H5C2_dest(H5C2_t * cache_ptr, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - if ( H5C2_flush_cache(cache_ptr, dxpl_id, + if ( H5C2_flush_cache(f, dxpl_id, H5C2__FLUSH_INVALIDATE_FLAG) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") @@ -3439,12 +3440,13 @@ done: */ herr_t -H5C2_expunge_entry(H5C2_t * cache_ptr, +H5C2_expunge_entry(H5F_t * f, hid_t dxpl_id, const H5C2_class_t * type, haddr_t addr) { /* const char * fcn_name = "H5C2_expunge_entry()"; */ + H5C2_t * cache_ptr = f->shared->cache2; herr_t result; herr_t ret_value = SUCCEED; /* Return value */ H5C2_cache_entry_t * entry_ptr = NULL; @@ -3492,7 +3494,7 @@ H5C2_expunge_entry(H5C2_t * cache_ptr, * This will clear the entry, and then delete it from the cache. */ - result = H5C2_flush_single_entry(cache_ptr->f, + result = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -3639,11 +3641,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C2_flush_cache(H5C2_t * cache_ptr, +H5C2_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) { - /* const char * fcn_name = "H5C2_flush_cache()"; */ + H5C2_t * cache_ptr = f->shared->cache2; herr_t status; herr_t ret_value = SUCCEED; hbool_t destroy; @@ -3667,7 +3669,7 @@ H5C2_flush_cache(H5C2_t * cache_ptr, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->skip_file_checks || cache_ptr->f ); + HDassert( cache_ptr->skip_file_checks || f); HDassert( cache_ptr->slist_ptr ); ignore_protected = ( (flags & H5C2__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); @@ -3688,7 +3690,8 @@ H5C2_flush_cache(H5C2_t * cache_ptr, if ( destroy ) { - status = H5C2_flush_invalidate_cache(dxpl_id, + status = H5C2_flush_invalidate_cache(f, + dxpl_id, cache_ptr, flags); @@ -3888,7 +3891,7 @@ H5C2_flush_cache(H5C2_t * cache_ptr, flushed_entries_count++; flushed_entries_size += entry_ptr->size; #endif /* H5C2_DO_SANITY_CHECKS */ - status = H5C2_flush_single_entry(cache_ptr->f, + status = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -3910,7 +3913,7 @@ H5C2_flush_cache(H5C2_t * cache_ptr, flushed_entries_count++; flushed_entries_size += entry_ptr->size; #endif /* H5C2_DO_SANITY_CHECKS */ - status = H5C2_flush_single_entry(cache_ptr->f, + status = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -4038,9 +4041,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C2_flush_to_min_clean(H5C2_t * cache_ptr, +H5C2_flush_to_min_clean(H5F_t * f, hid_t dxpl_id) { + H5C2_t * cache_ptr = f->shared->cache2; herr_t result; herr_t ret_value = SUCCEED; hbool_t write_permitted; @@ -4057,11 +4061,11 @@ H5C2_flush_to_min_clean(H5C2_t * cache_ptr, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->skip_file_checks || cache_ptr->f ); + HDassert( cache_ptr->skip_file_checks || f ); if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(cache_ptr->f, + result = (cache_ptr->check_write_permitted)(f, dxpl_id, &write_permitted); @@ -4081,7 +4085,8 @@ H5C2_flush_to_min_clean(H5C2_t * cache_ptr, "cache write is not permitted!?!\n"); } #if 1 /* original code */ - result = H5C2_make_space_in_cache(dxpl_id, + result = H5C2_make_space_in_cache(f, + dxpl_id, cache_ptr, (size_t)0, write_permitted); @@ -4412,7 +4417,7 @@ done: */ herr_t -H5C2_get_entry_status(H5C2_t * cache_ptr, +H5C2_get_entry_status(H5F_t * f, haddr_t addr, size_t * size_ptr, hbool_t * in_cache_ptr, @@ -4421,6 +4426,7 @@ H5C2_get_entry_status(H5C2_t * cache_ptr, hbool_t * is_pinned_ptr) { /* const char * fcn_name = "H5C2_get_entry_status()"; */ + H5C2_t * cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ H5C2_cache_entry_t * entry_ptr = NULL; @@ -4668,7 +4674,7 @@ done: */ herr_t -H5C2_insert_entry(H5C2_t * cache_ptr, +H5C2_insert_entry(H5F_t * f, hid_t dxpl_id, const H5C2_class_t * type, haddr_t addr, @@ -4677,6 +4683,7 @@ H5C2_insert_entry(H5C2_t * cache_ptr, unsigned int flags) { /* const char * fcn_name = "H5C2_insert_entry()"; */ + H5C2_t * cache_ptr = f->shared->cache2; herr_t result; herr_t ret_value = SUCCEED; /* Return value */ hbool_t insert_pinned; @@ -4689,7 +4696,7 @@ H5C2_insert_entry(H5C2_t * cache_ptr, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->skip_file_checks || cache_ptr->f ); + HDassert( cache_ptr->skip_file_checks || f ); HDassert( type ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); @@ -4772,7 +4779,7 @@ H5C2_insert_entry(H5C2_t * cache_ptr, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(cache_ptr->f, + result = (cache_ptr->check_write_permitted)(f, dxpl_id, &write_permitted); @@ -4820,7 +4827,8 @@ H5C2_insert_entry(H5C2_t * cache_ptr, * no point in worrying about the third. */ - result = H5C2_make_space_in_cache(dxpl_id, + result = H5C2_make_space_in_cache(f, + dxpl_id, cache_ptr, space_needed, write_permitted); @@ -5080,7 +5088,7 @@ H5C2_mark_entries_as_clean(H5C2_t * cache_ptr, } else { - if ( H5C2_flush_single_entry(cache_ptr->f, + if ( H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -5138,7 +5146,7 @@ H5C2_mark_entries_as_clean(H5C2_t * cache_ptr, entry_ptr = entry_ptr->prev; entries_cleared++; - if ( H5C2_flush_single_entry(cache_ptr->f, + if ( H5C2_flush_single_entry(f, dxpl_id, cache_ptr, clear_ptr->type, @@ -5174,7 +5182,7 @@ H5C2_mark_entries_as_clean(H5C2_t * cache_ptr, entry_ptr = entry_ptr->next; entries_cleared++; - if ( H5C2_flush_single_entry(cache_ptr->f, + if ( H5C2_flush_single_entry(f, dxpl_id, cache_ptr, clear_ptr->type, @@ -5257,11 +5265,12 @@ done: */ herr_t -H5C2_mark_pinned_entry_dirty(H5C2_t * cache_ptr, +H5C2_mark_pinned_entry_dirty(H5F_t * f, void * thing, hbool_t size_changed, size_t new_size) { + H5C2_t * cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ herr_t result; size_t size_increase; @@ -5389,9 +5398,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C2_mark_pinned_or_protected_entry_dirty(H5C2_t * cache_ptr, +H5C2_mark_pinned_or_protected_entry_dirty(H5F_t * f, void * thing) { + H5C2_t * cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ H5C2_cache_entry_t * entry_ptr; @@ -5661,11 +5671,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C2_resize_pinned_entry(H5C2_t * cache_ptr, +H5C2_resize_pinned_entry(H5F_t * f, void * thing, size_t new_size) { /* const char * fcn_name = "H5C2_resize_pinned_entry()"; */ + H5C2_t * cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ herr_t result; H5C2_cache_entry_t * entry_ptr; @@ -5796,14 +5807,15 @@ done: */ #ifndef NDEBUG herr_t -H5C2_pin_protected_entry(H5C2_t * cache_ptr, +H5C2_pin_protected_entry(H5F_t * f, void * thing) #else herr_t -H5C2_pin_protected_entry(H5C2_t UNUSED * cache_ptr, +H5C2_pin_protected_entry(H5F_t UNUSED * f, void * thing) #endif { + H5C2_t *cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ H5C2_cache_entry_t * entry_ptr; @@ -5933,7 +5945,7 @@ done: */ void * -H5C2_protect(H5C2_t * cache_ptr, +H5C2_protect(H5F_t * f, hid_t dxpl_id, const H5C2_class_t * type, haddr_t addr, @@ -5942,6 +5954,7 @@ H5C2_protect(H5C2_t * cache_ptr, unsigned flags) { /* const char * fcn_name = "H5C2_protect()"; */ + H5C2_t * cache_ptr = f->shared->cache2; hbool_t hit; hbool_t first_flush; hbool_t have_write_permitted = FALSE; @@ -5958,7 +5971,7 @@ H5C2_protect(H5C2_t * cache_ptr, /* check args */ HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->skip_file_checks || cache_ptr->f ); + HDassert( cache_ptr->skip_file_checks || f ); HDassert( type ); HDassert( H5F_addr_defined(addr) ); HDassert( len > 0 ); @@ -5996,7 +6009,7 @@ H5C2_protect(H5C2_t * cache_ptr, hit = FALSE; - thing = H5C2_load_entry(cache_ptr->f, dxpl_id, type, + thing = H5C2_load_entry(f, dxpl_id, type, addr, len, chk_len, udata); if ( thing == NULL ) { @@ -6035,7 +6048,7 @@ H5C2_protect(H5C2_t * cache_ptr, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(cache_ptr->f, + result = (cache_ptr->check_write_permitted)(f, dxpl_id, &write_permitted); @@ -6097,7 +6110,7 @@ H5C2_protect(H5C2_t * cache_ptr, * see no point in worrying about the fourth. */ - result = H5C2_make_space_in_cache(dxpl_id, cache_ptr, + result = H5C2_make_space_in_cache(f, dxpl_id, cache_ptr, space_needed, write_permitted); if ( result < 0 ) { @@ -6175,7 +6188,7 @@ H5C2_protect(H5C2_t * cache_ptr, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(cache_ptr->f, + result = (cache_ptr->check_write_permitted)(f, dxpl_id, &write_permitted); @@ -6204,8 +6217,9 @@ H5C2_protect(H5C2_t * cache_ptr, ( cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length ) ) { - result = H5C2__auto_adjust_cache_size(cache_ptr, + result = H5C2__auto_adjust_cache_size(f, dxpl_id, + cache_ptr, write_permitted); if ( result != SUCCEED ) { @@ -6226,7 +6240,8 @@ H5C2_protect(H5C2_t * cache_ptr, cache_ptr->cache_full = TRUE; - result = H5C2_make_space_in_cache(dxpl_id, + result = H5C2_make_space_in_cache(f, + dxpl_id, cache_ptr, (size_t)0, write_permitted); @@ -6331,10 +6346,11 @@ done: */ herr_t -H5C2_set_cache_auto_resize_config(H5C2_t * cache_ptr, +H5C2_set_cache_auto_resize_config(const H5F_t * f, H5C2_auto_size_ctl_t *config_ptr) { /* const char *fcn_name = "H5C2_set_cache_auto_resize_config()"; */ + H5C2_t * cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ herr_t result; size_t new_max_cache_size; @@ -6615,9 +6631,10 @@ done: */ herr_t -H5C2_set_evictions_enabled(H5C2_t * cache_ptr, +H5C2_set_evictions_enabled(const H5F_t * f, hbool_t evictions_enabled) { + H5C2_t * cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C2_set_evictions_enabled, FAIL) @@ -7361,9 +7378,10 @@ H5C2_stats__reset(H5C2_t UNUSED * cache_ptr) *------------------------------------------------------------------------- */ herr_t -H5C2_unpin_entry(H5C2_t * cache_ptr, +H5C2_unpin_entry(H5F_t * f, void * thing) { + H5C2_t *cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ H5C2_cache_entry_t * entry_ptr; @@ -7500,7 +7518,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C2_unprotect(H5C2_t * cache_ptr, +H5C2_unprotect(H5F_t * f, hid_t dxpl_id, const H5C2_class_t * type, haddr_t addr, @@ -7509,6 +7527,7 @@ H5C2_unprotect(H5C2_t * cache_ptr, size_t new_size) { /* const char * fcn_name = "H5C2_unprotect()"; */ + H5C2_t * cache_ptr = f->shared->cache2; hbool_t deleted; hbool_t dirtied; hbool_t set_flush_marker; @@ -7541,7 +7560,7 @@ H5C2_unprotect(H5C2_t * cache_ptr, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->skip_file_checks || cache_ptr->f ); + HDassert( cache_ptr->skip_file_checks || f ); HDassert( type ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); @@ -7787,7 +7806,7 @@ H5C2_unprotect(H5C2_t * cache_ptr, "hash table contains multiple entries for addr?!?.") } - if ( H5C2_flush_single_entry(cache_ptr->f, + if ( H5C2_flush_single_entry(f, dxpl_id, cache_ptr, type, @@ -7817,7 +7836,7 @@ H5C2_unprotect(H5C2_t * cache_ptr, "hash table contains multiple entries for addr?!?.") } - if ( H5C2_flush_single_entry(cache_ptr->f, + if ( H5C2_flush_single_entry(f, dxpl_id, cache_ptr, type, @@ -8156,8 +8175,9 @@ done: */ static herr_t -H5C2__auto_adjust_cache_size(H5C2_t * cache_ptr, +H5C2__auto_adjust_cache_size(H5F_t * f, hid_t dxpl_id, + H5C2_t * cache_ptr, hbool_t write_permitted) { herr_t ret_value = SUCCEED; /* Return value */ @@ -8172,6 +8192,7 @@ H5C2__auto_adjust_cache_size(H5C2_t * cache_ptr, FUNC_ENTER_NOAPI_NOINIT(H5C2__auto_adjust_cache_size) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); HDassert( cache_ptr->cache_accesses >= @@ -8356,11 +8377,12 @@ H5C2__auto_adjust_cache_size(H5C2_t * cache_ptr, } else { - result = H5C2__autoadjust__ageout(cache_ptr, + result = H5C2__autoadjust__ageout(f, + dxpl_id, + cache_ptr, hit_rate, &status, &new_max_cache_size, - dxpl_id, write_permitted); if ( result != SUCCEED ) { @@ -8512,11 +8534,12 @@ done: */ static herr_t -H5C2__autoadjust__ageout(H5C2_t * cache_ptr, +H5C2__autoadjust__ageout(H5F_t * f, + hid_t dxpl_id, + H5C2_t * cache_ptr, double hit_rate, enum H5C2_resize_status * status_ptr, size_t * new_max_cache_size_ptr, - hid_t dxpl_id, hbool_t write_permitted) { herr_t ret_value = SUCCEED; /* Return value */ @@ -8525,6 +8548,7 @@ H5C2__autoadjust__ageout(H5C2_t * cache_ptr, FUNC_ENTER_NOAPI_NOINIT(H5C2__autoadjust__ageout) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); HDassert( ( status_ptr ) && ( *status_ptr == in_spec2 ) ); @@ -8558,6 +8582,7 @@ H5C2__autoadjust__ageout(H5C2_t * cache_ptr, /* evict aged out cache entries if appropriate... */ result = H5C2__autoadjust__ageout__evict_aged_out_entries ( + f, dxpl_id, cache_ptr, write_permitted @@ -8793,7 +8818,8 @@ done: */ static herr_t -H5C2__autoadjust__ageout__evict_aged_out_entries(hid_t dxpl_id, +H5C2__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, + hid_t dxpl_id, H5C2_t * cache_ptr, hbool_t write_permitted) { @@ -8810,6 +8836,7 @@ H5C2__autoadjust__ageout__evict_aged_out_entries(hid_t dxpl_id, FUNC_ENTER_NOAPI_NOINIT(H5C2__autoadjust__ageout__evict_aged_out_entries) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); @@ -8848,7 +8875,7 @@ H5C2__autoadjust__ageout__evict_aged_out_entries(hid_t dxpl_id, if ( entry_ptr->is_dirty ) { - result = H5C2_flush_single_entry(cache_ptr->f, + result = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -8859,7 +8886,7 @@ H5C2__autoadjust__ageout__evict_aged_out_entries(hid_t dxpl_id, bytes_evicted += entry_ptr->size; - result = H5C2_flush_single_entry(cache_ptr->f, + result = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -8956,7 +8983,7 @@ H5C2__autoadjust__ageout__evict_aged_out_entries(hid_t dxpl_id, if ( ! (entry_ptr->is_dirty) ) { - result = H5C2_flush_single_entry(cache_ptr->f, + result = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -9495,8 +9522,9 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5C2_flush_invalidate_cache(hid_t dxpl_id, +static herr_t +H5C2_flush_invalidate_cache(H5F_t * f, + hid_t dxpl_id, H5C2_t * cache_ptr, unsigned flags) { @@ -9522,9 +9550,10 @@ H5C2_flush_invalidate_cache(hid_t dxpl_id, FUNC_ENTER_NOAPI(H5C2_flush_invalidate_cache, FAIL) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->skip_file_checks || cache_ptr->f ); + HDassert( cache_ptr->skip_file_checks || f ); HDassert( cache_ptr->slist_ptr ); /* Filter out the flags that are not relevant to the flush/invalidate. @@ -9768,7 +9797,7 @@ H5C2_flush_invalidate_cache(hid_t dxpl_id, * condition here. */ - status = H5C2_flush_single_entry(cache_ptr->f, + status = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -9787,7 +9816,7 @@ H5C2_flush_invalidate_cache(hid_t dxpl_id, } } else { - status = H5C2_flush_single_entry(cache_ptr->f, + status = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -9868,7 +9897,7 @@ H5C2_flush_invalidate_cache(hid_t dxpl_id, } else if ( ! ( entry_ptr->is_pinned ) ) { status = - H5C2_flush_single_entry(cache_ptr->f, + H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -10432,7 +10461,7 @@ H5C2_flush_single_entry(H5F_t * f, /* only call the clear_dirty_bits callback if debugging * is enabled. */ - if ( entry_ptr->type->clear_dirty_bits(addr, + if ( entry_ptr->type->clear_dirty_bits && entry_ptr->type->clear_dirty_bits(addr, entry_ptr->size, (void *)entry_ptr) != SUCCEED ) @@ -10798,8 +10827,6 @@ H5C2_load_entry(H5F_t * f, { /* const char * fcn_name = "H5C2_load_entry()"; */ hbool_t dirty = FALSE; - haddr_t abs_eoa; /* Absolute end of file address */ - haddr_t rel_eoa; /* Relative end of file address */ void * image_ptr = NULL; void * thing = NULL; void * ret_value = NULL; @@ -10815,44 +10842,6 @@ H5C2_load_entry(H5F_t * f, HDassert( type->deserialize ); HDassert( ( ! chk_len ) || ( type->image_len ) ); - /* Make certain we don't speculatively read off the end of the file */ - if ( HADDR_UNDEF == (abs_eoa = H5F_get_eoa(f)) ) - { - HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, \ - "unable to determine file size") - } - - /* Adjust absolute EOA address to relative EOA address */ - rel_eoa = abs_eoa - H5F_get_base_addr(f); - - HDassert( rel_eoa > addr ); - - if ( (rel_eoa - addr) < (haddr_t)len ) - { - /* either the client is speculatively reading beyond the end of - * file, or there is a major screw up. Adjust the len in the - * former case, and scream and die in the latter - */ - if ( chk_len ) /* i.e. possible speculative read beyond eof */ - { - /* Quincey: Did I use this correctly? In the example I - * stole it from, the from type was hsize_t even though - * the source was a haddr_t. I changed the from to match - * the source. Is this as it should be? - */ - /* JRM */ - H5_ASSIGN_OVERFLOW(len, (rel_eoa - addr), \ - /* from: */ haddr_t, /* to: */ size_t); - HDassert( len > 0 ); - } - else - { - HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, \ - "tried to read beyond eof") - - } - } - image_ptr = H5MM_malloc(len); if ( image_ptr == NULL ) @@ -11037,7 +11026,8 @@ done: */ static herr_t -H5C2_make_space_in_cache(hid_t dxpl_id, +H5C2_make_space_in_cache(H5F_t * f, + hid_t dxpl_id, H5C2_t * cache_ptr, size_t space_needed, hbool_t write_permitted) @@ -11058,6 +11048,7 @@ H5C2_make_space_in_cache(hid_t dxpl_id, FUNC_ENTER_NOAPI_NOINIT(H5C2_make_space_in_cache) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); @@ -11094,7 +11085,7 @@ H5C2_make_space_in_cache(hid_t dxpl_id, if ( entry_ptr->is_dirty ) { - result = H5C2_flush_single_entry(cache_ptr->f, + result = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -11104,7 +11095,7 @@ H5C2_make_space_in_cache(hid_t dxpl_id, } else { result = - H5C2_flush_single_entry(cache_ptr->f, + H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -11211,7 +11202,7 @@ H5C2_make_space_in_cache(hid_t dxpl_id, HDassert( prev_ptr->is_dirty ); } - result = H5C2_flush_single_entry(cache_ptr->f, + result = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, @@ -11313,7 +11304,7 @@ H5C2_make_space_in_cache(hid_t dxpl_id, prev_ptr = entry_ptr->aux_prev; - result = H5C2_flush_single_entry(cache_ptr->f, + result = H5C2_flush_single_entry(f, dxpl_id, cache_ptr, entry_ptr->type, diff --git a/src/H5C2journal.c b/src/H5C2journal.c index 6109cd7..27eabf7 100644 --- a/src/H5C2journal.c +++ b/src/H5C2journal.c @@ -163,10 +163,11 @@ done: */ herr_t -H5C2_create_journal_config_block(H5C2_t * cache_ptr, +H5C2_create_journal_config_block(H5F_t * f, hid_t dxpl_id, const char * journal_file_name_ptr) { + H5C2_t * cache_ptr = f->shared->cache2; size_t path_len = 0; hsize_t block_len = 0; haddr_t block_addr = HADDR_UNDEF; @@ -179,9 +180,9 @@ H5C2_create_journal_config_block(H5C2_t * cache_ptr, FUNC_ENTER_NOAPI(H5C2_create_journal_config_block, FAIL) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->f != NULL ); if ( cache_ptr->mdj_conf_block_ptr != NULL ) { @@ -195,7 +196,7 @@ H5C2_create_journal_config_block(H5C2_t * cache_ptr, HDassert( path_len > 0 ); - block_len = H5C2__JOURNAL_BLOCK_LEN(path_len, cache_ptr->f); + block_len = H5C2__JOURNAL_BLOCK_LEN(path_len, f); block_ptr = (void *)H5MM_malloc((size_t)block_len); @@ -216,7 +217,7 @@ H5C2_create_journal_config_block(H5C2_t * cache_ptr, p++; /* copy the length of the journal file path into the config block */ - H5F_ENCODE_LENGTH(cache_ptr->f, p, path_len); + H5F_ENCODE_LENGTH(f, p, path_len); /* copy the path to the journal file into the config block, including * the terminalting null. Before we do so, make note of p, as its @@ -239,7 +240,7 @@ H5C2_create_journal_config_block(H5C2_t * cache_ptr, * we must now allocate space for it in file, and write it to disk. */ - block_addr = H5MF_alloc(cache_ptr->f, + block_addr = H5MF_alloc(f, H5FD_MEM_MDJCONFIG, dxpl_id, block_len); @@ -253,7 +254,7 @@ H5C2_create_journal_config_block(H5C2_t * cache_ptr, /* now write the block to disk -- note that we don't sync. We will * have to do that later. */ - if ( H5F_block_write(cache_ptr->f, H5FD_MEM_MDJCONFIG, block_addr, + if ( H5F_block_write(f, H5FD_MEM_MDJCONFIG, block_addr, (size_t)block_len, dxpl_id, block_ptr) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTJOURNAL, FAIL, \ @@ -303,16 +304,17 @@ done: */ herr_t -H5C2_discard_journal_config_block(H5C2_t * cache_ptr, +H5C2_discard_journal_config_block(H5F_t * f, hid_t dxpl_id) { + H5C2_t * cache_ptr = f->shared->cache2; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C2_discard_journal_config_block, FAIL) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->f != NULL ); if ( ( cache_ptr->mdj_conf_block_addr == HADDR_UNDEF ) || ( cache_ptr->mdj_conf_block_len == 0 ) || @@ -323,7 +325,7 @@ H5C2_discard_journal_config_block(H5C2_t * cache_ptr, "metadata journaling config block undefined on entry?!?") } - if ( H5MF_xfree(cache_ptr->f, H5FD_MEM_MDJCONFIG, dxpl_id, + if ( H5MF_xfree(f, H5FD_MEM_MDJCONFIG, dxpl_id, cache_ptr->mdj_conf_block_addr, cache_ptr->mdj_conf_block_len) < 0 ) { @@ -379,27 +381,28 @@ done: */ herr_t -H5C2_get_journaling_in_progress(H5C2_t * cache_ptr, +H5C2_get_journaling_in_progress(H5F_t * f, hid_t dxpl_id) { + H5C2_t * cache_ptr = f->shared->cache2; herr_t result; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C2_mark_journaling_in_progress, FAIL) + HDassert( f ); + HDassert( f->shared != NULL ); + HDassert( ! f->shared->mdc_jrnl_enabled ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->f != NULL ); - HDassert( cache_ptr->f->shared != NULL ); - HDassert( ! cache_ptr->f->shared->mdc_jrnl_enabled ); HDassert( cache_ptr->mdj_conf_block_addr == HADDR_UNDEF ); HDassert( cache_ptr->mdj_conf_block_len == 0 ); HDassert( cache_ptr->mdj_conf_block_ptr == NULL ); HDassert( cache_ptr->mdj_file_name_ptr == NULL ); - if ( cache_ptr->f->shared->mdc_jrnl_enabled == TRUE ) { + if ( f->shared->mdc_jrnl_enabled == TRUE ) { - result = H5C2_load_journal_config_block(cache_ptr, + result = H5C2_load_journal_config_block(f, dxpl_id, cache_ptr->mdj_conf_block_addr, cache_ptr->mdj_conf_block_len); @@ -436,11 +439,12 @@ done: */ herr_t -H5C2_load_journal_config_block(H5C2_t * cache_ptr, +H5C2_load_journal_config_block(H5F_t * f, hid_t dxpl_id, haddr_t block_addr, hsize_t block_len) { + H5C2_t * cache_ptr = f->shared->cache2; size_t path_len = 0; void * block_ptr = NULL; uint8_t version; @@ -452,9 +456,9 @@ H5C2_load_journal_config_block(H5C2_t * cache_ptr, FUNC_ENTER_NOAPI(H5C2_load_journal_config_block, FAIL) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->f != NULL ); if ( cache_ptr->mdj_conf_block_ptr != NULL ) { @@ -473,7 +477,7 @@ H5C2_load_journal_config_block(H5C2_t * cache_ptr, p = (uint8_t *)block_ptr; /* read the metadata journaling block from file */ - if ( H5F_block_read(cache_ptr->f, H5FD_MEM_MDJCONFIG, block_addr, + if ( H5F_block_read(f, H5FD_MEM_MDJCONFIG, block_addr, (size_t)block_len, dxpl_id, block_ptr) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTJOURNAL, FAIL, \ @@ -499,7 +503,7 @@ H5C2_load_journal_config_block(H5C2_t * cache_ptr, } /* get the length of the journal file path into the config block */ - H5F_DECODE_LENGTH(cache_ptr->f, p, path_len); + H5F_DECODE_LENGTH(f, p, path_len); /* Verify that the length matches the actual path length. Also, * make note of p, as its value will be the address of our copy of @@ -569,20 +573,21 @@ done: */ herr_t -H5C2_mark_journaling_in_progress(H5C2_t * cache_ptr, +H5C2_mark_journaling_in_progress(H5F_t * f, hid_t dxpl_id, const char * journal_file_name_ptr) { + H5C2_t * cache_ptr = f->shared->cache2; herr_t result; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C2_mark_journaling_in_progress, FAIL) + HDassert( f != NULL ); + HDassert( f->shared != NULL ); + HDassert( ! f->shared->mdc_jrnl_enabled ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->f != NULL ); - HDassert( cache_ptr->f->shared != NULL ); - HDassert( ! cache_ptr->f->shared->mdc_jrnl_enabled ); HDassert( cache_ptr->mdj_conf_block_addr == HADDR_UNDEF ); HDassert( cache_ptr->mdj_conf_block_len == 0 ); HDassert( cache_ptr->mdj_conf_block_ptr == NULL ); @@ -592,14 +597,14 @@ H5C2_mark_journaling_in_progress(H5C2_t * cache_ptr, /* Can't journal a read only file, so verify that we are * opened read/write and fail if we are not. */ - if ( (cache_ptr->f->shared->flags & H5F_ACC_RDWR) == 0 ) { + if ( (f->shared->flags & H5F_ACC_RDWR) == 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTJOURNAL, FAIL, \ "File is opened read only.") } /* first, create a metadata journaling configuration block */ - result = H5C2_create_journal_config_block(cache_ptr, + result = H5C2_create_journal_config_block(f, dxpl_id, journal_file_name_ptr); @@ -618,11 +623,11 @@ H5C2_mark_journaling_in_progress(H5C2_t * cache_ptr, * into shared, and then call H5F_super_write_mdj_msg() to write * the metadata journaling superblock extension message to file. */ - cache_ptr->f->shared->mdc_jrnl_enabled = TRUE; - cache_ptr->f->shared->mdc_jrnl_block_loc = cache_ptr->mdj_conf_block_addr; - cache_ptr->f->shared->mdc_jrnl_block_len = cache_ptr->mdj_conf_block_len; + f->shared->mdc_jrnl_enabled = TRUE; + f->shared->mdc_jrnl_block_loc = cache_ptr->mdj_conf_block_addr; + f->shared->mdc_jrnl_block_len = cache_ptr->mdj_conf_block_len; - if ( H5F_super_write_mdj_msg(cache_ptr->f, dxpl_id) < 0 ) { + if ( H5F_super_write_mdj_msg(f, dxpl_id) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTJOURNAL, FAIL, \ "H5F_super_write_mdj_msg() failed.") @@ -646,7 +651,7 @@ H5C2_mark_journaling_in_progress(H5C2_t * cache_ptr, * files -- a point we haven't discussed. We should do so. */ - if ( H5Fflush(cache_ptr->f->file_id, H5F_SCOPE_GLOBAL) < 0 ) { + if ( H5Fflush(f->file_id, H5F_SCOPE_GLOBAL) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTJOURNAL, FAIL, "H5Fflush() failed.") } @@ -684,40 +689,43 @@ done: */ herr_t -H5C2_unmark_journaling_in_progress(H5C2_t * cache_ptr, +H5C2_unmark_journaling_in_progress(H5F_t * f, hid_t dxpl_id) { +#ifndef NDEBUG + H5C2_t * cache_ptr = f->shared->cache2; +#endif /* NDEBUG */ herr_t result; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C2_unmark_journaling_in_progress, FAIL) + HDassert( f != NULL ); + HDassert( f->shared != NULL ); + HDassert( f->shared->mdc_jrnl_enabled ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( cache_ptr->f != NULL ); - HDassert( cache_ptr->f->shared != NULL ); - HDassert( cache_ptr->f->shared->mdc_jrnl_enabled ); HDassert( cache_ptr->mdj_conf_block_addr != HADDR_UNDEF ); HDassert( cache_ptr->mdj_conf_block_len > 0 ); HDassert( cache_ptr->mdj_conf_block_ptr != NULL ); HDassert( cache_ptr->mdj_file_name_ptr != NULL ); - HDassert( cache_ptr->f->shared->mdc_jrnl_block_loc == + HDassert( f->shared->mdc_jrnl_block_loc == cache_ptr->mdj_conf_block_addr ); - HDassert( cache_ptr->f->shared->mdc_jrnl_block_len == + HDassert( f->shared->mdc_jrnl_block_len == cache_ptr->mdj_conf_block_len ); /* Can't journal a read only file, so verify that we are * opened read/write and fail if we are not. */ - if ( (cache_ptr->f->shared->flags & H5F_ACC_RDWR) == 0 ) { + if ( (f->shared->flags & H5F_ACC_RDWR) == 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTJOURNAL, FAIL, \ "File is opened read only.") } /* next, discard the metadata journaling configuration block */ - result = H5C2_discard_journal_config_block(cache_ptr, dxpl_id); + result = H5C2_discard_journal_config_block(f, dxpl_id); if ( result != SUCCEED ) { @@ -734,11 +742,11 @@ H5C2_unmark_journaling_in_progress(H5C2_t * cache_ptr, * progress, and then call H5F_super_write_mdj_msg() to write * the changes to disk. */ - cache_ptr->f->shared->mdc_jrnl_enabled = FALSE; - cache_ptr->f->shared->mdc_jrnl_block_loc = HADDR_UNDEF; - cache_ptr->f->shared->mdc_jrnl_block_len = 0; + f->shared->mdc_jrnl_enabled = FALSE; + f->shared->mdc_jrnl_block_loc = HADDR_UNDEF; + f->shared->mdc_jrnl_block_len = 0; - if ( H5F_super_write_mdj_msg(cache_ptr->f, dxpl_id) < 0 ) { + if ( H5F_super_write_mdj_msg(f, dxpl_id) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTJOURNAL, FAIL, \ "H5F_super_write_mdj_msg() failed.") @@ -762,7 +770,7 @@ H5C2_unmark_journaling_in_progress(H5C2_t * cache_ptr, * files -- a point we haven't discussed. We should do so. */ - if ( H5Fflush(cache_ptr->f->file_id, H5F_SCOPE_GLOBAL) < 0 ) { + if ( H5Fflush(f->file_id, H5F_SCOPE_GLOBAL) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTJOURNAL, FAIL, "H5Fflush() failed.") } @@ -1318,8 +1326,8 @@ done: herr_t H5C2_jb__init(H5C2_jbrb_t * struct_ptr, - char * HDF5_file_name, - char * journal_file_name, + const char * HDF5_file_name, + const char * journal_file_name, size_t buf_size, int num_bufs, hbool_t use_aio, @@ -1341,7 +1349,7 @@ H5C2_jb__init(H5C2_jbrb_t * struct_ptr, /* Open journal file */ struct_ptr->journal_file_fd = - open(journal_file_name, O_WRONLY|O_CREAT|O_EXCL, 0777); + HDopen(journal_file_name, O_WRONLY|O_CREAT|O_EXCL, 0777); if ( struct_ptr->journal_file_fd == -1) { @@ -1563,7 +1571,7 @@ H5C2_jb__journal_entry(H5C2_jbrb_t * struct_ptr, unsigned long trans_num, haddr_t base_addr, size_t length, - const char * body) + const uint8_t * body) { char * temp = NULL; @@ -1601,7 +1609,7 @@ H5C2_jb__journal_entry(H5C2_jbrb_t * struct_ptr, /* Write journal entry */ HDsnprintf(temp, (size_t)(length + 100), - "2 trans_num %ld length %d base_addr 0x%lx body ", + "2 trans_num %ld length %zu base_addr 0x%lx body ", trans_num, length, (unsigned long)base_addr); /* <== fix this */ @@ -1747,7 +1755,7 @@ done: herr_t H5C2_jb__comment(H5C2_jbrb_t * struct_ptr, - char * comment_ptr) + const char * comment_ptr) { char * temp = NULL; size_t temp_len; @@ -2066,19 +2074,17 @@ done: ******************************************************************************/ herr_t -H5C2_jb__bin2hex(uint8_t * buf, - uint8_t * hexdata, +H5C2_jb__bin2hex(const uint8_t * buf, + char * hexdata, size_t * hexlength, size_t buf_offset, size_t buf_size) { - - herr_t ret_value = SUCCEED; size_t u, v; /* Local index variable */ uint8_t c; - FUNC_ENTER_NOAPI(H5C2_jb__bin2hex, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5C2_jb__bin2hex) HDsnprintf(hexdata, (size_t)2, " "); @@ -2102,9 +2108,6 @@ H5C2_jb__bin2hex(uint8_t * buf, * hexlength = HDstrlen(hexdata); -done: - - FUNC_LEAVE_NOAPI(ret_value) - + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5C2_jb__bin2hex*/ diff --git a/src/H5C2pkg.h b/src/H5C2pkg.h index 7d12053..878e372 100644 --- a/src/H5C2pkg.h +++ b/src/H5C2pkg.h @@ -174,8 +174,8 @@ struct H5C2_jbrb_t unsigned long cur_trans; unsigned long last_trans_on_disk; hbool_t trans_in_prog; - char * jname; - char * hdf5_file_name; + const char * jname; + const char * hdf5_file_name; hbool_t header_present; size_t cur_buf_free_space; size_t rb_space_to_rollover; @@ -243,11 +243,6 @@ struct H5C2_jbrb_t * This field is used to validate pointers to instances of * H5C2_t. * - * f: Pointer to the instance of H5F_t associated with this - * instance of the metadata cache. This field is set at - * create, and then used until the file is closed (at which - * point, the cache will be shut down as well). - * * flush_in_progress: Boolean flag indicating whether a flush is in * progress. * @@ -1024,8 +1019,6 @@ struct H5C2_t { uint32_t magic; - H5F_t * f; - hbool_t flush_in_progress; FILE * trace_file_ptr; diff --git a/src/H5C2private.h b/src/H5C2private.h index 67d59a9..73f75e5 100644 --- a/src/H5C2private.h +++ b/src/H5C2private.h @@ -156,7 +156,7 @@ typedef struct H5C2_t H5C2_t; * * If the image contains valid data, and is of the correct length, * the deserialize function must allocate space for an in core - * represntation of that data, load the contents of the image into + * representation of that data, load the contents of the image into * the space allocated for the in core representation, and return * a pointer to the in core representation. Observe that an * instance of H5C2_cache_entry_t must be the first item in this @@ -1268,8 +1268,7 @@ typedef struct H5C2_auto_size_ctl_t #define H5C2__READ_ONLY_FLAG 0x0400 #define H5C2__CHECK_SIZE_FLAG 0x0800 -H5_DLL H5C2_t * H5C2_create(const H5F_t * f, - size_t max_cache_size, +H5_DLL H5C2_t * H5C2_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, const char * (* type_name_table_ptr), @@ -1287,22 +1286,22 @@ H5_DLL void H5C2_def_auto_resize_rpt_fcn(H5C2_t * cache_ptr, size_t old_min_clean_size, size_t new_min_clean_size); -H5_DLL herr_t H5C2_dest(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_dest(H5F_t * f, hid_t dxpl_id); H5_DLL herr_t H5C2_dest_empty(H5C2_t * cache_ptr); -H5_DLL herr_t H5C2_expunge_entry(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_expunge_entry(H5F_t * f, hid_t dxpl_id, const H5C2_class_t * type, haddr_t addr); -H5_DLL herr_t H5C2_flush_cache(H5C2_t * cache_ptr, - hid_t dxpl_id, - unsigned flags); +H5_DLL herr_t H5C2_flush_cache(H5F_t *f, + hid_t dxpl_id, + unsigned flags); -H5_DLL herr_t H5C2_flush_to_min_clean(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_flush_to_min_clean(H5F_t * f, hid_t dxpl_id); H5_DLL herr_t H5C2_get_cache_auto_resize_config(H5C2_t * cache_ptr, @@ -1317,7 +1316,7 @@ H5_DLL herr_t H5C2_get_cache_size(H5C2_t * cache_ptr, H5_DLL herr_t H5C2_get_cache_hit_rate(H5C2_t * cache_ptr, double * hit_rate_ptr); -H5_DLL herr_t H5C2_get_entry_status(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_get_entry_status(H5F_t * f, haddr_t addr, size_t * size_ptr, hbool_t * in_cache_ptr, @@ -1331,7 +1330,7 @@ H5_DLL herr_t H5C2_get_evictions_enabled(H5C2_t * cache_ptr, H5_DLL herr_t H5C2_get_trace_file_ptr(H5C2_t * cache_ptr, FILE ** trace_file_ptr_ptr); -H5_DLL herr_t H5C2_insert_entry(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_insert_entry(H5F_t * f, hid_t dxpl_id, const H5C2_class_t * type, haddr_t addr, @@ -1344,12 +1343,12 @@ H5_DLL herr_t H5C2_mark_entries_as_clean(H5C2_t * cache_ptr, int32_t ce_array_len, haddr_t * ce_array_ptr); -H5_DLL herr_t H5C2_mark_pinned_entry_dirty(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_mark_pinned_entry_dirty(H5F_t * f, void * thing, hbool_t size_changed, size_t new_size); -H5_DLL herr_t H5C2_mark_pinned_or_protected_entry_dirty(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_mark_pinned_or_protected_entry_dirty(H5F_t * f, void * thing); H5_DLL herr_t H5C2_rename_entry(H5C2_t * cache_ptr, @@ -1357,10 +1356,10 @@ H5_DLL herr_t H5C2_rename_entry(H5C2_t * cache_ptr, haddr_t old_addr, haddr_t new_addr); -H5_DLL herr_t H5C2_pin_protected_entry(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_pin_protected_entry(H5F_t * f, void * thing); -H5_DLL void * H5C2_protect(H5C2_t * cache_ptr, +H5_DLL void * H5C2_protect(H5F_t * f, hid_t dxpl_id, const H5C2_class_t * type, haddr_t addr, @@ -1370,14 +1369,14 @@ H5_DLL void * H5C2_protect(H5C2_t * cache_ptr, H5_DLL herr_t H5C2_reset_cache_hit_rate_stats(H5C2_t * cache_ptr); -H5_DLL herr_t H5C2_resize_pinned_entry(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_resize_pinned_entry(H5F_t * f, void * thing, size_t new_size); -H5_DLL herr_t H5C2_set_cache_auto_resize_config(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_set_cache_auto_resize_config(const H5F_t * f, H5C2_auto_size_ctl_t *config_ptr); -H5_DLL herr_t H5C2_set_evictions_enabled(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_set_evictions_enabled(const H5F_t * f, hbool_t evictions_enabled); H5_DLL herr_t H5C2_set_prefix(H5C2_t * cache_ptr, char * prefix); @@ -1395,9 +1394,9 @@ H5_DLL herr_t H5C2_stats(H5C2_t * cache_ptr, H5_DLL void H5C2_stats__reset(H5C2_t * cache_ptr); -H5_DLL herr_t H5C2_unpin_entry(H5C2_t * cache_ptr, void * thing); +H5_DLL herr_t H5C2_unpin_entry(H5F_t * file_ptr, void * thing); -H5_DLL herr_t H5C2_unprotect(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_unprotect(H5F_t * f, hid_t dxpl_id, const H5C2_class_t * type, haddr_t addr, @@ -1437,8 +1436,8 @@ H5_DLL herr_t H5C2_jb__write_to_buffer(H5C2_jbrb_t * struct_ptr, unsigned long trans_num); H5_DLL herr_t H5C2_jb__init(H5C2_jbrb_t * struct_ptr, - char * HDF5_file_name, - char * journal_file_name, + const char * HDF5_file_name, + const char * journal_file_name, size_t buf_size, int num_bufs, hbool_t use_aio, @@ -1451,13 +1450,13 @@ H5_DLL herr_t H5C2_jb__journal_entry(H5C2_jbrb_t * struct_ptr, unsigned long trans_num, haddr_t base_addr, size_t length, - const char * body); + const uint8_t * body); H5_DLL herr_t H5C2_jb__end_transaction(H5C2_jbrb_t * struct_ptr, unsigned long trans_num); H5_DLL herr_t H5C2_jb__comment(H5C2_jbrb_t * struct_ptr, - char * comment_ptr); + const char * comment_ptr); H5_DLL herr_t H5C2_jb__get_last_transaction_on_disk(H5C2_jbrb_t * struct_ptr, unsigned long * trans_num_ptr); @@ -1471,8 +1470,8 @@ H5_DLL herr_t H5C2_jb__reconfigure(H5C2_jbrb_t * struct_ptr, int new_num_bufs, hbool_t new_use_aio); -H5_DLL herr_t H5C2_jb__bin2hex(uint8_t * buf, - uint8_t * hexdata, +H5_DLL herr_t H5C2_jb__bin2hex(const uint8_t * buf, + char * hexdata, size_t * hexlength, size_t buf_offset, size_t buf_size); @@ -1481,26 +1480,26 @@ H5_DLL herr_t H5C2_jb__bin2hex(uint8_t * buf, /********** journal config block management function definitions: ************/ /*****************************************************************************/ -H5_DLL herr_t H5C2_create_journal_config_block(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_create_journal_config_block(H5F_t *f, hid_t dxpl_id, const char * journal_file_name_ptr); -H5_DLL herr_t H5C2_discard_journal_config_block(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_discard_journal_config_block(H5F_t * f, hid_t dxpl_id); -H5_DLL herr_t H5C2_get_journaling_in_progress(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_get_journaling_in_progress(H5F_t * f, hid_t dxpl_id); -H5_DLL herr_t H5C2_load_journal_config_block(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_load_journal_config_block(H5F_t * f, hid_t dxpl_id, haddr_t block_addr, hsize_t block_len); -H5_DLL herr_t H5C2_mark_journaling_in_progress(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_mark_journaling_in_progress(H5F_t * f, hid_t dxpl_id, const char * journal_file_name_ptr); -H5_DLL herr_t H5C2_unmark_journaling_in_progress(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_unmark_journaling_in_progress(H5F_t * f, hid_t dxpl_id); diff --git a/src/H5D.c b/src/H5D.c index 49dc4a5..81872c5 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -27,6 +27,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index 4ca5b21..4ffe458 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -27,6 +27,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 95f89cf..f0d7487 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -41,6 +41,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Dfill.c b/src/H5Dfill.c index bfb4354..0f4c2ca 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -34,6 +34,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ diff --git a/src/H5Distore.c b/src/H5Distore.c index 848668a..f78ba36 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -45,7 +45,6 @@ /* Module Setup */ /****************/ -#define H5B_PACKAGE /*suppress error about including H5Bpkg */ #define H5D_PACKAGE /*suppress error about including H5Dpkg */ @@ -53,7 +52,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Bpkg.h" /* B-link trees */ +#include "H5Bprivate.h" /* B-link trees */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ @@ -249,10 +248,8 @@ static H5B_ins_t H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void * static H5B_ins_t H5D_istore_remove( H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_udata, void *_rt_key, hbool_t *rt_key_changed); -static herr_t H5D_istore_decode_key(const H5F_t *f, const H5B_t *bt, const uint8_t *raw, - void *_key); -static herr_t H5D_istore_encode_key(const H5F_t *f, const H5B_t *bt, uint8_t *raw, - void *_key); +static herr_t H5D_istore_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); +static herr_t H5D_istore_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); static herr_t H5D_istore_debug_key(FILE *stream, H5F_t *f, hid_t dxpl_id, int indent, int fwidth, const void *key, const void *udata); @@ -332,9 +329,6 @@ H5D_istore_get_shared(const H5F_t UNUSED *f, const void *_udata) HDassert(udata->mesg); HDassert(udata->mesg->u.chunk.btree_shared); - /* Increment reference count on B-tree info */ - H5RC_INC(udata->mesg->u.chunk.btree_shared); - /* Return the pointer to the ref-count object */ FUNC_LEAVE_NOAPI(udata->mesg->u.chunk.btree_shared) } /* end H5D_istore_get_shared() */ @@ -353,29 +347,25 @@ H5D_istore_get_shared(const H5F_t UNUSED *f, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5D_istore_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw, void *_key) +H5D_istore_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { H5D_istore_key_t *key = (H5D_istore_key_t *) _key; - H5B_shared_t *shared; /* Pointer to shared B-tree info */ size_t ndims; unsigned u; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_decode_key) /* check args */ - assert(f); - assert(bt); - shared=H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); - assert(raw); - assert(key); + HDassert(raw); + HDassert(key); ndims = H5D_ISTORE_NDIMS(shared); - assert(ndims<=H5O_LAYOUT_NDIMS); + HDassert(ndims <= H5O_LAYOUT_NDIMS); /* decode */ UINT32DECODE(raw, key->nbytes); UINT32DECODE(raw, key->filter_mask); - for (u=0; uoffset[u]); FUNC_LEAVE_NOAPI(SUCCEED) @@ -395,29 +385,25 @@ H5D_istore_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw *------------------------------------------------------------------------- */ static herr_t -H5D_istore_encode_key(const H5F_t UNUSED *f, const H5B_t *bt, uint8_t *raw, void *_key) +H5D_istore_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) { - H5D_istore_key_t *key = (H5D_istore_key_t *) _key; - H5B_shared_t *shared; /* Pointer to shared B-tree info */ + const H5D_istore_key_t *key = (const H5D_istore_key_t *) _key; size_t ndims; unsigned u; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_encode_key) /* check args */ - assert(f); - assert(bt); - shared=H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); - assert(raw); - assert(key); + HDassert(raw); + HDassert(key); ndims = H5D_ISTORE_NDIMS(shared); - assert(ndims<=H5O_LAYOUT_NDIMS); + HDassert(ndims <= H5O_LAYOUT_NDIMS); /* encode */ UINT32ENCODE(raw, key->nbytes); UINT32ENCODE(raw, key->filter_mask); - for (u=0; uoffset[u]); FUNC_LEAVE_NOAPI(SUCCEED) @@ -1488,6 +1474,10 @@ H5D_istore_shared_create (const H5F_t *f, H5O_layout_t *layout) assert(shared->sizeof_rkey); shared->sizeof_rnode = H5B_nodesize(f, shared, &shared->sizeof_keys); assert(shared->sizeof_rnode); + shared->sizeof_addr = H5F_SIZEOF_ADDR(f); + assert(shared->sizeof_addr); + shared->sizeof_len = H5F_SIZEOF_SIZE(f); + assert(shared->sizeof_len); if(NULL==(shared->page=H5FL_BLK_MALLOC(chunk_page,shared->sizeof_rnode))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree page") #ifdef H5_CLEAR_MEMORY diff --git a/src/H5F.c b/src/H5F.c index 3b0770f..0f70009 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -23,9 +23,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Aprivate.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ -#if 1 /* JRM */ #include "H5AC2private.h" /* Metadata cache2 */ -#endif /* JRM */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ @@ -933,15 +931,14 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) */ if(SUCCEED != H5AC_create(f, &(f->shared->mdc_initCacheCfg))) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create meta data cache") -#if 1 /* JRM */ - /* create a metadata cache with modified API along side the regular + + /* Create a metadata cache with modified API along side the regular * version. For now, this is just for testing. Once we get it * fully in use, we will delete the old version. */ - if(SUCCEED != H5AC2_create(f, - (H5AC2_cache_config_t *)&(f->shared->mdc_initCacheCfg))) + if(H5AC2_create(f, (H5AC2_cache_config_t *)&(f->shared->mdc_initCacheCfg)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create meta data cache2") -#endif /* JRM */ + /* Create the file's "open object" information */ if(H5FO_create(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create open object data structure") @@ -1040,12 +1037,10 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) if(H5AC_dest(f, dxpl_id)) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") -#if 1 /* JRM */ /* also destroy the modified cache */ if(H5AC2_dest(f, dxpl_id)) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") -#endif /* JRM */ if(H5FO_dest(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") @@ -1719,12 +1714,9 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags) if((flags & H5F_FLUSH_INVALIDATE) != 0 ) H5AC_flags |= H5AC__FLUSH_INVALIDATE_FLAG; if(H5AC_flush(f, dxpl_id, H5AC_flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush meta data cache") -#if 1 /* JRM */ + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") if(H5AC2_flush(f, dxpl_id, H5AC_flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "unable to flush meta data cache2") -#endif /* JRM */ + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache2") /* * If we are invalidating everything (which only happens just before @@ -3075,7 +3067,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_addr_encode + * Function: H5F_addr_encode_len * * Purpose: Encodes an address into the buffer pointed to by *PP and * then increments the pointer to the first byte after the @@ -3086,31 +3078,54 @@ done: * Programmer: Robb Matzke * Friday, November 7, 1997 * - * Modifications: - * Robb Matzke, 1999-07-28 - * The ADDR argument is passed by value. *------------------------------------------------------------------------- */ void -H5F_addr_encode(const H5F_t *f, uint8_t **pp/*in,out*/, haddr_t addr) +H5F_addr_encode_len(uint8_t **pp/*in,out*/, haddr_t addr, unsigned addr_len) { - unsigned i; + unsigned u; /* Local index variable */ - assert(f); - assert(pp && *pp); + HDassert(pp && *pp); - if (H5F_addr_defined(addr)) { - for (i=0; i>= 8; - } + } /* end for */ assert("overflow" && 0 == addr); - - } else { - for (i=0; ishared->cache2, + result = H5AC2_set_cache_auto_resize_config(file, (H5AC2_cache_config_t *)config_ptr); if ( result != SUCCEED ) { @@ -3361,7 +3376,7 @@ H5Fset_mdc_config(hid_t file_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ "H5AC2_set_cache_auto_resize_config() failed."); } -#endif /* JRM */ + done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index f6fc8c4..9df85bb 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -36,12 +36,13 @@ /* Other private headers needed by this file */ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5AC2private.h" /* cache */ #include "H5FLprivate.h" /* Free Lists */ #include "H5FOprivate.h" /* File objects */ #include "H5Gprivate.h" /* Groups */ #include "H5Oprivate.h" /* Object header messages */ #include "H5RCprivate.h" /* Reference counted object functions */ -#include "H5AC2private.h" /* cache */ /* * Feature: Define this constant on the compiler command-line if you want to diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index f9a1f57..4b45481 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -301,18 +301,22 @@ typedef struct H5F_t H5F_t; case 2: UINT16DECODE(p, o); break; \ } -#define H5F_ENCODE_LENGTH(f,p,l) switch(H5F_SIZEOF_SIZE(f)) { \ +#define H5F_ENCODE_LENGTH_LEN(p,l,s) switch(s) { \ case 4: UINT32ENCODE(p,l); break; \ case 8: UINT64ENCODE(p,l); break; \ case 2: UINT16ENCODE(p,l); break; \ } -#define H5F_DECODE_LENGTH(f,p,l) switch(H5F_SIZEOF_SIZE(f)) { \ +#define H5F_ENCODE_LENGTH(f,p,l) H5F_ENCODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) + +#define H5F_DECODE_LENGTH_LEN(p,l,s) switch(s) { \ case 4: UINT32DECODE(p,l); break; \ case 8: UINT64DECODE(p,l); break; \ case 2: UINT16DECODE(p,l); break; \ } +#define H5F_DECODE_LENGTH(f,p,l) H5F_DECODE_LENGTH_LEN(p,l,H5F_SIZEOF_SIZE(f)) + /* * Macros that check for overflows. These are somewhat dangerous to fiddle * with. @@ -457,9 +461,12 @@ H5_DLL herr_t H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, hid_t dxpl_id, const void *buf); /* Address-related functions */ -H5_DLL void H5F_addr_encode(const H5F_t *, uint8_t** /*in,out*/, haddr_t); -H5_DLL void H5F_addr_decode(const H5F_t *, const uint8_t** /*in,out*/, - haddr_t* /*out*/); +H5_DLL void H5F_addr_encode_len(uint8_t **pp/*in,out*/, haddr_t addr, + unsigned addr_len); +H5_DLL void H5F_addr_encode(const H5F_t *f, uint8_t **pp/*in,out*/, + haddr_t addr); +H5_DLL void H5F_addr_decode(const H5F_t *f, const uint8_t **pp/*in,out*/, + haddr_t *addr_p/*out*/); /* File access property list callbacks */ H5_DLL herr_t H5P_facc_close(hid_t dxpl_id, void *close_data); diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 6cff5a0..e7a2d30 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -104,10 +104,8 @@ static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_l static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *lt_key, hbool_t *lt_key_changed, void *udata, void *rt_key, hbool_t *rt_key_changed); -static herr_t H5G_node_decode_key(const H5F_t *f, const H5B_t *bt, const uint8_t *raw, - void *_key); -static herr_t H5G_node_encode_key(const H5F_t *f, const H5B_t *bt, uint8_t *raw, - void *_key); +static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); +static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); static herr_t H5G_node_debug_key(FILE *stream, H5F_t *f, hid_t dxpl_id, int indent, int fwidth, const void *key, const void *udata); @@ -173,18 +171,12 @@ H5FL_BLK_DEFINE_STATIC(grp_page); static H5RC_t * H5G_node_get_shared(const H5F_t *f, const void UNUSED *_udata) { - H5RC_t *rc; + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_get_shared) - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_get_shared); - - assert(f); - - /* Increment reference count on shared B-tree node */ - rc=H5F_GRP_BTREE_SHARED(f); - H5RC_INC(rc); + HDassert(f); /* Return the pointer to the ref-count object */ - FUNC_LEAVE_NOAPI(rc); + FUNC_LEAVE_NOAPI(H5F_GRP_BTREE_SHARED(f)) } /* end H5G_node_get_shared() */ @@ -199,25 +191,23 @@ H5G_node_get_shared(const H5F_t *f, const void UNUSED *_udata) * matzke@llnl.gov * Jul 8 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5G_node_decode_key(const H5F_t *f, const H5B_t UNUSED *bt, const uint8_t *raw, void *_key) +H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { H5G_node_key_t *key = (H5G_node_key_t *) _key; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_decode_key); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_decode_key) - assert(f); - assert(raw); - assert(key); + HDassert(shared); + HDassert(raw); + HDassert(key); - H5F_DECODE_LENGTH(f, raw, key->offset); + H5F_DECODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); - FUNC_LEAVE_NOAPI(SUCCEED); -} + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5G_node_decode_key() */ /*------------------------------------------------------------------------- @@ -231,25 +221,23 @@ H5G_node_decode_key(const H5F_t *f, const H5B_t UNUSED *bt, const uint8_t *raw, * matzke@llnl.gov * Jul 8 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5G_node_encode_key(const H5F_t *f, const H5B_t UNUSED *bt, uint8_t *raw, void *_key) +H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) { - H5G_node_key_t *key = (H5G_node_key_t *) _key; + const H5G_node_key_t *key = (const H5G_node_key_t *) _key; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_encode_key); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_encode_key) - assert(f); - assert(raw); - assert(key); + HDassert(shared); + HDassert(raw); + HDassert(key); - H5F_ENCODE_LENGTH(f, raw, key->offset); + H5F_ENCODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); - FUNC_LEAVE_NOAPI(SUCCEED); -} + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5G_node_encode_key() */ /*------------------------------------------------------------------------- @@ -1637,6 +1625,10 @@ H5G_node_init(H5F_t *f) assert(shared->sizeof_rkey); shared->sizeof_rnode = H5B_nodesize(f, shared, &shared->sizeof_keys); assert(shared->sizeof_rnode); + shared->sizeof_addr = H5F_SIZEOF_ADDR(f); + assert(shared->sizeof_addr); + shared->sizeof_len = H5F_SIZEOF_SIZE(f); + assert(shared->sizeof_len); if(NULL==(shared->page=H5FL_BLK_MALLOC(grp_page,shared->sizeof_rnode))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree page") #ifdef H5_CLEAR_MEMORY diff --git a/src/H5I.c b/src/H5I.c index 0b8b84e..2bba730 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -42,6 +42,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Ipkg.h" /* IDs */ diff --git a/src/H5Omdj_msg.c b/src/H5Omdj_msg.c index 0f8115b..b95e843 100644 --- a/src/H5Omdj_msg.c +++ b/src/H5Omdj_msg.c @@ -124,7 +124,6 @@ H5O_mdj_msg_decode(H5F_t *f, unsigned UNUSED mesg_flags, const uint8_t *p) { - const char * fcn_name = "H5O_mdj_msg_decode()"; uint16_t flags = 0; /* packed boolean fields */ H5O_mdj_msg_t *mesg; /* Native message */ void *ret_value; /* Return value */ @@ -260,7 +259,6 @@ done: static void * H5O_mdj_msg_copy(const void *_mesg, void *_dest) { - const char * fcn_name = "H5O_mdj_msg_copy()"; const H5O_mdj_msg_t *mesg = (const H5O_mdj_msg_t *)_mesg; H5O_mdj_msg_t *dest = (H5O_mdj_msg_t *)_dest; void *ret_value; @@ -312,9 +310,7 @@ H5O_mdj_msg_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) { - const char * fcn_name = "H5O_mdj_msg_size()"; const H5O_mdj_msg_t * mesg = (const H5O_mdj_msg_t *)_mesg; - size_t ret_value; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mdj_msg_size) @@ -322,12 +318,7 @@ H5O_mdj_msg_size(const H5F_t *f, HDassert(f); HDassert(mesg); - ret_value = MDJ_MSG_LEN(f); - -done: - - FUNC_LEAVE_NOAPI(ret_value) - + FUNC_LEAVE_NOAPI(MDJ_MSG_LEN(f)) } /* end H5O_mdj_msg_size() */ @@ -350,23 +341,19 @@ done: static herr_t H5O_mdj_msg_reset(void *_mesg) { - const char * fcn_name = "H5O_mdj_msg_reset()"; H5O_mdj_msg_t *mesg = (H5O_mdj_msg_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mdj_msg_reset); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mdj_msg_reset) /* check args */ - assert(mesg); + HDassert(mesg); /* reset */ mesg->mdc_jrnl_enabled = FALSE; mesg->mdc_jrnl_block_loc = HADDR_UNDEF; mesg->mdc_jrnl_block_len = 0; -done: - - FUNC_LEAVE_NOAPI(SUCCEED); - + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5O_mdj_msg_reset() */ @@ -391,7 +378,6 @@ H5O_mdj_msg_debug(H5F_t UNUSED *f, int indent, int fwidth) { - const char * fcn_name = "H5O_mdj_msg_debug()"; const H5O_mdj_msg_t *mesg = (const H5O_mdj_msg_t *)_mesg; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mdj_msg_debug) @@ -415,9 +401,6 @@ H5O_mdj_msg_debug(H5F_t UNUSED *f, "mdc_jrnl_block_len:", (int)(mesg->mdc_jrnl_block_len)); -done: - FUNC_LEAVE_NOAPI(SUCCEED) - } /* end H5O_mdj_msg_debug() */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 8d6b9ab..5f98bbd 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -35,6 +35,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 81dba0c..44ac3c4 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -34,6 +34,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ diff --git a/src/H5R.c b/src/H5R.c index 627626b..ca5d8fe 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -20,6 +20,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 9dcfa45..0e2acc8 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -41,6 +41,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ #include "H5Oprivate.h" /* Object headers */ diff --git a/src/H5T.c b/src/H5T.c index 04d6c0b..3602e60 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -27,6 +27,7 @@ #include "H5private.h" /*generic functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dprivate.h" /*datasets (for H5Tcopy) */ #include "H5Eprivate.h" /*error handling */ #include "H5Fprivate.h" /* Files */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index bcb9962..1e52325 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -25,6 +25,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5FOprivate.h" /* File objects */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 64386b1..56ca889 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -41,6 +41,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5FOprivate.h" /* File objects */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 7482275..b970cdf 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -16,6 +16,7 @@ #define H5Z_PACKAGE /*suppress error about including H5Zpkg */ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ diff --git a/test/cache2.c b/test/cache2.c index 94815591..f414184 100644 --- a/test/cache2.c +++ b/test/cache2.c @@ -26,33 +26,33 @@ /* private function declarations: */ -static void smoke_check_1(void); -static void smoke_check_2(void); -static void smoke_check_3(void); -static void smoke_check_4(void); -static void smoke_check_5(void); -static void smoke_check_6(void); -static void smoke_check_7(void); -static void smoke_check_8(void); -static void smoke_check_9(void); -static void smoke_check_10(void); -static void write_permitted_check(void); -static void check_insert_entry(void); -static void check_flush_cache(void); -static void check_flush_cache__empty_cache(H5C2_t * cache_ptr); -static void check_flush_cache__multi_entry(H5C2_t * cache_ptr); -static void check_flush_cache__multi_entry_test(H5C2_t * cache_ptr, +static unsigned smoke_check_1(void); +static unsigned smoke_check_2(void); +static unsigned smoke_check_3(void); +static unsigned smoke_check_4(void); +static unsigned smoke_check_5(void); +static unsigned smoke_check_6(void); +static unsigned smoke_check_7(void); +static unsigned smoke_check_8(void); +static unsigned smoke_check_9(void); +static unsigned smoke_check_10(void); +static unsigned write_permitted_check(void); +static unsigned check_insert_entry(void); +static unsigned check_flush_cache(void); +static void check_flush_cache__empty_cache(H5F_t * file_ptr); +static void check_flush_cache__multi_entry(H5F_t * file_ptr); +static void check_flush_cache__multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, int spec_size, struct flush_cache_test_spec spec[]); -static void check_flush_cache__pe_multi_entry_test(H5C2_t * cache_ptr, +static void check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, int spec_size, struct pe_flush_cache_test_spec spec[]); -static void check_flush_cache__single_entry(H5C2_t * cache_ptr); -static void check_flush_cache__single_entry_test(H5C2_t * cache_ptr, +static void check_flush_cache__single_entry(H5F_t * file_ptr); +static void check_flush_cache__single_entry_test(H5F_t * file_ptr, int test_num, int entry_type, int entry_idx, @@ -64,7 +64,7 @@ static void check_flush_cache__single_entry_test(H5C2_t * cache_ptr, hbool_t expected_cleared, hbool_t expected_serialized, hbool_t expected_destroyed); -static void check_flush_cache__pinned_single_entry_test(H5C2_t * cache_ptr, +static void check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, int test_num, int entry_type, int entry_idx, @@ -78,8 +78,8 @@ static void check_flush_cache__pinned_single_entry_test(H5C2_t * cache_ptr, hbool_t expected_cleared, hbool_t expected_serialized, hbool_t expected_destroyed); -static void check_flush_cache__flush_ops(H5C2_t * cache_ptr); -static void check_flush_cache__flush_op_test(H5C2_t * cache_ptr, +static void check_flush_cache__flush_ops(H5F_t * file_ptr); +static void check_flush_cache__flush_op_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, int spec_size, @@ -90,37 +90,37 @@ static void check_flush_cache__flush_op_test(H5C2_t * cache_ptr, size_t expected_index_size, int check_size, struct fo_flush_entry_check check[]); -static void check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr); -static void check_flush_protected_err(void); -static void check_get_entry_status(void); -static void check_expunge_entry(void); -static void check_multiple_read_protect(void); -static void check_rename_entry(void); -static void check_rename_entry__run_test(H5C2_t * cache_ptr, int test_num, +static void check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr); +static unsigned check_get_entry_status(void); +static unsigned check_expunge_entry(void); +static unsigned check_multiple_read_protect(void); +static unsigned check_rename_entry(void); +static void check_rename_entry__run_test(H5F_t * file_ptr, int test_num, struct rename_entry_test_spec * spec_ptr); -static void check_pin_protected_entry(void); -static void check_resize_entry(void); -static void check_evictions_enabled(void); -static void check_destroy_pinned_err(void); -static void check_destroy_protected_err(void); -static void check_duplicate_insert_err(void); -static void check_rename_err(void); -static void check_double_pin_err(void); -static void check_double_unpin_err(void); -static void check_pin_entry_errs(void); -static void check_double_protect_err(void); -static void check_double_unprotect_err(void); -static void check_mark_entry_dirty_errs(void); -static void check_expunge_entry_errs(void); -static void check_resize_entry_errs(void); -static void check_unprotect_ro_dirty_err(void); -static void check_protect_ro_rw_err(void); -static void check_check_evictions_enabled_err(void); -static void check_auto_cache_resize(void); -static void check_auto_cache_resize_disable(void); -static void check_auto_cache_resize_epoch_markers(void); -static void check_auto_cache_resize_input_errs(void); -static void check_auto_cache_resize_aux_fcns(void); +static unsigned check_pin_protected_entry(void); +static unsigned check_resize_entry(void); +static unsigned check_evictions_enabled(void); +static unsigned check_flush_protected_err(void); +static unsigned check_destroy_pinned_err(void); +static unsigned check_destroy_protected_err(void); +static unsigned check_duplicate_insert_err(void); +static unsigned check_rename_err(void); +static unsigned check_double_pin_err(void); +static unsigned check_double_unpin_err(void); +static unsigned check_pin_entry_errs(void); +static unsigned check_double_protect_err(void); +static unsigned check_double_unprotect_err(void); +static unsigned check_mark_entry_dirty_errs(void); +static unsigned check_expunge_entry_errs(void); +static unsigned check_resize_entry_errs(void); +static unsigned check_unprotect_ro_dirty_err(void); +static unsigned check_protect_ro_rw_err(void); +static unsigned check_check_evictions_enabled_err(void); +static unsigned check_auto_cache_resize(void); +static unsigned check_auto_cache_resize_disable(void); +static unsigned check_auto_cache_resize_epoch_markers(void); +static unsigned check_auto_cache_resize_input_errs(void); +static unsigned check_auto_cache_resize_aux_fcns(void); /**************************************************************************/ @@ -150,7 +150,7 @@ static void check_auto_cache_resize_aux_fcns(void); *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_1(void) { const char * fcn_name = "smoke_check_1"; @@ -162,7 +162,7 @@ smoke_check_1(void) int32_t lag = 10; int32_t max_index = (10 * 1024) - 1; int mile_stone = 1; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache"); @@ -183,7 +183,7 @@ smoke_check_1(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -199,14 +199,14 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(4 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -226,7 +226,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_backward2(/* cache_ptr */ cache_ptr, + row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -246,7 +246,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -268,7 +268,7 @@ smoke_check_1(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -277,7 +277,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_forward2(/* cache_ptr */ cache_ptr, + col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -294,7 +294,7 @@ smoke_check_1(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -303,7 +303,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_backward2(/* cache_ptr */ cache_ptr, + col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -318,7 +318,7 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -335,7 +335,7 @@ smoke_check_1(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_1() */ @@ -362,7 +362,7 @@ smoke_check_1(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_2(void) { const char * fcn_name = "smoke_check_2"; @@ -374,7 +374,7 @@ smoke_check_2(void) int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache"); @@ -395,7 +395,7 @@ smoke_check_2(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -411,14 +411,14 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(4 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -438,7 +438,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_backward2(/* cache_ptr */ cache_ptr, + row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -458,7 +458,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -480,7 +480,7 @@ smoke_check_2(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -489,7 +489,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_forward2(/* cache_ptr */ cache_ptr, + col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -506,7 +506,7 @@ smoke_check_2(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -515,7 +515,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_backward2(/* cache_ptr */ cache_ptr, + col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -530,7 +530,7 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -547,7 +547,7 @@ smoke_check_2(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_2() */ @@ -573,7 +573,7 @@ smoke_check_2(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_3(void) { const char * fcn_name = "smoke_check_3"; @@ -585,7 +585,7 @@ smoke_check_3(void) int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache"); @@ -606,7 +606,7 @@ smoke_check_3(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -622,14 +622,14 @@ smoke_check_3(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -649,7 +649,7 @@ smoke_check_3(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_backward2(/* cache_ptr */ cache_ptr, + row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -669,7 +669,7 @@ smoke_check_3(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -691,7 +691,7 @@ smoke_check_3(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -700,7 +700,7 @@ smoke_check_3(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_forward2(/* cache_ptr */ cache_ptr, + col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -717,7 +717,7 @@ smoke_check_3(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -726,7 +726,7 @@ smoke_check_3(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_backward2(/* cache_ptr */ cache_ptr, + col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -741,7 +741,7 @@ smoke_check_3(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -758,7 +758,7 @@ smoke_check_3(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_3() */ @@ -785,7 +785,7 @@ smoke_check_3(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_4(void) { const char * fcn_name = "smoke_check_4"; @@ -797,7 +797,7 @@ smoke_check_4(void) int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache"); @@ -818,7 +818,7 @@ smoke_check_4(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -834,14 +834,14 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -861,7 +861,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_backward2(/* cache_ptr */ cache_ptr, + row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -881,7 +881,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -903,7 +903,7 @@ smoke_check_4(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -912,7 +912,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_forward2(/* cache_ptr */ cache_ptr, + col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -929,7 +929,7 @@ smoke_check_4(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -938,7 +938,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_backward2(/* cache_ptr */ cache_ptr, + col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -953,7 +953,7 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -970,7 +970,7 @@ smoke_check_4(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_4() */ @@ -997,7 +997,7 @@ smoke_check_4(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_5(void) { const char * fcn_name = "smoke_check_5"; @@ -1008,7 +1008,7 @@ smoke_check_5(void) hbool_t display_stats = FALSE; int32_t max_index = 1024; int mile_stone = 1; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C2__CURR_AUTO_SIZE_CTL_VER, @@ -1077,7 +1077,7 @@ smoke_check_5(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -1093,12 +1093,12 @@ smoke_check_5(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -1111,7 +1111,7 @@ smoke_check_5(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1124,7 +1124,7 @@ smoke_check_5(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_backward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1137,7 +1137,7 @@ smoke_check_5(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1152,7 +1152,7 @@ smoke_check_5(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -1161,7 +1161,7 @@ smoke_check_5(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_col_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1177,7 +1177,7 @@ smoke_check_5(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -1186,7 +1186,7 @@ smoke_check_5(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_col_major_scan_backward2(/* cache_ptr */ cache_ptr, + hl_col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1200,7 +1200,7 @@ smoke_check_5(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -1217,7 +1217,7 @@ smoke_check_5(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_5() */ @@ -1244,7 +1244,7 @@ smoke_check_5(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_6(void) { const char * fcn_name = "smoke_check_6"; @@ -1255,7 +1255,7 @@ smoke_check_6(void) hbool_t display_stats = FALSE; int mile_stone = 1; int32_t max_index = 1024; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C2__CURR_AUTO_SIZE_CTL_VER, @@ -1326,7 +1326,7 @@ smoke_check_6(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -1340,12 +1340,12 @@ smoke_check_6(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -1358,7 +1358,7 @@ smoke_check_6(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1371,7 +1371,7 @@ smoke_check_6(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_backward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1384,7 +1384,7 @@ smoke_check_6(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1399,7 +1399,7 @@ smoke_check_6(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -1408,7 +1408,7 @@ smoke_check_6(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_col_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1424,7 +1424,7 @@ smoke_check_6(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -1433,7 +1433,7 @@ smoke_check_6(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_col_major_scan_backward2(/* cache_ptr */ cache_ptr, + hl_col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1447,7 +1447,7 @@ smoke_check_6(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -1464,7 +1464,7 @@ smoke_check_6(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_6() */ @@ -1491,7 +1491,7 @@ smoke_check_6(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_7(void) { const char * fcn_name = "smoke_check_7"; @@ -1502,7 +1502,7 @@ smoke_check_7(void) hbool_t display_stats = FALSE; int mile_stone = 1; int32_t max_index = 1024; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C2__CURR_AUTO_SIZE_CTL_VER, @@ -1572,7 +1572,7 @@ smoke_check_7(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -1588,12 +1588,12 @@ smoke_check_7(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -1606,7 +1606,7 @@ smoke_check_7(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1619,7 +1619,7 @@ smoke_check_7(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_backward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1632,7 +1632,7 @@ smoke_check_7(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1647,7 +1647,7 @@ smoke_check_7(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -1656,7 +1656,7 @@ smoke_check_7(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_col_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1672,7 +1672,7 @@ smoke_check_7(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -1681,7 +1681,7 @@ smoke_check_7(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_col_major_scan_backward2(/* cache_ptr */ cache_ptr, + hl_col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1695,7 +1695,7 @@ smoke_check_7(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -1712,7 +1712,7 @@ smoke_check_7(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_7() */ @@ -1739,7 +1739,7 @@ smoke_check_7(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_8(void) { const char * fcn_name = "smoke_check_8"; @@ -1750,7 +1750,7 @@ smoke_check_8(void) hbool_t display_stats = FALSE; int mile_stone = 1; int32_t max_index = 1024; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C2__CURR_AUTO_SIZE_CTL_VER, @@ -1820,7 +1820,7 @@ smoke_check_8(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -1836,12 +1836,12 @@ smoke_check_8(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -1854,7 +1854,7 @@ smoke_check_8(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1867,7 +1867,7 @@ smoke_check_8(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_backward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1880,7 +1880,7 @@ smoke_check_8(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_row_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1895,7 +1895,7 @@ smoke_check_8(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -1904,7 +1904,7 @@ smoke_check_8(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_col_major_scan_forward2(/* cache_ptr */ cache_ptr, + hl_col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1920,7 +1920,7 @@ smoke_check_8(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -1929,7 +1929,7 @@ smoke_check_8(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - hl_col_major_scan_backward2(/* cache_ptr */ cache_ptr, + hl_col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -1943,7 +1943,7 @@ smoke_check_8(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -1960,7 +1960,7 @@ smoke_check_8(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_8() */ @@ -1988,7 +1988,7 @@ smoke_check_8(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_9(void) { const char * fcn_name = "smoke_check_9"; @@ -2002,7 +2002,7 @@ smoke_check_9(void) int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked"); @@ -2023,7 +2023,7 @@ smoke_check_9(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -2039,7 +2039,7 @@ smoke_check_9(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(4 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); /* disable evictions */ @@ -2050,7 +2050,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result < 0 ) { @@ -2063,7 +2063,7 @@ smoke_check_9(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions disabled\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2087,7 +2087,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, TRUE); + result = H5C2_set_evictions_enabled(file_ptr, TRUE); if ( result < 0 ) { @@ -2100,7 +2100,7 @@ smoke_check_9(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions enabled \n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_backward2(/* cache_ptr */ cache_ptr, + row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2122,7 +2122,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result < 0 ) { @@ -2135,7 +2135,7 @@ smoke_check_9(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions disabled \n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2157,7 +2157,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, TRUE); + result = H5C2_set_evictions_enabled(file_ptr, TRUE); if ( result < 0 ) { @@ -2172,7 +2172,7 @@ smoke_check_9(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -2183,7 +2183,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result < 0 ) { @@ -2196,7 +2196,7 @@ smoke_check_9(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions disabled\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_forward2(/* cache_ptr */ cache_ptr, + col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2213,7 +2213,7 @@ smoke_check_9(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -2224,7 +2224,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, TRUE); + result = H5C2_set_evictions_enabled(file_ptr, TRUE); if ( result < 0 ) { @@ -2237,7 +2237,7 @@ smoke_check_9(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions enabled\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_backward2(/* cache_ptr */ cache_ptr, + col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2254,7 +2254,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result < 0 ) { @@ -2268,7 +2268,7 @@ smoke_check_9(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions disabled\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 18 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -2285,7 +2285,7 @@ smoke_check_9(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_9() */ @@ -2313,7 +2313,7 @@ smoke_check_9(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_10(void) { const char * fcn_name = "smoke_check_10"; @@ -2327,7 +2327,7 @@ smoke_check_10(void) int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked"); @@ -2348,7 +2348,7 @@ smoke_check_10(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -2364,14 +2364,14 @@ smoke_check_10(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(4 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions enabled\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2393,7 +2393,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result < 0 ) { @@ -2406,7 +2406,7 @@ smoke_check_10(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions disabled\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_backward2(/* cache_ptr */ cache_ptr, + row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2428,7 +2428,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, TRUE); + result = H5C2_set_evictions_enabled(file_ptr, TRUE); if ( result < 0 ) { @@ -2441,7 +2441,7 @@ smoke_check_10(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions enabled\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2463,7 +2463,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result < 0 ) { @@ -2478,7 +2478,7 @@ smoke_check_10(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -2489,7 +2489,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, TRUE); + result = H5C2_set_evictions_enabled(file_ptr, TRUE); if ( result < 0 ) { @@ -2502,7 +2502,7 @@ smoke_check_10(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions enabled\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_forward2(/* cache_ptr */ cache_ptr, + col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2519,7 +2519,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result < 0 ) { @@ -2534,7 +2534,7 @@ smoke_check_10(void) /* flush all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -2545,7 +2545,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, TRUE); + result = H5C2_set_evictions_enabled(file_ptr, TRUE); if ( result < 0 ) { @@ -2558,7 +2558,7 @@ smoke_check_10(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions enabled\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_backward2(/* cache_ptr */ cache_ptr, + col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2575,7 +2575,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result < 0 ) { @@ -2588,7 +2588,7 @@ smoke_check_10(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions disabled\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 18 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -2605,7 +2605,7 @@ smoke_check_10(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* smoke_check_10() */ @@ -2629,7 +2629,7 @@ smoke_check_10(void) *------------------------------------------------------------------------- */ -static void +static unsigned write_permitted_check(void) { @@ -2666,7 +2666,7 @@ write_permitted_check(void) default: SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; /* <========== note return */ + return 0; /* <========== note return */ break; } @@ -2823,7 +2823,7 @@ write_permitted_check(void) #endif /* H5C2_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - return; + return !pass2; } /* write_permitted_check() */ @@ -2849,7 +2849,7 @@ write_permitted_check(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_insert_entry(void) { const char * fcn_name = "check_insert_entry"; @@ -2864,6 +2864,7 @@ check_insert_entry(void) hbool_t is_pinned; hbool_t show_progress = FALSE; size_t entry_size; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -2892,8 +2893,9 @@ check_insert_entry(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); + cache_ptr = file_ptr->shared->cache2; } if ( show_progress ) { @@ -2902,11 +2904,11 @@ check_insert_entry(void) if ( pass2 ) { - insert_entry2(cache_ptr, entry_type, 0, TRUE, H5C2__NO_FLAGS_SET); - insert_entry2(cache_ptr, entry_type, 1, TRUE, + insert_entry2(file_ptr, entry_type, 0, TRUE, H5C2__NO_FLAGS_SET); + insert_entry2(file_ptr, entry_type, 1, TRUE, H5C2__SET_FLUSH_MARKER_FLAG); - insert_entry2(cache_ptr, entry_type, 2, TRUE, H5C2__PIN_ENTRY_FLAG); - insert_entry2(cache_ptr, entry_type, 3, TRUE, + insert_entry2(file_ptr, entry_type, 2, TRUE, H5C2__PIN_ENTRY_FLAG); + insert_entry2(file_ptr, entry_type, 3, TRUE, (H5C2__SET_FLUSH_MARKER_FLAG | H5C2__PIN_ENTRY_FLAG)); } @@ -2931,7 +2933,7 @@ check_insert_entry(void) fcn_name, i, point, subpoint++); } - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -3179,8 +3181,8 @@ check_insert_entry(void) if ( pass2 ) { - unpin_entry2(cache_ptr, entry_type, 2); - unpin_entry2(cache_ptr, entry_type, 3); + unpin_entry2(file_ptr, entry_type, 2); + unpin_entry2(file_ptr, entry_type, 3); } if ( show_progress ) { @@ -3189,7 +3191,7 @@ check_insert_entry(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( show_progress ) { @@ -3204,7 +3206,7 @@ check_insert_entry(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_insert_entry() */ @@ -3225,13 +3227,13 @@ check_insert_entry(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_flush_cache(void) { const char * fcn_name = "check_flush_cache"; hbool_t show_progress = FALSE; int mile_stone = 0; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("H5C2_flush_cache() functionality"); @@ -3250,7 +3252,7 @@ check_flush_cache(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); } @@ -3264,7 +3266,7 @@ check_flush_cache(void) if ( pass2 ) { - check_flush_cache__empty_cache(cache_ptr); + check_flush_cache__empty_cache(file_ptr); } if ( show_progress ) { /* 2 */ @@ -3277,7 +3279,7 @@ check_flush_cache(void) if ( pass2 ) { - check_flush_cache__single_entry(cache_ptr); + check_flush_cache__single_entry(file_ptr); } if ( show_progress ) { /* 3 */ @@ -3286,7 +3288,7 @@ check_flush_cache(void) if ( pass2 ) { - check_flush_cache__multi_entry(cache_ptr); + check_flush_cache__multi_entry(file_ptr); } if ( show_progress ) { /* 4 */ @@ -3295,7 +3297,7 @@ check_flush_cache(void) if ( pass2 ) { - check_flush_cache__flush_ops(cache_ptr); + check_flush_cache__flush_ops(file_ptr); } if ( show_progress ) { /* 5 */ @@ -3304,7 +3306,7 @@ check_flush_cache(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( show_progress ) { /* 6 */ @@ -3319,7 +3321,7 @@ check_flush_cache(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_flush_cache() */ @@ -3341,9 +3343,10 @@ check_flush_cache(void) */ static void -check_flush_cache__empty_cache(H5C2_t * cache_ptr) +check_flush_cache__empty_cache(H5F_t * file_ptr) { /* const char * fcn_name = "check_flush_cache__empty_cache"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; herr_t result; if ( cache_ptr == NULL ) { @@ -3365,7 +3368,7 @@ check_flush_cache__empty_cache(H5C2_t * cache_ptr) if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__NO_FLAGS_SET); if ( result < 0 ) { @@ -3377,7 +3380,7 @@ check_flush_cache__empty_cache(H5C2_t * cache_ptr) if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -3389,7 +3392,7 @@ check_flush_cache__empty_cache(H5C2_t * cache_ptr) if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_CLEAR_ONLY_FLAG); if ( result < 0 ) { @@ -3402,7 +3405,7 @@ check_flush_cache__empty_cache(H5C2_t * cache_ptr) if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_MARKED_ENTRIES_FLAG); if ( result < 0 ) { @@ -3435,9 +3438,10 @@ check_flush_cache__empty_cache(H5C2_t * cache_ptr) */ static void -check_flush_cache__multi_entry(H5C2_t * cache_ptr) +check_flush_cache__multi_entry(H5F_t * file_ptr) { /* const char * fcn_name = "check_flush_cache__multi_entry"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; if ( cache_ptr == NULL ) { @@ -3556,7 +3560,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__multi_entry_test(cache_ptr, test_num, + check_flush_cache__multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -3666,7 +3670,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__multi_entry_test(cache_ptr, test_num, + check_flush_cache__multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -3776,7 +3780,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__multi_entry_test(cache_ptr, test_num, + check_flush_cache__multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -3886,7 +3890,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__multi_entry_test(cache_ptr, test_num, + check_flush_cache__multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -3997,7 +4001,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__multi_entry_test(cache_ptr, test_num, + check_flush_cache__multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -4108,7 +4112,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__multi_entry_test(cache_ptr, test_num, + check_flush_cache__multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -4219,7 +4223,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__multi_entry_test(cache_ptr, test_num, + check_flush_cache__multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -4331,7 +4335,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__multi_entry_test(cache_ptr, test_num, + check_flush_cache__multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -4445,7 +4449,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__multi_entry_test(cache_ptr, test_num, + check_flush_cache__multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -4612,7 +4616,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__pe_multi_entry_test(cache_ptr, test_num, + check_flush_cache__pe_multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -4758,7 +4762,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__pe_multi_entry_test(cache_ptr, test_num, + check_flush_cache__pe_multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -4895,7 +4899,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__pe_multi_entry_test(cache_ptr, test_num, + check_flush_cache__pe_multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -5041,7 +5045,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__pe_multi_entry_test(cache_ptr, test_num, + check_flush_cache__pe_multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -5184,7 +5188,7 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) } }; - check_flush_cache__pe_multi_entry_test(cache_ptr, test_num, + check_flush_cache__pe_multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } @@ -5209,13 +5213,14 @@ check_flush_cache__multi_entry(H5C2_t * cache_ptr) */ static void -check_flush_cache__multi_entry_test(H5C2_t * cache_ptr, +check_flush_cache__multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, int spec_size, struct flush_cache_test_spec spec[]) { /* const char * fcn_name = "check_flush_cache__multi_entry_test"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; static char msg[128]; herr_t result; int i; @@ -5280,14 +5285,14 @@ check_flush_cache__multi_entry_test(H5C2_t * cache_ptr, { if ( spec[i].insert_flag ) { - insert_entry2(cache_ptr, spec[i].entry_type, spec[i].entry_index, + insert_entry2(file_ptr, spec[i].entry_type, spec[i].entry_index, spec[i].dirty_flag, spec[i].flags); } else { - protect_entry2(cache_ptr, spec[i].entry_type, spec[i].entry_index); + protect_entry2(file_ptr, spec[i].entry_type, spec[i].entry_index); - unprotect_entry2(cache_ptr, spec[i].entry_type, spec[i].entry_index, + unprotect_entry2(file_ptr, spec[i].entry_type, spec[i].entry_index, (int)(spec[i].dirty_flag), spec[i].flags); } @@ -5298,7 +5303,7 @@ check_flush_cache__multi_entry_test(H5C2_t * cache_ptr, if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -5390,7 +5395,7 @@ check_flush_cache__multi_entry_test(H5C2_t * cache_ptr, /* clean up the cache to prep for the next test */ if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -5448,13 +5453,14 @@ check_flush_cache__multi_entry_test(H5C2_t * cache_ptr, */ static void -check_flush_cache__pe_multi_entry_test(H5C2_t * cache_ptr, +check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, int spec_size, struct pe_flush_cache_test_spec spec[]) { /* const char * fcn_name = "check_flush_cache__pe_multi_entry_test"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; static char msg[128]; herr_t result; int i; @@ -5522,14 +5528,14 @@ check_flush_cache__pe_multi_entry_test(H5C2_t * cache_ptr, { if ( spec[i].insert_flag ) { - insert_entry2(cache_ptr, spec[i].entry_type, spec[i].entry_index, + insert_entry2(file_ptr, spec[i].entry_type, spec[i].entry_index, spec[i].dirty_flag, spec[i].flags); } else { - protect_entry2(cache_ptr, spec[i].entry_type, spec[i].entry_index); + protect_entry2(file_ptr, spec[i].entry_type, spec[i].entry_index); - unprotect_entry2(cache_ptr, spec[i].entry_type, spec[i].entry_index, + unprotect_entry2(file_ptr, spec[i].entry_type, spec[i].entry_index, (int)(spec[i].dirty_flag), spec[i].flags); } @@ -5537,7 +5543,7 @@ check_flush_cache__pe_multi_entry_test(H5C2_t * cache_ptr, for ( j = 0; j < spec[i].num_pins; j++ ) { - create_pinned_entry_dependency2(cache_ptr, + create_pinned_entry_dependency2(file_ptr, spec[i].entry_type, spec[i].entry_index, spec[i].pin_type[j], @@ -5549,7 +5555,7 @@ check_flush_cache__pe_multi_entry_test(H5C2_t * cache_ptr, if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -5641,7 +5647,7 @@ check_flush_cache__pe_multi_entry_test(H5C2_t * cache_ptr, /* clean up the cache to prep for the next test */ if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -5705,9 +5711,10 @@ check_flush_cache__pe_multi_entry_test(H5C2_t * cache_ptr, */ static void -check_flush_cache__flush_ops(H5C2_t * cache_ptr) +check_flush_cache__flush_ops(H5F_t * file_ptr) { /* const char * fcn_name = "check_flush_cache__flush_ops"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; if ( cache_ptr == NULL ) { @@ -5813,7 +5820,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -5921,7 +5928,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -5998,7 +6005,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6077,7 +6084,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6163,7 +6170,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6191,7 +6198,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) spec[0].flush_ops[1].flag = TRUE; test_num = 6; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6281,7 +6288,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6314,7 +6321,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) spec[0].flush_ops[1].flag = TRUE; spec[0].expected_destroyed = TRUE; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6395,7 +6402,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6423,7 +6430,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) spec[0].flush_ops[1].flag = TRUE; test_num = 10; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6507,7 +6514,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6540,7 +6547,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) spec[0].expected_destroyed = TRUE; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6637,7 +6644,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6735,7 +6742,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6832,7 +6839,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -6929,7 +6936,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -7026,7 +7033,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -7054,7 +7061,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) checks[0].at_main_addr = TRUE; checks[1].at_main_addr = TRUE; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -7155,7 +7162,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -7191,7 +7198,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) checks[1].in_cache = FALSE; checks[1].expected_destroyed = TRUE; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -7410,7 +7417,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -7681,7 +7688,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -7951,7 +7958,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -8088,7 +8095,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -8222,7 +8229,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -8653,7 +8660,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -9090,7 +9097,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -9281,7 +9288,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -9474,7 +9481,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } }; - check_flush_cache__flush_op_test(cache_ptr, + check_flush_cache__flush_op_test(file_ptr, test_num, flush_flags, spec_size, @@ -9490,7 +9497,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) } /* finally finish up with the flush ops eviction test */ - check_flush_cache__flush_op_eviction_test(cache_ptr); + check_flush_cache__flush_op_eviction_test(file_ptr); return; @@ -9514,7 +9521,7 @@ check_flush_cache__flush_ops(H5C2_t * cache_ptr) */ static void -check_flush_cache__flush_op_test(H5C2_t * cache_ptr, +check_flush_cache__flush_op_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, int spec_size, @@ -9527,6 +9534,7 @@ check_flush_cache__flush_op_test(H5C2_t * cache_ptr, struct fo_flush_entry_check check[]) { /* const char * fcn_name = "check_flush_cache__flush_op_test"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; static char msg[128]; herr_t result; int i; @@ -9634,21 +9642,21 @@ check_flush_cache__flush_op_test(H5C2_t * cache_ptr, { if ( spec[i].insert_flag ) { - insert_entry2(cache_ptr, spec[i].entry_type, spec[i].entry_index, + insert_entry2(file_ptr, spec[i].entry_type, spec[i].entry_index, TRUE, spec[i].flags); } else { - protect_entry2(cache_ptr, spec[i].entry_type, spec[i].entry_index); + protect_entry2(file_ptr, spec[i].entry_type, spec[i].entry_index); - unprotect_entry_with_size_change2(cache_ptr, spec[i].entry_type, + unprotect_entry_with_size_change2(file_ptr, spec[i].entry_type, spec[i].entry_index, spec[i].flags, spec[i].new_size); } for ( j = 0; j < spec[i].num_pins; j++ ) { - create_pinned_entry_dependency2(cache_ptr, + create_pinned_entry_dependency2(file_ptr, spec[i].entry_type, spec[i].entry_index, spec[i].pin_type[j], @@ -9685,7 +9693,7 @@ check_flush_cache__flush_op_test(H5C2_t * cache_ptr, if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -9929,7 +9937,7 @@ check_flush_cache__flush_op_test(H5C2_t * cache_ptr, /* clean up the cache to prep for the next test */ if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -10017,9 +10025,10 @@ check_flush_cache__flush_op_test(H5C2_t * cache_ptr, */ static void -check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) +check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) { /* const char * fcn_name = "check_flush_cache__flush_op_eviction_test"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; int i; int num_variable_entries = 10; int num_monster_entries = 31; @@ -10141,50 +10150,50 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) * Start by just loading the entries. */ - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 0); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 0, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 0); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 0, H5C2__DIRTIED_FLAG | H5C2__SIZE_CHANGED_FLAG, (VARIABLE_ENTRY_SIZE / 4)); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 1); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 1, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 1); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C2__DIRTIED_FLAG | H5C2__SIZE_CHANGED_FLAG, (VARIABLE_ENTRY_SIZE / 4)); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 2); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 2, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 2); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 2, H5C2__NO_FLAGS_SET, (size_t)0); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 3); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 3, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 3); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 3, H5C2__DIRTIED_FLAG | H5C2__SIZE_CHANGED_FLAG, (VARIABLE_ENTRY_SIZE / 4)); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 4); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 4, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 4); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C2__NO_FLAGS_SET, (size_t)0); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 5); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 5, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 5); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 5, H5C2__DIRTIED_FLAG | H5C2__SIZE_CHANGED_FLAG, (VARIABLE_ENTRY_SIZE / 4)); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 6); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 6, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 6); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C2__DIRTIED_FLAG | H5C2__SIZE_CHANGED_FLAG, (VARIABLE_ENTRY_SIZE / 2)); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 7); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 7, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 7); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C2__DIRTIED_FLAG | H5C2__SIZE_CHANGED_FLAG, (VARIABLE_ENTRY_SIZE / 2)); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 8); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 8, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 8); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C2__NO_FLAGS_SET, (size_t)0); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 9); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 9, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 9); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C2__NO_FLAGS_SET, (size_t)0); if ( ( cache_ptr->index_len != 10 ) || @@ -10204,15 +10213,15 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 3), and (VET, 5) * (VET, 9) is pinned by (VET, 5), and (VET, 7) */ - create_pinned_entry_dependency2(cache_ptr, VARIABLE_ENTRY_TYPE, 1, + create_pinned_entry_dependency2(file_ptr, VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency2(cache_ptr, VARIABLE_ENTRY_TYPE, 3, + create_pinned_entry_dependency2(file_ptr, VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency2(cache_ptr, VARIABLE_ENTRY_TYPE, 5, + create_pinned_entry_dependency2(file_ptr, VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency2(cache_ptr, VARIABLE_ENTRY_TYPE, 5, + create_pinned_entry_dependency2(file_ptr, VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_TYPE, 9); - create_pinned_entry_dependency2(cache_ptr, VARIABLE_ENTRY_TYPE, 7, + create_pinned_entry_dependency2(file_ptr, VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_TYPE, 9); /* Next, set up the flush operations: @@ -10299,15 +10308,15 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) /* Now fill up the cache with other, unrelated entries */ for ( i = 0; i < 31; i++ ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, MONSTER_ENTRY_TYPE, i, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, MONSTER_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } for ( i = 0; i < 1; i++ ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, i, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } @@ -10380,8 +10389,8 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) num_large_entries = 2; - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, 1, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 1); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, 1, H5C2__DIRTIED_FLAG, (size_t)0); if ( ( cache_ptr->index_len != 42 ) || @@ -10451,8 +10460,8 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) num_large_entries = 3; - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, 2, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 2); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, 2, H5C2__DIRTIED_FLAG, (size_t)0); if ( ( cache_ptr->index_len != 42 ) || @@ -10530,12 +10539,12 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) num_large_entries = 5; - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, 3, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 3); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, 3, H5C2__DIRTIED_FLAG, (size_t)0); - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 4); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, 4, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 4); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, 4, H5C2__DIRTIED_FLAG, (size_t)0); /* verify cache size */ @@ -10573,15 +10582,15 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) */ for ( i = 0; i < 31; i++ ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, MONSTER_ENTRY_TYPE, i, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, MONSTER_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } for ( i = 0; i < 5; i++ ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, i, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } @@ -10656,8 +10665,8 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) for ( i = 5; i < 8; i++ ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, i, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } @@ -10724,8 +10733,8 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) for ( i = 8; i < 9; i++ ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, i, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } @@ -10794,8 +10803,8 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) for ( i = 9; i < 10; i++ ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, i, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } @@ -10830,15 +10839,15 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) */ for ( i = 0; i < 31; i++ ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, MONSTER_ENTRY_TYPE, i, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, MONSTER_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } for ( i = 0; i < 10; i++ ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, i, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } @@ -10993,8 +11002,8 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) for ( i = 10; i < 12; i++ ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, i, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } @@ -11026,15 +11035,15 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) */ for ( i = 0; i < num_monster_entries; i++ ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, MONSTER_ENTRY_TYPE, i, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, MONSTER_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } for ( i = 0; i < num_large_entries; i++ ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, i, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } @@ -11126,8 +11135,8 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) for ( i = 12; i < 14; i++ ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change2(cache_ptr, LARGE_ENTRY_TYPE, i, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); + unprotect_entry_with_size_change2(file_ptr, LARGE_ENTRY_TYPE, i, H5C2__DIRTIED_FLAG, (size_t)0); } @@ -11158,7 +11167,7 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -11296,9 +11305,10 @@ check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) */ static void -check_flush_cache__single_entry(H5C2_t * cache_ptr) +check_flush_cache__single_entry(H5F_t * file_ptr) { /* const char * fcn_name = "check_flush_cache__single_entry"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; if ( cache_ptr == NULL ) { @@ -11316,7 +11326,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 1, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11335,7 +11345,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 2, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11354,7 +11364,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 3, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11373,7 +11383,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 4, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11392,7 +11402,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 5, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11411,7 +11421,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 6, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11430,7 +11440,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 7, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11449,7 +11459,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 8, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11468,7 +11478,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 9, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11488,7 +11498,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 10, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11508,7 +11518,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 11, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11528,7 +11538,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 12, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11548,7 +11558,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 13, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11568,7 +11578,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 14, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11588,7 +11598,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 15, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11609,7 +11619,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 16, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11630,7 +11640,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 17, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11649,7 +11659,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 18, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11668,7 +11678,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 19, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11687,7 +11697,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 20, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11706,7 +11716,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 21, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11725,7 +11735,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 22, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11744,7 +11754,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 23, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11763,7 +11773,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 24, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11782,7 +11792,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 25, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11802,7 +11812,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 26, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11822,7 +11832,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 27, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11842,7 +11852,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 28, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11862,7 +11872,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 29, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11882,7 +11892,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 30, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11902,7 +11912,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 31, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11923,7 +11933,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 32, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11944,7 +11954,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 33, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11963,7 +11973,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 34, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -11982,7 +11992,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 35, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12001,7 +12011,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 36, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12020,7 +12030,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 37, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12039,7 +12049,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 38, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12058,7 +12068,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 39, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12077,7 +12087,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 40, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12096,7 +12106,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 41, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12116,7 +12126,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 42, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12136,7 +12146,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 43, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12156,7 +12166,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 44, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12176,7 +12186,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 45, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12196,7 +12206,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 46, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12216,7 +12226,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 47, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12237,7 +12247,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 48, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12258,7 +12268,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 49, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12277,7 +12287,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 50, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12296,7 +12306,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 51, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12315,7 +12325,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 52, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12334,7 +12344,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 53, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12353,7 +12363,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 54, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12372,7 +12382,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 55, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12391,7 +12401,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 56, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12410,7 +12420,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 57, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12430,7 +12440,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 58, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12450,7 +12460,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 59, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12470,7 +12480,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 60, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12490,7 +12500,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 61, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12510,7 +12520,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 62, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12530,7 +12540,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 63, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12551,7 +12561,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) check_flush_cache__single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ 64, /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, @@ -12916,7 +12926,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) { check_flush_cache__pinned_single_entry_test ( - /* cache_ptr */ cache_ptr, + /* file_ptr */ file_ptr, /* test_num */ spec[i].test_num, /* entry_type */ spec[i].entry_type, /* entry_idx */ spec[i].entry_idx, @@ -12956,7 +12966,7 @@ check_flush_cache__single_entry(H5C2_t * cache_ptr) */ static void -check_flush_cache__single_entry_test(H5C2_t * cache_ptr, +check_flush_cache__single_entry_test(H5F_t * file_ptr, int test_num, int entry_type, int entry_idx, @@ -12970,6 +12980,7 @@ check_flush_cache__single_entry_test(H5C2_t * cache_ptr, hbool_t expected_destroyed) { /* const char * fcn_name = "check_flush_cache__single_entry_test"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; static char msg[128]; herr_t result; test_entry_t * base_addr; @@ -13009,20 +13020,20 @@ check_flush_cache__single_entry_test(H5C2_t * cache_ptr, if ( insert_flag ) { - insert_entry2(cache_ptr, entry_type, entry_idx, dirty_flag, flags); + insert_entry2(file_ptr, entry_type, entry_idx, dirty_flag, flags); } else { - protect_entry2(cache_ptr, entry_type, entry_idx); + protect_entry2(file_ptr, entry_type, entry_idx); - unprotect_entry2(cache_ptr, entry_type, entry_idx, + unprotect_entry2(file_ptr, entry_type, entry_idx, (int)dirty_flag, flags); } } if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -13099,7 +13110,7 @@ check_flush_cache__single_entry_test(H5C2_t * cache_ptr, /* clean up the cache to prep for the next test */ if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -13157,7 +13168,7 @@ check_flush_cache__single_entry_test(H5C2_t * cache_ptr, */ static void -check_flush_cache__pinned_single_entry_test(H5C2_t * cache_ptr, +check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, int test_num, int entry_type, int entry_idx, @@ -13173,6 +13184,7 @@ check_flush_cache__pinned_single_entry_test(H5C2_t * cache_ptr, hbool_t expected_destroyed) { /* const char *fcn_name = "check_flush_cache__pinned_single_entry_test"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; static char msg[128]; hbool_t expected_deserialized = TRUE; herr_t result; @@ -13211,27 +13223,27 @@ check_flush_cache__pinned_single_entry_test(H5C2_t * cache_ptr, base_addr = entries2[entry_type]; entry_ptr = &(base_addr[entry_idx]); - protect_entry2(cache_ptr, entry_type, entry_idx); + protect_entry2(file_ptr, entry_type, entry_idx); if ( pop_mark_dirty_prot ) { - mark_pinned_or_protected_entry_dirty2(cache_ptr, + mark_pinned_or_protected_entry_dirty2(file_ptr, entry_type, entry_idx); } - unprotect_entry2(cache_ptr, entry_type, entry_idx, + unprotect_entry2(file_ptr, entry_type, entry_idx, (int)dirty_flag, (flags | H5C2__PIN_ENTRY_FLAG)); if ( mark_dirty ) { - mark_pinned_entry_dirty2(cache_ptr, entry_type, entry_idx, + mark_pinned_entry_dirty2(file_ptr, entry_type, entry_idx, FALSE, (size_t)0); } if ( pop_mark_dirty_pinned ) { - mark_pinned_or_protected_entry_dirty2(cache_ptr, + mark_pinned_or_protected_entry_dirty2(file_ptr, entry_type, entry_idx); } @@ -13239,7 +13251,7 @@ check_flush_cache__pinned_single_entry_test(H5C2_t * cache_ptr, if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -13317,21 +13329,21 @@ check_flush_cache__pinned_single_entry_test(H5C2_t * cache_ptr, if ( unprotect_unpin ) { - protect_entry2(cache_ptr, entry_type, entry_idx); + protect_entry2(file_ptr, entry_type, entry_idx); - unprotect_entry2(cache_ptr, entry_type, entry_idx, + unprotect_entry2(file_ptr, entry_type, entry_idx, (int)dirty_flag, H5C2__UNPIN_ENTRY_FLAG); } else { - unpin_entry2(cache_ptr, entry_type, entry_idx); + unpin_entry2(file_ptr, entry_type, entry_idx); } } if ( pass2 ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -13380,7 +13392,7 @@ check_flush_cache__pinned_single_entry_test(H5C2_t * cache_ptr, *------------------------------------------------------------------------- */ -static void +static unsigned check_get_entry_status(void) { const char * fcn_name = "check_get_entry_status"; @@ -13391,7 +13403,7 @@ check_get_entry_status(void) hbool_t is_protected; hbool_t is_pinned; size_t entry_size; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -13403,7 +13415,7 @@ check_get_entry_status(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); base_addr = entries2[0]; @@ -13416,7 +13428,7 @@ check_get_entry_status(void) * the call. Thus, only check that boolean. */ - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); if ( result < 0 ) { @@ -13434,13 +13446,13 @@ check_get_entry_status(void) } } - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); if ( result < 0 ) { @@ -13458,11 +13470,11 @@ check_get_entry_status(void) } } - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); if ( result < 0 ) { @@ -13480,11 +13492,11 @@ check_get_entry_status(void) } } - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); if ( result < 0 ) { @@ -13502,11 +13514,11 @@ check_get_entry_status(void) } } - mark_pinned_entry_dirty2(cache_ptr, 0, 0, FALSE, (size_t)0); + mark_pinned_entry_dirty2(file_ptr, 0, 0, FALSE, (size_t)0); if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); if ( result < 0 ) { @@ -13524,11 +13536,11 @@ check_get_entry_status(void) } } - unpin_entry2(cache_ptr, 0, 0); + unpin_entry2(file_ptr, 0, 0); if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); if ( result < 0 ) { @@ -13548,7 +13560,7 @@ check_get_entry_status(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -13559,7 +13571,7 @@ check_get_entry_status(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_get_entry_status() */ @@ -13582,7 +13594,7 @@ check_get_entry_status(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_expunge_entry(void) { const char * fcn_name = "check_expunge_entry"; @@ -13593,7 +13605,7 @@ check_expunge_entry(void) hbool_t is_protected; hbool_t is_pinned; size_t entry_size; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -13605,7 +13617,7 @@ check_expunge_entry(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); base_addr = entries2[0]; @@ -13618,7 +13630,7 @@ check_expunge_entry(void) * the status call. Thus, only check that boolean. */ - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -13651,13 +13663,13 @@ check_expunge_entry(void) * it without marking it dirty. */ - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); if ( result < 0 ) { @@ -13695,7 +13707,7 @@ check_expunge_entry(void) * callback is only called if the entry is dirty to begin with. * Thus, the entry will no longer be marked as cleared. */ - expunge_entry2(cache_ptr, 0, 0); + expunge_entry2(file_ptr, 0, 0); if ( pass2 ) { @@ -13703,7 +13715,7 @@ check_expunge_entry(void) * by the status call. Thus, only check that boolean. */ - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); if ( result < 0 ) { @@ -13744,7 +13756,7 @@ check_expunge_entry(void) * the status call. Thus, only check that boolean. */ - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -13777,13 +13789,13 @@ check_expunge_entry(void) * it with the dirty flag set. */ - protect_entry2(cache_ptr, 0, 1); + protect_entry2(file_ptr, 0, 1); - unprotect_entry2(cache_ptr, 0, 1, TRUE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 1, TRUE, H5C2__NO_FLAGS_SET); if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -13816,7 +13828,7 @@ check_expunge_entry(void) * Also verify that the entry was loaded, cleared and destroyed, but not * flushed. */ - expunge_entry2(cache_ptr, 0, 1); + expunge_entry2(file_ptr, 0, 1); if ( pass2 ) { @@ -13824,7 +13836,7 @@ check_expunge_entry(void) * by the status call. Thus, only check that boolean. */ - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -13870,7 +13882,7 @@ check_expunge_entry(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -13881,7 +13893,7 @@ check_expunge_entry(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_expunge_entry() */ @@ -13905,10 +13917,11 @@ check_expunge_entry(void) */ -static void +static unsigned check_multiple_read_protect(void) { const char * fcn_name = "check_multiple_read_protect()"; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; test_entry_t * entry_ptr; @@ -13941,8 +13954,9 @@ check_multiple_read_protect(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; entry_ptr = &((entries2[0])[0]); @@ -13967,7 +13981,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - protect_entry_ro2(cache_ptr, 0, 0); + protect_entry_ro2(file_ptr, 0, 0); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -13990,7 +14004,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - protect_entry_ro2(cache_ptr, 0, 0); + protect_entry_ro2(file_ptr, 0, 0); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -14013,7 +14027,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -14036,7 +14050,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - protect_entry_ro2(cache_ptr, 0, 0); + protect_entry_ro2(file_ptr, 0, 0); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -14059,7 +14073,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - protect_entry_ro2(cache_ptr, 0, 0); + protect_entry_ro2(file_ptr, 0, 0); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -14082,7 +14096,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -14105,7 +14119,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -14128,7 +14142,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); if ( ( entry_ptr->header.is_protected ) || ( entry_ptr->header.is_read_only ) || @@ -14156,7 +14170,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( entry_ptr->header.is_read_only ) || @@ -14179,7 +14193,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); if ( ( entry_ptr->header.is_protected ) || ( entry_ptr->header.is_read_only ) || @@ -14211,36 +14225,36 @@ check_multiple_read_protect(void) if ( pass2 ) { - protect_entry2(cache_ptr, 0, 2); /* (0,2) write */ - protect_entry_ro2(cache_ptr, 0, 4); /* (0,4) read only (1) */ - protect_entry2(cache_ptr, 0, 6); /* (0,6) write */ + protect_entry2(file_ptr, 0, 2); /* (0,2) write */ + protect_entry_ro2(file_ptr, 0, 4); /* (0,4) read only (1) */ + protect_entry2(file_ptr, 0, 6); /* (0,6) write */ - unprotect_entry2(cache_ptr, 0, 2, FALSE, /* (0,2) unprotect */ + unprotect_entry2(file_ptr, 0, 2, FALSE, /* (0,2) unprotect */ H5C2__NO_FLAGS_SET); - protect_entry_ro2(cache_ptr, 0, 2); /* (0,2) read only (1) */ - protect_entry2(cache_ptr, 0, 1); /* (0,1) write */ - protect_entry_ro2(cache_ptr, 0, 4); /* (0,4) read only (2) */ - protect_entry2(cache_ptr, 0, 0); /* (0,0) write */ - protect_entry_ro2(cache_ptr, 0, 2); /* (0,2) read only (2) */ + protect_entry_ro2(file_ptr, 0, 2); /* (0,2) read only (1) */ + protect_entry2(file_ptr, 0, 1); /* (0,1) write */ + protect_entry_ro2(file_ptr, 0, 4); /* (0,4) read only (2) */ + protect_entry2(file_ptr, 0, 0); /* (0,0) write */ + protect_entry_ro2(file_ptr, 0, 2); /* (0,2) read only (2) */ - unprotect_entry2(cache_ptr, 0, 2, FALSE, /* (0,2) read only (1) pin */ + unprotect_entry2(file_ptr, 0, 2, FALSE, /* (0,2) read only (1) pin */ H5C2__PIN_ENTRY_FLAG); - unprotect_entry2(cache_ptr, 0, 6, FALSE, /* (0,6) unprotect */ + unprotect_entry2(file_ptr, 0, 6, FALSE, /* (0,6) unprotect */ H5C2__NO_FLAGS_SET); - protect_entry_ro2(cache_ptr, 0, 4); /* (0,4) read only (3) */ + protect_entry_ro2(file_ptr, 0, 4); /* (0,4) read only (3) */ - unprotect_entry2(cache_ptr, 0, 2, FALSE, /* (0,2) unprotect */ + unprotect_entry2(file_ptr, 0, 2, FALSE, /* (0,2) unprotect */ H5C2__NO_FLAGS_SET); - unprotect_entry2(cache_ptr, 0, 1, FALSE, /* (0,1) unprotect */ + unprotect_entry2(file_ptr, 0, 1, FALSE, /* (0,1) unprotect */ H5C2__NO_FLAGS_SET); if ( pass2 ) { entry_ptr = &((entries2[0])[4]); - if ( H5C2_pin_protected_entry(cache_ptr, (void *)entry_ptr) < 0 ) { + if ( H5C2_pin_protected_entry(file_ptr, (void *)entry_ptr) < 0 ) { pass2 = FALSE; failure_mssg2 = "H5C2_pin_protected_entry() failed.\n"; @@ -14258,9 +14272,9 @@ check_multiple_read_protect(void) } } - unprotect_entry2(cache_ptr, 0, 4, FALSE, /* (0,4) read only (2) */ + unprotect_entry2(file_ptr, 0, 4, FALSE, /* (0,4) read only (2) */ H5C2__NO_FLAGS_SET); - unprotect_entry2(cache_ptr, 0, 4, FALSE, /* (0,4) read only (1) */ + unprotect_entry2(file_ptr, 0, 4, FALSE, /* (0,4) read only (1) */ H5C2__UNPIN_ENTRY_FLAG); if ( ( pass2 ) && ( entry_ptr->header.is_pinned ) ) { @@ -14270,12 +14284,12 @@ check_multiple_read_protect(void) } - unprotect_entry2(cache_ptr, 0, 4, FALSE, /* (0,4) unprotect */ + unprotect_entry2(file_ptr, 0, 4, FALSE, /* (0,4) unprotect */ H5C2__NO_FLAGS_SET); - unprotect_entry2(cache_ptr, 0, 0, FALSE, /* (0,0) unprotect */ + unprotect_entry2(file_ptr, 0, 0, FALSE, /* (0,0) unprotect */ H5C2__NO_FLAGS_SET); - unpin_entry2(cache_ptr, 0, 2); + unpin_entry2(file_ptr, 0, 2); } #if H5C2_COLLECT_CACHE_STATS @@ -14291,7 +14305,7 @@ check_multiple_read_protect(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -14302,7 +14316,7 @@ check_multiple_read_protect(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_multiple_read_protect() */ @@ -14324,12 +14338,12 @@ check_multiple_read_protect(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_rename_entry(void) { const char * fcn_name = "check_rename_entry"; int i; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; struct rename_entry_test_spec test_specs[4] = { { @@ -14391,20 +14405,20 @@ check_rename_entry(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); } i = 0; while ( ( pass2 ) && ( i < 4 ) ) { - check_rename_entry__run_test(cache_ptr, i, &(test_specs[i])); + check_rename_entry__run_test(file_ptr, i, &(test_specs[i])); i++; } if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -14415,7 +14429,7 @@ check_rename_entry(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_rename_entry() */ @@ -14440,11 +14454,12 @@ check_rename_entry(void) */ static void -check_rename_entry__run_test(H5C2_t * cache_ptr, +check_rename_entry__run_test(H5F_t * file_ptr, int test_num, struct rename_entry_test_spec * spec_ptr) { /* const char * fcn_name = "check_rename_entry__run_test"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; static char msg[128]; unsigned int flags = H5C2__NO_FLAGS_SET; test_entry_t * base_addr; @@ -14492,9 +14507,9 @@ check_rename_entry__run_test(H5C2_t * cache_ptr, } } - protect_entry2(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index); + protect_entry2(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index); - unprotect_entry2(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, + unprotect_entry2(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index, (int)(spec_ptr->is_dirty), flags); rename_entry2(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, FALSE); @@ -14537,7 +14552,7 @@ check_rename_entry__run_test(H5C2_t * cache_ptr, } } - unpin_entry2(cache_ptr, spec_ptr->entry_type, + unpin_entry2(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index); } else { @@ -14586,13 +14601,13 @@ check_rename_entry__run_test(H5C2_t * cache_ptr, *------------------------------------------------------------------------- */ -static void +static unsigned check_pin_protected_entry(void) { const char * fcn_name = "check_pin_protected_entry"; static char msg[128]; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -14609,18 +14624,18 @@ check_pin_protected_entry(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); } - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); if ( pass2 ) { base_addr = entries2[0]; entry_ptr = &(base_addr[0]); - result = H5C2_pin_protected_entry(cache_ptr, (void *)entry_ptr); + result = H5C2_pin_protected_entry(file_ptr, (void *)entry_ptr); if ( result < 0 ) { @@ -14641,11 +14656,11 @@ check_pin_protected_entry(void) } } - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__UNPIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__UNPIN_ENTRY_FLAG); if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -14656,7 +14671,7 @@ check_pin_protected_entry(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_pin_protected_entry() */ @@ -14679,7 +14694,7 @@ check_pin_protected_entry(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_resize_entry(void) { const char * fcn_name = "check_resize_entry"; @@ -14691,6 +14706,7 @@ check_resize_entry(void) hbool_t is_pinned; size_t entry_size; size_t reported_entry_size; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -14734,8 +14750,9 @@ check_resize_entry(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024 * 1024), (size_t)(1 * 1024 * 1024)); + cache_ptr = file_ptr->shared->cache2; base_addr = entries2[LARGE_ENTRY_TYPE]; entry_ptr = &(base_addr[0]); @@ -14756,7 +14773,7 @@ check_resize_entry(void) } } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0); if ( pass2 ) { @@ -14775,7 +14792,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -14806,7 +14823,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, H5C2__SIZE_CHANGED_FLAG | H5C2__DIRTIED_FLAG, @@ -14845,7 +14862,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -14875,11 +14892,11 @@ check_resize_entry(void) } } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0); if ( pass2 ) { - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, (H5C2__DIRTIED_FLAG | H5C2__SIZE_CHANGED_FLAG), @@ -14918,7 +14935,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -14948,13 +14965,13 @@ check_resize_entry(void) } } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C2__PIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C2__PIN_ENTRY_FLAG); if ( pass2 ) { - result = H5C2_resize_pinned_entry(cache_ptr, (void *)entry_ptr, + result = H5C2_resize_pinned_entry(file_ptr, (void *)entry_ptr, (LARGE_ENTRY_SIZE / 4)); if ( result < 0 ) { @@ -14983,7 +15000,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -15015,7 +15032,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_resize_pinned_entry(cache_ptr, (void *)entry_ptr, + result = H5C2_resize_pinned_entry(file_ptr, (void *)entry_ptr, LARGE_ENTRY_SIZE); if ( result < 0 ) { @@ -15044,7 +15061,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -15074,14 +15091,14 @@ check_resize_entry(void) } } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, FALSE, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C2__UNPIN_ENTRY_FLAG | H5C2__DELETED_FLAG); if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -15159,14 +15176,14 @@ check_resize_entry(void) entry_size = LARGE_ENTRY_SIZE; } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C2__NO_FLAGS_SET); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C2__NO_FLAGS_SET); - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 1, TRUE, H5C2__NO_FLAGS_SET); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 1); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 1, TRUE, H5C2__NO_FLAGS_SET); - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 2, FALSE, H5C2__NO_FLAGS_SET); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 2); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 2, FALSE, H5C2__NO_FLAGS_SET); if ( pass2 ) { @@ -15183,7 +15200,7 @@ check_resize_entry(void) } } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 3); if ( pass2 ) { @@ -15202,7 +15219,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -15233,7 +15250,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, H5C2__SIZE_CHANGED_FLAG | H5C2__DIRTIED_FLAG, @@ -15274,7 +15291,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -15304,11 +15321,11 @@ check_resize_entry(void) } } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 3); if ( pass2 ) { - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, (H5C2__DIRTIED_FLAG | H5C2__SIZE_CHANGED_FLAG), @@ -15347,7 +15364,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -15377,13 +15394,13 @@ check_resize_entry(void) } } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3, FALSE, H5C2__PIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 3, FALSE, H5C2__PIN_ENTRY_FLAG); if ( pass2 ) { - result = H5C2_resize_pinned_entry(cache_ptr, (void *)entry_ptr, + result = H5C2_resize_pinned_entry(file_ptr, (void *)entry_ptr, (LARGE_ENTRY_SIZE / 4)); if ( result < 0 ) { @@ -15414,7 +15431,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -15446,7 +15463,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_resize_pinned_entry(cache_ptr, (void *)entry_ptr, + result = H5C2_resize_pinned_entry(file_ptr, (void *)entry_ptr, LARGE_ENTRY_SIZE); if ( result < 0 ) { @@ -15475,7 +15492,7 @@ check_resize_entry(void) if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -15505,14 +15522,14 @@ check_resize_entry(void) } } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3, FALSE, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 3, FALSE, H5C2__UNPIN_ENTRY_FLAG | H5C2__DELETED_FLAG); if ( pass2 ) { - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned); @@ -15569,14 +15586,14 @@ check_resize_entry(void) } } - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 2, FALSE, H5C2__DELETED_FLAG); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 2); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 2, FALSE, H5C2__DELETED_FLAG); - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 1, FALSE, H5C2__DELETED_FLAG); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 1); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 1, FALSE, H5C2__DELETED_FLAG); - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C2__DELETED_FLAG); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C2__DELETED_FLAG); if ( pass2 ) { @@ -15595,7 +15612,7 @@ check_resize_entry(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -15606,7 +15623,7 @@ check_resize_entry(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_resize_entry() */ @@ -15630,7 +15647,7 @@ check_resize_entry(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_evictions_enabled(void) { const char * fcn_name = "check_evictions_enabled"; @@ -15642,6 +15659,7 @@ check_evictions_enabled(void) int i; int mile_stone = 1; size_t entry_size; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -15694,8 +15712,9 @@ check_evictions_enabled(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(1 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(1 * 1024 * 1024), (size_t)( 512 * 1024)); + cache_ptr = file_ptr->shared->cache2; base_addr = entries2[MONSTER_ENTRY_TYPE]; entry_size = MONSTER_ENTRY_SIZE; @@ -15745,8 +15764,8 @@ check_evictions_enabled(void) /* fill the cache */ for ( i = 0; i < 16 ; i++ ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, FALSE, H5C2__NO_FLAGS_SET); } @@ -15776,8 +15795,8 @@ check_evictions_enabled(void) fcn_name, mile_stone++, (int)pass2); /* protect and unprotect another entry */ - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 16); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 16, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 16); + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 16, FALSE, H5C2__NO_FLAGS_SET); if ( show_progress ) /* 7 */ @@ -15808,7 +15827,7 @@ check_evictions_enabled(void) entry_ptr = &(base_addr[0]); - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL); if ( result < 0 ) { @@ -15841,7 +15860,7 @@ check_evictions_enabled(void) fcn_name, mile_stone++, (int)pass2); /* insert an entry */ - insert_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 17, TRUE, H5C2__NO_FLAGS_SET); + insert_entry2(file_ptr, MONSTER_ENTRY_TYPE, 17, TRUE, H5C2__NO_FLAGS_SET); if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -15871,7 +15890,7 @@ check_evictions_enabled(void) entry_ptr = &(base_addr[1]); - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL); if ( result < 0 ) { @@ -15906,7 +15925,7 @@ check_evictions_enabled(void) /* disable evictions */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result != SUCCEED ) { @@ -15941,8 +15960,8 @@ check_evictions_enabled(void) fcn_name, mile_stone++, (int)pass2); /* protect and unprotect another entry */ - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 18); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 18, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 18); + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 18, FALSE, H5C2__NO_FLAGS_SET); if ( show_progress ) /* 15 */ @@ -15970,7 +15989,7 @@ check_evictions_enabled(void) fcn_name, mile_stone++, (int)pass2); /* insert another entry */ - insert_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 19, TRUE, H5C2__NO_FLAGS_SET); + insert_entry2(file_ptr, MONSTER_ENTRY_TYPE, 19, TRUE, H5C2__NO_FLAGS_SET); if ( show_progress ) /* 17 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -15999,7 +16018,7 @@ check_evictions_enabled(void) /* re-enable evictions */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, TRUE); + result = H5C2_set_evictions_enabled(file_ptr, TRUE); if ( result != SUCCEED ) { @@ -16014,8 +16033,8 @@ check_evictions_enabled(void) fcn_name, mile_stone++, (int)pass2); /* protect and unprotect an entry that is in the cache */ - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 19); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 19, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 19); + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 19, FALSE, H5C2__NO_FLAGS_SET); if ( show_progress ) /* 20 */ @@ -16043,8 +16062,8 @@ check_evictions_enabled(void) fcn_name, mile_stone++, (int)pass2); /* protect and unprotect an entry that isn't in the cache */ - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 20); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 20, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 20); + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 20, FALSE, H5C2__NO_FLAGS_SET); if ( show_progress ) /* 22 */ @@ -16078,7 +16097,7 @@ check_evictions_enabled(void) entry_ptr = &(base_addr[2]); - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL); if ( result < 0 ) { @@ -16114,7 +16133,7 @@ check_evictions_enabled(void) entry_ptr = &(base_addr[3]); - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL); if ( result < 0 ) { @@ -16149,7 +16168,7 @@ check_evictions_enabled(void) /* disable evictions again */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result != SUCCEED ) { @@ -16166,8 +16185,8 @@ check_evictions_enabled(void) /* protect and unprotect an entry that isn't in the cache, forcing * the cache to grow. */ - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 21); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 21, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 21); + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 21, FALSE, H5C2__NO_FLAGS_SET); @@ -16198,7 +16217,7 @@ check_evictions_enabled(void) /* re-enable evictions again */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, TRUE); + result = H5C2_set_evictions_enabled(file_ptr, TRUE); if ( result != SUCCEED ) { @@ -16213,7 +16232,7 @@ check_evictions_enabled(void) fcn_name, mile_stone++, (int)pass2); /* insert an entry */ - insert_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 22, TRUE, H5C2__NO_FLAGS_SET); + insert_entry2(file_ptr, MONSTER_ENTRY_TYPE, 22, TRUE, H5C2__NO_FLAGS_SET); if ( show_progress ) /* 30 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -16243,7 +16262,7 @@ check_evictions_enabled(void) entry_ptr = &(base_addr[4]); - result = H5C2_get_entry_status(cache_ptr, entry_ptr->addr, + result = H5C2_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL); if ( result < 0 ) { @@ -16278,7 +16297,7 @@ check_evictions_enabled(void) /* disable evictions one last time before we shut down */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, FALSE); + result = H5C2_set_evictions_enabled(file_ptr, FALSE); if ( result != SUCCEED ) { @@ -16294,7 +16313,7 @@ check_evictions_enabled(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( show_progress ) /* 34 */ @@ -16309,7 +16328,7 @@ check_evictions_enabled(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_evictions_enabled() */ @@ -16330,11 +16349,11 @@ check_evictions_enabled(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_flush_protected_err(void) { const char * fcn_name = "check_flush_protected_err"; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("flush cache with protected entry error"); @@ -16349,12 +16368,12 @@ check_flush_protected_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); - if ( H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + if ( H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__NO_FLAGS_SET) >= 0 ) { @@ -16363,9 +16382,9 @@ check_flush_protected_err(void) } else { - unprotect_entry2(cache_ptr, 0, 0, TRUE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, TRUE, H5C2__NO_FLAGS_SET); - if ( H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + if ( H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__NO_FLAGS_SET) < 0 ) { @@ -16374,7 +16393,7 @@ check_flush_protected_err(void) } else { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } } } @@ -16387,7 +16406,7 @@ check_flush_protected_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_flush_protected_err() */ @@ -16412,11 +16431,11 @@ check_flush_protected_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_destroy_pinned_err(void) { const char * fcn_name = "check_destroy_pinned_err()"; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("destroy cache with permanently pinned entry error"); @@ -16431,30 +16450,35 @@ check_destroy_pinned_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); + protect_entry2(file_ptr, 0, 0); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); - if ( H5C2_dest(cache_ptr, H5P_DATASET_XFER_DEFAULT) >= 0 ) { + if ( H5C2_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) >= 0 ) { pass2 = FALSE; failure_mssg2 = "destroy succeeded on cache with pinned entry.\n"; } else { - unpin_entry2(cache_ptr, 0, 0); + unpin_entry2(file_ptr, 0, 0); - if ( H5C2_dest(cache_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { +/* FIXME: Related to earlier hack with same tag, have John check for + * correctness... -QAK + */ +#ifdef OLD_WAY + if ( H5C2_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { pass2 = FALSE; failure_mssg2 = "destroy failed after unpin.\n"; } +#endif /* OLD_WAY */ } - /* call takedown_cache2() with a NULL cache_ptr parameter. + /* call takedown_cache2() with a NULL file_ptr parameter. * This causes the function to close and delete the file, * while skipping the call to H5C2_dest(). */ @@ -16470,7 +16494,7 @@ check_destroy_pinned_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_destroy_pinned_err() */ @@ -16491,11 +16515,11 @@ check_destroy_pinned_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_destroy_protected_err(void) { const char * fcn_name = "check_destroy_protected_err"; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; TESTING("destroy cache with protected entry error"); @@ -16510,12 +16534,12 @@ check_destroy_protected_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); - if ( H5C2_dest(cache_ptr, H5P_DATASET_XFER_DEFAULT) >= 0 ) { + if ( H5C2_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) >= 0 ) { pass2 = FALSE; failure_mssg2 = @@ -16523,17 +16547,22 @@ check_destroy_protected_err(void) } else { - unprotect_entry2(cache_ptr, 0, 0, TRUE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, TRUE, H5C2__NO_FLAGS_SET); - if ( H5C2_dest(cache_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { +/* FIXME: Related to earlier hack with same tag, have John check for + * correctness... -QAK + */ +#ifdef OLD_WAY + if ( H5C2_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { pass2 = FALSE; failure_mssg2 = "destroy failed after unprotect.\n"; } +#endif /* OLD_WAY */ } - /* call takedown_cache2() with a NULL cache_ptr parameter. + /* call takedown_cache2() with a NULL file_ptr parameter. * This causes the function to close and delete the file, * while skipping the call to H5C2_dest(). */ @@ -16548,7 +16577,7 @@ check_destroy_protected_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_destroy_protected_err() */ @@ -16569,12 +16598,12 @@ check_destroy_protected_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_duplicate_insert_err(void) { const char * fcn_name = "check_duplicate_insert_err"; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -16591,17 +16620,17 @@ check_duplicate_insert_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); if ( pass2 ) { base_addr = entries2[0]; entry_ptr = &(base_addr[0]); - result = H5C2_insert_entry(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr, entry_ptr->size, (void *)entry_ptr, H5C2__NO_FLAGS_SET); @@ -16613,9 +16642,9 @@ check_duplicate_insert_err(void) } else { - unprotect_entry2(cache_ptr, 0, 0, TRUE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, TRUE, H5C2__NO_FLAGS_SET); - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } } } @@ -16628,7 +16657,7 @@ check_duplicate_insert_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_duplicate_insert_err() */ @@ -16649,11 +16678,12 @@ check_duplicate_insert_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_rename_err(void) { const char * fcn_name = "check_rename_err()"; herr_t result; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; test_entry_t * entry_0_0_ptr; test_entry_t * entry_0_1_ptr; @@ -16672,12 +16702,13 @@ check_rename_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; - insert_entry2(cache_ptr, 0, 0, TRUE, H5C2__NO_FLAGS_SET); - insert_entry2(cache_ptr, 0, 1, TRUE, H5C2__NO_FLAGS_SET); - insert_entry2(cache_ptr, 1, 0, TRUE, H5C2__NO_FLAGS_SET); + insert_entry2(file_ptr, 0, 0, TRUE, H5C2__NO_FLAGS_SET); + insert_entry2(file_ptr, 0, 1, TRUE, H5C2__NO_FLAGS_SET); + insert_entry2(file_ptr, 1, 0, TRUE, H5C2__NO_FLAGS_SET); entry_0_0_ptr = &((entries2[0])[0]); entry_0_1_ptr = &((entries2[0])[1]); @@ -16710,7 +16741,7 @@ check_rename_err(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -16721,7 +16752,7 @@ check_rename_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_rename_err() */ @@ -16744,12 +16775,12 @@ check_rename_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_double_pin_err(void) { const char * fcn_name = "check_double_pin_err()"; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; TESTING("pin a pinned entry error"); @@ -16766,21 +16797,21 @@ check_double_pin_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); entry_ptr = &((entries2[0])[0]); } if ( pass2 ) { - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr, (void *)entry_ptr, H5C2__PIN_ENTRY_FLAG, (size_t)0); @@ -16793,13 +16824,13 @@ check_double_pin_err(void) } else { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__UNPIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__UNPIN_ENTRY_FLAG); } } if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -16810,7 +16841,7 @@ check_double_pin_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_double_pin_err() */ @@ -16833,12 +16864,12 @@ check_double_pin_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_double_unpin_err(void) { const char * fcn_name = "check_double_unpin_err()"; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; TESTING("unpin an unpinned entry error"); @@ -16857,17 +16888,17 @@ check_double_unpin_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); entry_ptr = &((entries2[0])[0]); } if ( pass2 ) { - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr, (void *)entry_ptr, H5C2__UNPIN_ENTRY_FLAG, (size_t)0); @@ -16880,13 +16911,13 @@ check_double_unpin_err(void) } else { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); } } if ( pass2 ) { - result = H5C2_unpin_entry(cache_ptr, (void *)entry_ptr); + result = H5C2_unpin_entry(file_ptr, (void *)entry_ptr); if ( result > 0 ) { @@ -16899,7 +16930,7 @@ check_double_unpin_err(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -16910,7 +16941,7 @@ check_double_unpin_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_double_unpin_err() */ @@ -16933,12 +16964,12 @@ check_double_unpin_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_pin_entry_errs(void) { const char * fcn_name = "check_pin_entry_errs()"; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; TESTING("pin entry related errors"); @@ -16961,19 +16992,19 @@ check_pin_entry_errs(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); entry_ptr = &((entries2[0])[0]); } if ( pass2 ) { - result = H5C2_pin_protected_entry(cache_ptr, (void *)entry_ptr); + result = H5C2_pin_protected_entry(file_ptr, (void *)entry_ptr); if ( result > 0 ) { @@ -16983,17 +17014,17 @@ check_pin_entry_errs(void) } else { - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); } } if ( pass2 ) { - result = H5C2_pin_protected_entry(cache_ptr, (void *)entry_ptr); + result = H5C2_pin_protected_entry(file_ptr, (void *)entry_ptr); if ( result > 0 ) { @@ -17003,14 +17034,14 @@ check_pin_entry_errs(void) } else { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__UNPIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__UNPIN_ENTRY_FLAG); } } if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -17021,7 +17052,7 @@ check_pin_entry_errs(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_pin_entry_errs() */ @@ -17047,11 +17078,11 @@ check_pin_entry_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_double_protect_err(void) { const char * fcn_name = "check_double_protect_err()"; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; H5C2_cache_entry_t * cache_entry_ptr; @@ -17068,17 +17099,17 @@ check_double_protect_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); entry_ptr = &((entries2[0])[0]); } if ( pass2 ) { - cache_entry_ptr = H5C2_protect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + cache_entry_ptr = H5C2_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr, entry_ptr->size, NULL, H5C2__NO_FLAGS_SET); @@ -17092,12 +17123,12 @@ check_double_protect_err(void) if ( pass2 ) { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); } if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -17108,7 +17139,7 @@ check_double_protect_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_double_protect_err() */ @@ -17137,12 +17168,12 @@ check_double_protect_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_double_unprotect_err(void) { const char * fcn_name = "check_double_unprotect_err()"; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; TESTING("unprotect an unprotected entry error"); @@ -17158,19 +17189,19 @@ check_double_unprotect_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); entry_ptr = &((entries2[0])[0]); } if ( pass2 ) { - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr, (void *)entry_ptr, H5C2__NO_FLAGS_SET, (size_t)0); @@ -17185,7 +17216,7 @@ check_double_unprotect_err(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -17196,7 +17227,7 @@ check_double_unprotect_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_double_unprotect_err() */ @@ -17228,12 +17259,12 @@ check_double_unprotect_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_mark_entry_dirty_errs(void) { const char * fcn_name = "check_mark_entry_dirty_errs()"; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; TESTING("mark entry dirty related errors"); @@ -17256,21 +17287,21 @@ check_mark_entry_dirty_errs(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); entry_ptr = &((entries2[0])[0]); } if ( pass2 ) { - result = H5C2_mark_pinned_entry_dirty(cache_ptr, (void *)entry_ptr, + result = H5C2_mark_pinned_entry_dirty(file_ptr, (void *)entry_ptr, FALSE, (size_t)0); if ( result > 0 ) { @@ -17281,13 +17312,13 @@ check_mark_entry_dirty_errs(void) } else { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__UNPIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__UNPIN_ENTRY_FLAG); } } if ( pass2 ) { - result = H5C2_mark_pinned_entry_dirty(cache_ptr, (void *)entry_ptr, + result = H5C2_mark_pinned_entry_dirty(file_ptr, (void *)entry_ptr, FALSE, (size_t)0); @@ -17301,7 +17332,7 @@ check_mark_entry_dirty_errs(void) if ( pass2 ) { - result = H5C2_mark_pinned_or_protected_entry_dirty(cache_ptr, + result = H5C2_mark_pinned_or_protected_entry_dirty(file_ptr, (void *)entry_ptr); @@ -17315,7 +17346,7 @@ check_mark_entry_dirty_errs(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -17326,7 +17357,7 @@ check_mark_entry_dirty_errs(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_mark_entry_dirty_errs() */ @@ -17349,12 +17380,12 @@ check_mark_entry_dirty_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_expunge_entry_errs(void) { const char * fcn_name = "check_expunge_entry_errs()"; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; TESTING("expunge entry related errors"); @@ -17377,18 +17408,18 @@ check_expunge_entry_errs(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); entry_ptr = &((entries2[0])[0]); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); } if ( pass2 ) { - result = H5C2_expunge_entry(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr); if ( result > 0 ) { @@ -17399,14 +17430,14 @@ check_expunge_entry_errs(void) } else { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); } } if ( pass2 ) { - result = H5C2_expunge_entry(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr); if ( result > 0 ) { @@ -17417,14 +17448,14 @@ check_expunge_entry_errs(void) } else { - unpin_entry2(cache_ptr, 0, 0); + unpin_entry2(file_ptr, 0, 0); } } if ( pass2 ) { - result = H5C2_expunge_entry(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr); if ( result < 0 ) { @@ -17439,7 +17470,7 @@ check_expunge_entry_errs(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -17450,7 +17481,7 @@ check_expunge_entry_errs(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_expunge_entry_errs() */ @@ -17473,12 +17504,12 @@ check_expunge_entry_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_resize_entry_errs(void) { const char * fcn_name = "check_resize_entry_errs()"; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; TESTING("resize entry related errors"); @@ -17500,18 +17531,18 @@ check_resize_entry_errs(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); entry_ptr = &((entries2[0])[0]); - protect_entry2(cache_ptr, 0, 0); + protect_entry2(file_ptr, 0, 0); } if ( pass2 ) { - result = H5C2_resize_pinned_entry(cache_ptr, (void *)entry_ptr, (size_t)1); + result = H5C2_resize_pinned_entry(file_ptr, (void *)entry_ptr, (size_t)1); if ( result > 0 ) { @@ -17521,14 +17552,14 @@ check_resize_entry_errs(void) } else { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__PIN_ENTRY_FLAG); } } if ( pass2 ) { - result = H5C2_resize_pinned_entry(cache_ptr, (void *)entry_ptr, + result = H5C2_resize_pinned_entry(file_ptr, (void *)entry_ptr, (size_t)0); if ( result > 0 ) { @@ -17539,14 +17570,14 @@ check_resize_entry_errs(void) } else { - unpin_entry2(cache_ptr, 0, 0); + unpin_entry2(file_ptr, 0, 0); } } if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -17557,7 +17588,7 @@ check_resize_entry_errs(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_resize_entry_errs() */ @@ -17580,12 +17611,12 @@ check_resize_entry_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_unprotect_ro_dirty_err(void) { const char * fcn_name = "check_unprotect_ro_dirty_err()"; herr_t result; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; TESTING("unprotect a read only entry dirty error"); @@ -17601,17 +17632,17 @@ check_unprotect_ro_dirty_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry_ro2(cache_ptr, 0, 0); + protect_entry_ro2(file_ptr, 0, 0); entry_ptr = &((entries2[0])[0]); } if ( pass2 ) { - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr, (void *)entry_ptr, H5C2__DIRTIED_FLAG, (size_t)0); @@ -17626,13 +17657,13 @@ check_unprotect_ro_dirty_err(void) if ( pass2 ) { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); } if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } /* allocate a another cache, protect an entry read only twice, and @@ -17645,18 +17676,18 @@ check_unprotect_ro_dirty_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry_ro2(cache_ptr, 0, 0); - protect_entry_ro2(cache_ptr, 0, 0); + protect_entry_ro2(file_ptr, 0, 0); + protect_entry_ro2(file_ptr, 0, 0); entry_ptr = &((entries2[0])[0]); } if ( pass2 ) { - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr, (void *)entry_ptr, H5C2__DIRTIED_FLAG, (size_t)0); @@ -17671,14 +17702,14 @@ check_unprotect_ro_dirty_err(void) if ( pass2 ) { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); } if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -17689,7 +17720,7 @@ check_unprotect_ro_dirty_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_unprotect_ro_dirty_err() */ @@ -17712,11 +17743,11 @@ check_unprotect_ro_dirty_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_protect_ro_rw_err(void) { const char * fcn_name = "check_protect_ro_rw_err()"; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; test_entry_t * entry_ptr; void * thing_ptr = NULL; @@ -17734,17 +17765,17 @@ check_protect_ro_rw_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); - protect_entry_ro2(cache_ptr, 0, 0); + protect_entry_ro2(file_ptr, 0, 0); entry_ptr = &((entries2[0])[0]); } if ( pass2 ) { - thing_ptr = H5C2_protect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + thing_ptr = H5C2_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[0]), entry_ptr->addr, entry_ptr->size, NULL, H5C2__NO_FLAGS_SET); @@ -17757,12 +17788,12 @@ check_protect_ro_rw_err(void) if ( pass2 ) { - unprotect_entry2(cache_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); + unprotect_entry2(file_ptr, 0, 0, FALSE, H5C2__NO_FLAGS_SET); } if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -17773,7 +17804,7 @@ check_protect_ro_rw_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_protect_ro_rw_err() */ @@ -17796,12 +17827,13 @@ check_protect_ro_rw_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_check_evictions_enabled_err(void) { const char * fcn_name = "check_evictions_enabled_err()"; herr_t result; hbool_t evictions_enabled; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; TESTING("get/set evictions enabled errors"); @@ -17825,8 +17857,9 @@ check_check_evictions_enabled_err(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; } if ( pass2 ) { @@ -17853,7 +17886,7 @@ check_check_evictions_enabled_err(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(cache_ptr, TRUE); + result = H5C2_set_evictions_enabled(file_ptr, TRUE); if ( result != SUCCEED ) { @@ -17872,7 +17905,7 @@ check_check_evictions_enabled_err(void) if ( result == SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_set_evictions_enabled succeeded() 1.\n"; + failure_mssg2 = "H5C2_get_evictions_enabled succeeded() 1.\n"; } else if ( cache_ptr->evictions_enabled == TRUE ) { @@ -17890,7 +17923,7 @@ check_check_evictions_enabled_err(void) if ( result == SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_set_evictions_enabled succeeded() 2.\n"; + failure_mssg2 = "H5C2_get_evictions_enabled succeeded() 2.\n"; } (cache_ptr->resize_ctl).decr_mode = H5C2_decr__off; @@ -17899,7 +17932,7 @@ check_check_evictions_enabled_err(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -17910,7 +17943,7 @@ check_check_evictions_enabled_err(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_evictions_enabled_err() */ @@ -17953,7 +17986,7 @@ static void test_rpt_fcn(UNUSED H5C2_t * cache_ptr, rpt_status = status; } -static void +static unsigned check_auto_cache_resize(void) { const char * fcn_name = "check_auto_cache_resize()"; @@ -17961,6 +17994,7 @@ check_auto_cache_resize(void) herr_t result; int32_t i; int32_t checkpoint = 0; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { @@ -18023,13 +18057,14 @@ check_auto_cache_resize(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; } if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -18059,10 +18094,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, PICO_ENTRY_TYPE, i); + protect_entry2(file_ptr, PICO_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, PICO_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, PICO_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18089,10 +18124,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18119,10 +18154,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, PICO_ENTRY_TYPE, i); + protect_entry2(file_ptr, PICO_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, PICO_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, PICO_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18149,10 +18184,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18179,10 +18214,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18209,10 +18244,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18240,10 +18275,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18270,10 +18305,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18300,10 +18335,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18331,10 +18366,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18400,7 +18435,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -18430,10 +18465,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18461,10 +18496,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18492,10 +18527,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18523,10 +18558,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18553,10 +18588,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18583,10 +18618,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18613,10 +18648,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 900 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18624,10 +18659,10 @@ check_auto_cache_resize(void) while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i + 1000); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i + 1000); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i + 1000, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i + 1000, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18654,10 +18689,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18684,10 +18719,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18753,7 +18788,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -18783,10 +18818,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18813,10 +18848,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18843,10 +18878,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18873,10 +18908,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -18945,7 +18980,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -18980,10 +19015,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19007,10 +19042,10 @@ check_auto_cache_resize(void) i = 1000; while ( ( pass2 ) && ( i < 2000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19034,10 +19069,10 @@ check_auto_cache_resize(void) i = 2000; while ( ( pass2 ) && ( i < 3000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19065,10 +19100,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19095,10 +19130,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19124,10 +19159,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19153,10 +19188,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19183,10 +19218,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19214,10 +19249,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19241,10 +19276,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19268,10 +19303,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19298,10 +19333,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19372,7 +19407,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -19407,10 +19442,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19434,10 +19469,10 @@ check_auto_cache_resize(void) i = 1000; while ( ( pass2 ) && ( i < 2000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19461,10 +19496,10 @@ check_auto_cache_resize(void) i = 2000; while ( ( pass2 ) && ( i < 3000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19492,10 +19527,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19522,10 +19557,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19551,10 +19586,10 @@ check_auto_cache_resize(void) i = 2000; while ( ( pass2 ) && ( i < 3000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19580,10 +19615,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19609,10 +19644,10 @@ check_auto_cache_resize(void) i = 2000; while ( ( pass2 ) && ( i < 3000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19638,10 +19673,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19667,10 +19702,10 @@ check_auto_cache_resize(void) i = 2000; while ( ( pass2 ) && ( i < 3000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19696,10 +19731,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19726,10 +19761,10 @@ check_auto_cache_resize(void) i = 2000; while ( ( pass2 ) && ( i < 3000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19757,10 +19792,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19784,10 +19819,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19813,10 +19848,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19843,10 +19878,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19916,7 +19951,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -19951,10 +19986,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -19978,10 +20013,10 @@ check_auto_cache_resize(void) i = 1000; while ( ( pass2 ) && ( i < 2000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20005,10 +20040,10 @@ check_auto_cache_resize(void) i = 2000; while ( ( pass2 ) && ( i < 3000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20036,10 +20071,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20066,10 +20101,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20095,10 +20130,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20124,10 +20159,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20154,10 +20189,10 @@ check_auto_cache_resize(void) i = 3000; while ( ( pass2 ) && ( i < 4000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20185,10 +20220,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20212,10 +20247,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20239,10 +20274,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20269,10 +20304,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20344,7 +20379,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -20376,10 +20411,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20403,10 +20438,10 @@ check_auto_cache_resize(void) i = 1000; while ( ( pass2 ) && ( i < 2000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20430,10 +20465,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20458,10 +20493,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20486,10 +20521,10 @@ check_auto_cache_resize(void) i = 1000; while ( ( pass2 ) && ( i < 2000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20514,10 +20549,10 @@ check_auto_cache_resize(void) i = 1002; while ( ( pass2 ) && ( i < 2002 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20543,10 +20578,10 @@ check_auto_cache_resize(void) i = 1003; while ( ( pass2 ) && ( i < 2003 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20614,7 +20649,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -20645,10 +20680,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20672,10 +20707,10 @@ check_auto_cache_resize(void) i = 1000; while ( ( pass2 ) && ( i < 2000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20707,10 +20742,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20738,10 +20773,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20769,10 +20804,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20801,10 +20836,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20831,10 +20866,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i); + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20862,10 +20897,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20894,10 +20929,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20926,10 +20961,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20958,10 +20993,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -20988,10 +21023,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -21018,10 +21053,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -21048,10 +21083,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -21078,10 +21113,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -21108,10 +21143,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -21151,7 +21186,7 @@ check_auto_cache_resize(void) if ( pass2 ) { - flush_cache2(cache_ptr, TRUE, FALSE, FALSE); + flush_cache2(file_ptr, TRUE, FALSE, FALSE); reset_entries2(); } @@ -21202,7 +21237,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -21229,10 +21264,10 @@ check_auto_cache_resize(void) /* Load a huge entry into the cache */ if ( pass2 ) { - protect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 0); + protect_entry2(file_ptr, HUGE_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, HUGE_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } @@ -21257,10 +21292,10 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } @@ -21286,9 +21321,9 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 1); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 1); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 1, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 1, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -21311,9 +21346,9 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 2); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 2); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 2, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 2, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -21335,12 +21370,12 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - expunge_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 1); - expunge_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 2); + expunge_entry2(file_ptr, MONSTER_ENTRY_TYPE, 1); + expunge_entry2(file_ptr, MONSTER_ENTRY_TYPE, 2); if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -21372,14 +21407,14 @@ check_auto_cache_resize(void) /* insert a huge entry into the cache */ if ( pass2 ) { - insert_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1, TRUE, + insert_entry2(file_ptr, HUGE_ENTRY_TYPE, 1, TRUE, H5C2__NO_FLAGS_SET); /* protect and unprotect a couple times to increment cache_accesses */ - protect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1); - unprotect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1, + protect_entry2(file_ptr, HUGE_ENTRY_TYPE, 1); + unprotect_entry2(file_ptr, HUGE_ENTRY_TYPE, 1, NO_CHANGE, H5C2__NO_FLAGS_SET); - protect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1); - unprotect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1, + protect_entry2(file_ptr, HUGE_ENTRY_TYPE, 1); + unprotect_entry2(file_ptr, HUGE_ENTRY_TYPE, 1, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -21403,7 +21438,7 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - insert_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 4, TRUE, + insert_entry2(file_ptr, MONSTER_ENTRY_TYPE, 4, TRUE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -21425,7 +21460,7 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - insert_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 5, TRUE, + insert_entry2(file_ptr, MONSTER_ENTRY_TYPE, 5, TRUE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -21448,9 +21483,9 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 6); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 6); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 6, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 6, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -21474,32 +21509,32 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - expunge_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 5); - expunge_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 6); + expunge_entry2(file_ptr, MONSTER_ENTRY_TYPE, 5); + expunge_entry2(file_ptr, MONSTER_ENTRY_TYPE, 6); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1024); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1024); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1024); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 13); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 13, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 13); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 13, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1024); - flush_cache2(cache_ptr, TRUE, FALSE, FALSE); + flush_cache2(file_ptr, TRUE, FALSE, FALSE); if ( pass2 ) { auto_size_ctl.initial_size = 6 * 1024; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -21527,20 +21562,20 @@ check_auto_cache_resize(void) /* Now load the variable entries into the cache */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, H5C2__NO_FLAGS_SET); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, H5C2__NO_FLAGS_SET); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, H5C2__NO_FLAGS_SET); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 13); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 13, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 13); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 13, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -21562,8 +21597,8 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 3 * 1024); @@ -21587,8 +21622,8 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 10 * 1024); @@ -21611,8 +21646,8 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 10 * 1024); @@ -21635,8 +21670,8 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 10 * 1024); @@ -21660,20 +21695,20 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); if ( pass2 ) { auto_size_ctl.initial_size = 6 * 1024; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -21702,10 +21737,10 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, H5C2__PIN_ENTRY_FLAG); - resize_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE); + resize_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE); if ( ( pass2 ) && ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || @@ -21723,7 +21758,7 @@ check_auto_cache_resize(void) if ( pass2 ) { - resize_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE); + resize_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE); if ( ( pass2 ) && ( ( ( cache_ptr->max_cache_size != (13 * 1024) ) || @@ -21741,10 +21776,10 @@ check_auto_cache_resize(void) if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, H5C2__PIN_ENTRY_FLAG); - resize_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE); + resize_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE); if ( ( pass2 ) && ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || @@ -21762,10 +21797,10 @@ check_auto_cache_resize(void) if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, H5C2__PIN_ENTRY_FLAG); - resize_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE); + resize_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE); if ( ( pass2 ) && ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || @@ -21786,16 +21821,16 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, H5C2__UNPIN_ENTRY_FLAG); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, H5C2__UNPIN_ENTRY_FLAG); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, H5C2__UNPIN_ENTRY_FLAG); if ( ( pass2 ) && @@ -21818,20 +21853,20 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry_with_size_change2(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); if ( pass2 ) { auto_size_ctl.initial_size = 6 * 1024; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -21856,10 +21891,10 @@ check_auto_cache_resize(void) if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, H5C2__PIN_ENTRY_FLAG); - resize_pinned_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024); + resize_pinned_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024); if ( ( pass2 ) && ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || @@ -21877,7 +21912,7 @@ check_auto_cache_resize(void) if ( pass2 ) { - resize_pinned_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024); + resize_pinned_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024); if ( ( pass2 ) && ( ( ( cache_ptr->max_cache_size != (13 * 1024) ) || @@ -21895,10 +21930,10 @@ check_auto_cache_resize(void) if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, H5C2__PIN_ENTRY_FLAG); - resize_pinned_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024); + resize_pinned_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024); if ( ( pass2 ) && ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || @@ -21916,10 +21951,10 @@ check_auto_cache_resize(void) if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, H5C2__PIN_ENTRY_FLAG); - resize_pinned_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024); + resize_pinned_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024); if ( ( pass2 ) && ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || @@ -21940,16 +21975,16 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, H5C2__UNPIN_ENTRY_FLAG); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, H5C2__UNPIN_ENTRY_FLAG); - protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + protect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, H5C2__UNPIN_ENTRY_FLAG); if ( ( pass2 ) && @@ -21969,10 +22004,10 @@ check_auto_cache_resize(void) */ if ( pass2 ) { - expunge_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); - expunge_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); - expunge_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); - expunge_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 13); + expunge_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 10); + expunge_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 11); + expunge_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 12); + expunge_entry2(file_ptr, VARIABLE_ENTRY_TYPE, 13); if ( ( pass2 ) && ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || @@ -22036,7 +22071,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22069,8 +22104,8 @@ check_auto_cache_resize(void) rpt_fcn_called = FALSE; - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -22096,8 +22131,8 @@ check_auto_cache_resize(void) rpt_fcn_called = FALSE; - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 1, NO_CHANGE, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 1); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 1, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -22122,11 +22157,11 @@ check_auto_cache_resize(void) rpt_fcn_called = FALSE; - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 2, NO_CHANGE, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 2); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 2, NO_CHANGE, H5C2__NO_FLAGS_SET); - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3, NO_CHANGE, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 3); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 3, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -22153,10 +22188,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, TINY_ENTRY_TYPE, 0); + protect_entry2(file_ptr, TINY_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, TINY_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, TINY_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22179,8 +22214,8 @@ check_auto_cache_resize(void) rpt_fcn_called = FALSE; - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -22207,10 +22242,10 @@ check_auto_cache_resize(void) i = 0; while ( ( pass2 ) && ( i < 500 ) ) { - protect_entry2(cache_ptr, TINY_ENTRY_TYPE, i); + protect_entry2(file_ptr, TINY_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, TINY_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, TINY_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22231,7 +22266,7 @@ check_auto_cache_resize(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -22244,7 +22279,7 @@ check_auto_cache_resize(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_auto_cache_resize() */ @@ -22269,7 +22304,7 @@ check_auto_cache_resize(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_auto_cache_resize_disable(void) { const char * fcn_name = "check_auto_cache_resize_disable()"; @@ -22277,6 +22312,7 @@ check_auto_cache_resize_disable(void) herr_t result; int32_t i; int32_t checkpoint = 0; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { @@ -22339,13 +22375,14 @@ check_auto_cache_resize_disable(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; } if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22418,7 +22455,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22448,10 +22485,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22479,10 +22516,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22509,10 +22546,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22578,7 +22615,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22608,10 +22645,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22639,10 +22676,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22669,10 +22706,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22739,7 +22776,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22769,10 +22806,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22800,10 +22837,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22830,10 +22867,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22899,7 +22936,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22931,10 +22968,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22960,10 +22997,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -22990,10 +23027,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23059,7 +23096,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23089,10 +23126,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23119,10 +23156,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23149,10 +23186,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23218,7 +23255,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23248,10 +23285,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23278,10 +23315,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23308,10 +23345,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23379,7 +23416,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23401,7 +23438,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* flush the cache and destroy all entries so we start from a known point */ - flush_cache2(cache_ptr, TRUE, FALSE, FALSE); + flush_cache2(file_ptr, TRUE, FALSE, FALSE); if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -23414,10 +23451,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23444,10 +23481,10 @@ check_auto_cache_resize_disable(void) i = 1000; while ( ( pass2 ) && ( i < 2000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23476,10 +23513,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23506,10 +23543,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23538,10 +23575,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23607,7 +23644,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 1.0; /* disable decrement */ - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23629,7 +23666,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* flush the cache and destroy all entries so we start from a known point */ - flush_cache2(cache_ptr, TRUE, FALSE, FALSE); + flush_cache2(file_ptr, TRUE, FALSE, FALSE); if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -23642,10 +23679,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23672,10 +23709,10 @@ check_auto_cache_resize_disable(void) i = 1000; while ( ( pass2 ) && ( i < 2000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23704,10 +23741,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23734,10 +23771,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23766,10 +23803,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23842,7 +23879,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23864,7 +23901,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* flush the cache and destroy all entries so we start from a known point */ - flush_cache2(cache_ptr, TRUE, FALSE, FALSE); + flush_cache2(file_ptr, TRUE, FALSE, FALSE); if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -23877,10 +23914,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23907,10 +23944,10 @@ check_auto_cache_resize_disable(void) i = 1000; while ( ( pass2 ) && ( i < 2000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23941,10 +23978,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -23973,10 +24010,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24007,10 +24044,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 999); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 999); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 999, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 999, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24081,7 +24118,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24111,10 +24148,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24143,10 +24180,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24210,7 +24247,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24240,10 +24277,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24272,10 +24309,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24339,7 +24376,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24369,10 +24406,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24401,10 +24438,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24468,7 +24505,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24498,10 +24535,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24530,10 +24567,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24598,7 +24635,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24628,10 +24665,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24660,10 +24697,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24728,7 +24765,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24758,10 +24795,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24790,10 +24827,10 @@ check_auto_cache_resize_disable(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -24886,7 +24923,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24913,8 +24950,8 @@ check_auto_cache_resize_disable(void) rpt_fcn_called = FALSE; - protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, + protect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry2(file_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -24953,8 +24990,8 @@ check_auto_cache_resize_disable(void) rpt_fcn_called = FALSE; - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); if ( ( pass2 ) && @@ -24984,7 +25021,7 @@ check_auto_cache_resize_disable(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -24997,7 +25034,7 @@ check_auto_cache_resize_disable(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_auto_cache_resize_disable() */ @@ -25018,7 +25055,7 @@ check_auto_cache_resize_disable(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_auto_cache_resize_epoch_markers(void) { const char * fcn_name = "check_auto_cache_resize_epoch_markers()"; @@ -25027,6 +25064,7 @@ check_auto_cache_resize_epoch_markers(void) int32_t i; int32_t j; int32_t checkpoint = 0; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { @@ -25084,13 +25122,14 @@ check_auto_cache_resize_epoch_markers(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; } if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25159,7 +25198,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25199,10 +25238,10 @@ check_auto_cache_resize_epoch_markers(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i); + protect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -25232,10 +25271,10 @@ check_auto_cache_resize_epoch_markers(void) i = (j - 2) * 1000; while ( ( pass2 ) && ( i < (j - 1) * 1000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -25264,10 +25303,10 @@ check_auto_cache_resize_epoch_markers(void) i = 9000; while ( ( pass2 ) && ( i < 10000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -25336,7 +25375,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25378,10 +25417,10 @@ check_auto_cache_resize_epoch_markers(void) i = 9000; while ( ( pass2 ) && ( i < 10000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -25458,7 +25497,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25537,7 +25576,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25570,10 +25609,10 @@ check_auto_cache_resize_epoch_markers(void) i = (j - 1) * 1000; while ( ( pass2 ) && ( i < j * 1000 ) ) { - protect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i); + protect_entry2(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -25651,7 +25690,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25692,7 +25731,7 @@ check_auto_cache_resize_epoch_markers(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); @@ -25705,7 +25744,7 @@ check_auto_cache_resize_epoch_markers(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_auto_cache_resize_epoch_markers() */ @@ -25738,32 +25777,33 @@ check_auto_cache_resize_epoch_markers(void) ( (a).set_initial_size == (b).set_initial_size ) ) && \ ( ( ! compare_init ) || \ ( (a).initial_size == (b).initial_size ) ) && \ - ( (a).min_clean_fraction == (b).min_clean_fraction ) && \ + ( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \ ( (a).max_size == (b).max_size ) && \ ( (a).min_size == (b).min_size ) && \ ( (a).epoch_length == (b).epoch_length ) && \ ( (a).incr_mode == (b).incr_mode ) && \ - ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \ - ( (a).increment == (b).increment ) && \ + ( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \ ( (a).apply_max_increment == (b).apply_max_increment ) && \ ( (a).max_increment == (b).max_increment ) && \ ( (a).flash_incr_mode == (b).flash_incr_mode ) && \ - ( (a).flash_multiple == (b).flash_multiple ) && \ - ( (a).flash_threshold == (b).flash_threshold ) && \ + ( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \ ( (a).decr_mode == (b).decr_mode ) && \ - ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ - ( (a).decrement == (b).decrement ) && \ + ( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \ ( (a).apply_max_decrement == (b).apply_max_decrement ) && \ ( (a).max_decrement == (b).max_decrement ) && \ ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \ ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \ - ( (a).empty_reserve == (b).empty_reserve ) ) + ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) ) -static void +static unsigned check_auto_cache_resize_input_errs(void) { const char * fcn_name = "check_auto_cache_resize_input_errs()"; herr_t result; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; H5C2_auto_size_ctl_t ref_auto_size_ctl = { @@ -25828,13 +25868,14 @@ check_auto_cache_resize_input_errs(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; } if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &ref_auto_size_ctl); if ( result != SUCCEED ) { @@ -25916,14 +25957,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(NULL, + /* Reset file's cache pointer */ + file_ptr->shared->cache2 = NULL; + + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); + /* Return file's cache pointer */ + file_ptr->shared->cache2 = cache_ptr; + if ( result != FAIL ) { pass2 = FALSE; failure_mssg2 = - "H5C2_set_cache_auto_resize_config accepted NULL cache_ptr.\n"; + "H5C2_set_cache_auto_resize_config accepted NULL file_ptr.\n"; } } @@ -25992,7 +26039,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26069,7 +26116,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26143,7 +26190,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26219,7 +26266,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26292,7 +26339,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26369,7 +26416,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26442,7 +26489,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26515,7 +26562,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26591,7 +26638,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26664,7 +26711,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26741,7 +26788,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26815,7 +26862,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26891,7 +26938,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26964,7 +27011,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27037,7 +27084,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27114,7 +27161,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27190,7 +27237,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27266,7 +27313,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27340,7 +27387,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27416,7 +27463,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27490,7 +27537,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27567,7 +27614,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27641,7 +27688,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27717,7 +27764,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27790,7 +27837,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27866,7 +27913,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27939,7 +27986,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28014,7 +28061,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = -0.0000001; /* INVALID */ - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28087,7 +28134,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28159,7 +28206,7 @@ check_auto_cache_resize_input_errs(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -28170,7 +28217,7 @@ check_auto_cache_resize_input_errs(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_auto_cache_resize_input_errs() */ @@ -28196,12 +28243,13 @@ check_auto_cache_resize_input_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_auto_cache_resize_aux_fcns(void) { const char * fcn_name = "check_auto_cache_resize_aux_fcns()"; herr_t result; int32_t i; + H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; double hit_rate; size_t max_size; @@ -28269,13 +28317,14 @@ check_auto_cache_resize_aux_fcns(void) reset_entries2(); - cache_ptr = setup_cache2((size_t)(2 * 1024), + file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; } if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(cache_ptr, + result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -28332,11 +28381,11 @@ check_auto_cache_resize_aux_fcns(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, PICO_ENTRY_TYPE, i); + protect_entry2(file_ptr, PICO_ENTRY_TYPE, i); if ( pass2 ) { - unprotect_entry2(cache_ptr, PICO_ENTRY_TYPE, i, + unprotect_entry2(file_ptr, PICO_ENTRY_TYPE, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -28378,11 +28427,11 @@ check_auto_cache_resize_aux_fcns(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, PICO_ENTRY_TYPE, 0); + protect_entry2(file_ptr, PICO_ENTRY_TYPE, 0); if ( pass2 ) { - unprotect_entry2(cache_ptr, PICO_ENTRY_TYPE, 0, + unprotect_entry2(file_ptr, PICO_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -28398,7 +28447,7 @@ check_auto_cache_resize_aux_fcns(void) pass2 = FALSE; failure_mssg2 = "H5C2_get_cache_hit_rate failed.\n"; - } else if ( hit_rate != 0.5 ) { + } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, 0.00001) ) { pass2 = FALSE; failure_mssg2 = @@ -28461,11 +28510,11 @@ check_auto_cache_resize_aux_fcns(void) i = 0; while ( ( pass2 ) && ( i < 1000 ) ) { - protect_entry2(cache_ptr, PICO_ENTRY_TYPE, i + 500); + protect_entry2(file_ptr, PICO_ENTRY_TYPE, i + 500); if ( pass2 ) { - unprotect_entry2(cache_ptr, PICO_ENTRY_TYPE, i + 500, + unprotect_entry2(file_ptr, PICO_ENTRY_TYPE, i + 500, NO_CHANGE, H5C2__NO_FLAGS_SET); } i++; @@ -28482,7 +28531,7 @@ check_auto_cache_resize_aux_fcns(void) pass2 = FALSE; failure_mssg2 = "H5C2_get_cache_hit_rate failed.\n"; - } else if ( hit_rate != 0.5 ) { + } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, 0.00001) ) { pass2 = FALSE; failure_mssg2 = @@ -28566,11 +28615,11 @@ check_auto_cache_resize_aux_fcns(void) */ if ( pass2 ) { - protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + protect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0); } if ( pass2 ) { - unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, + unprotect_entry2(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C2__NO_FLAGS_SET); } @@ -28741,7 +28790,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass2 ) { - takedown_cache2(cache_ptr, FALSE, FALSE); + takedown_cache2(file_ptr, FALSE, FALSE); } if ( pass2 ) { PASSED(); } else { H5_FAILED(); } @@ -28752,7 +28801,7 @@ check_auto_cache_resize_aux_fcns(void) fcn_name, failure_mssg2); } - return; + return !pass2; } /* check_auto_cache_resize_aux_fcns() */ @@ -28777,6 +28826,8 @@ check_auto_cache_resize_aux_fcns(void) int main(void) { + unsigned nerrs = 0; + H5open(); express_test2 = GetTestExpress(); @@ -28797,51 +28848,51 @@ main(void) printf("===================================\n"); #if 1 - smoke_check_1(); - smoke_check_2(); - smoke_check_3(); - smoke_check_4(); - smoke_check_5(); - smoke_check_6(); - smoke_check_7(); - smoke_check_8(); - smoke_check_9(); - smoke_check_10(); + nerrs += smoke_check_1(); + nerrs += smoke_check_2(); + nerrs += smoke_check_3(); + nerrs += smoke_check_4(); + nerrs += smoke_check_5(); + nerrs += smoke_check_6(); + nerrs += smoke_check_7(); + nerrs += smoke_check_8(); + nerrs += smoke_check_9(); + nerrs += smoke_check_10(); #endif #if 1 - write_permitted_check(); + nerrs += write_permitted_check(); #endif - check_insert_entry(); - check_flush_cache(); - check_get_entry_status(); - check_expunge_entry(); - check_multiple_read_protect(); - check_rename_entry(); - check_pin_protected_entry(); - check_resize_entry(); - check_evictions_enabled(); - check_flush_protected_err(); - check_destroy_pinned_err(); - check_destroy_protected_err(); - check_duplicate_insert_err(); - check_rename_err(); - check_double_pin_err(); - check_double_unpin_err(); - check_pin_entry_errs(); - check_double_protect_err(); - check_double_unprotect_err(); - check_mark_entry_dirty_errs(); - check_expunge_entry_errs(); - check_resize_entry_errs(); - check_unprotect_ro_dirty_err(); - check_protect_ro_rw_err(); - check_check_evictions_enabled_err(); - check_auto_cache_resize(); - check_auto_cache_resize_disable(); - check_auto_cache_resize_epoch_markers(); - check_auto_cache_resize_input_errs(); - check_auto_cache_resize_aux_fcns(); - - return(0); + nerrs += check_insert_entry(); + nerrs += check_flush_cache(); + nerrs += check_get_entry_status(); + nerrs += check_expunge_entry(); + nerrs += check_multiple_read_protect(); + nerrs += check_rename_entry(); + nerrs += check_pin_protected_entry(); + nerrs += check_resize_entry(); + nerrs += check_evictions_enabled(); + nerrs += check_flush_protected_err(); + nerrs += check_destroy_pinned_err(); + nerrs += check_destroy_protected_err(); + nerrs += check_duplicate_insert_err(); + nerrs += check_rename_err(); + nerrs += check_double_pin_err(); + nerrs += check_double_unpin_err(); + nerrs += check_pin_entry_errs(); + nerrs += check_double_protect_err(); + nerrs += check_double_unprotect_err(); + nerrs += check_mark_entry_dirty_errs(); + nerrs += check_expunge_entry_errs(); + nerrs += check_resize_entry_errs(); + nerrs += check_unprotect_ro_dirty_err(); + nerrs += check_protect_ro_rw_err(); + nerrs += check_check_evictions_enabled_err(); + nerrs += check_auto_cache_resize(); + nerrs += check_auto_cache_resize_disable(); + nerrs += check_auto_cache_resize_epoch_markers(); + nerrs += check_auto_cache_resize_input_errs(); + nerrs += check_auto_cache_resize_aux_fcns(); + + return( nerrs > 0 ); } /* main() */ diff --git a/test/cache2_api.c b/test/cache2_api.c index 0e78e25..5264753 100644 --- a/test/cache2_api.c +++ b/test/cache2_api.c @@ -43,38 +43,38 @@ const char *FILENAMES[] = { ( (a).set_initial_size == (b).set_initial_size ) ) && \ ( ( ! compare_init ) || \ ( (a).initial_size == (b).initial_size ) ) && \ - ( (a).min_clean_fraction == (b).min_clean_fraction ) && \ + ( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \ ( (a).max_size == (b).max_size ) && \ ( (a).min_size == (b).min_size ) && \ ( (a).epoch_length == (b).epoch_length ) && \ ( (a).incr_mode == (b).incr_mode ) && \ - ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \ - ( (a).increment == (b).increment ) && \ + ( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \ ( (a).apply_max_increment == (b).apply_max_increment ) && \ ( (a).max_increment == (b).max_increment ) && \ ( (a).flash_incr_mode == (b).flash_incr_mode ) && \ - ( (a).flash_multiple == (b).flash_multiple ) && \ - ( (a).flash_threshold == (b).flash_threshold ) && \ + ( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \ ( (a).decr_mode == (b).decr_mode ) && \ - ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ - ( (a).decrement == (b).decrement ) && \ + ( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \ ( (a).apply_max_decrement == (b).apply_max_decrement ) && \ ( (a).max_decrement == (b).max_decrement ) && \ ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \ ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \ - ( (a).empty_reserve == (b).empty_reserve ) ) + ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) ) /* private function declarations: */ -static void check_fapl_mdc_api_calls(void); +static unsigned check_fapl_mdc_api_calls(void); static void validate_mdc_config(hid_t file_id, H5AC2_cache_config_t * ext_config_ptr, hbool_t compare_init, int test_num); -static void check_file_mdc_api_calls(void); +static unsigned check_file_mdc_api_calls(void); static void check_and_validate_cache_hit_rate(hid_t file_id, double * hit_rate_ptr, @@ -92,12 +92,12 @@ static void check_and_validate_cache_size(hid_t file_id, /* This test can't be run until we start using H5C2, so comment * out declaration for now. */ -static void mdc_api_call_smoke_check(void); +static unsigned mdc_api_call_smoke_check(void); #endif -static void check_fapl_mdc_api_errs(void); +static unsigned check_fapl_mdc_api_errs(void); -static void check_file_mdc_api_errs(void); +static unsigned check_file_mdc_api_errs(void); /**************************************************************************/ @@ -139,26 +139,26 @@ static void check_file_mdc_api_errs(void); ( (a).set_initial_size == (b).set_initial_size ) ) && \ ( ( ! cmp_init_size ) || \ ( (a).initial_size == (b).initial_size ) ) && \ - ( (a).min_clean_fraction == (b).min_clean_fraction ) && \ + ( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \ ( (a).max_size == (b).max_size ) && \ ( (a).min_size == (b).min_size ) && \ ( (a).epoch_length == (b).epoch_length ) && \ ( (a).incr_mode == (b).incr_mode ) && \ - ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \ - ( (a).increment == (b).increment ) && \ + ( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \ ( (a).apply_max_increment == (b).apply_max_increment ) && \ ( (a).max_increment == (b).max_increment ) && \ ( (a).flash_incr_mode == (b).flash_incr_mode ) && \ - ( (a).flash_multiple == (b).flash_multiple ) && \ - ( (a).flash_threshold == (b).flash_threshold ) && \ + ( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \ ( (a).decr_mode == (b).decr_mode ) && \ - ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ - ( (a).decrement == (b).decrement ) && \ + ( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \ ( (a).apply_max_decrement == (b).apply_max_decrement ) && \ ( (a).max_decrement == (b).max_decrement ) && \ ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \ ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \ - ( (a).empty_reserve == (b).empty_reserve ) ) + ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) ) #define XLATE_EXT_TO_INT_MDC_CONFIG(i, e) \ { \ @@ -191,7 +191,7 @@ static void check_file_mdc_api_errs(void); (i).empty_reserve = (e).empty_reserve; \ } -static void +static unsigned check_fapl_mdc_api_calls(void) { const char * fcn_name = "check_fapl_mdc_api_calls()"; @@ -643,6 +643,8 @@ check_fapl_mdc_api_calls(void) HDfprintf(stdout, "%s: failure_mssg2 = \"%s\".\n", fcn_name, failure_mssg2); + return !pass2; + } /* check_fapl_mdc_api_calls() */ @@ -792,7 +794,7 @@ validate_mdc_config(hid_t file_id, *------------------------------------------------------------------------- */ -static void +static unsigned check_file_mdc_api_calls(void) { const char * fcn_name = "check_file_mdc_api_calls()"; @@ -803,7 +805,6 @@ check_file_mdc_api_calls(void) size_t cur_size; int cur_num_entries; double hit_rate; - H5F_t * file_ptr = NULL; H5AC2_cache_config_t default_config = H5AC2__DEFAULT_CACHE_CONFIG; H5AC2_cache_config_t mod_config_1 = { @@ -1112,6 +1113,8 @@ check_file_mdc_api_calls(void) HDfprintf(stdout, "%s: failure_mssg2 = \"%s\".\n", fcn_name, failure_mssg2); + return !pass2; + } /* check_file_mdc_api_calls() */ @@ -1420,7 +1423,7 @@ check_and_validate_cache_size(hid_t file_id, */ #if 0 -static void +static unsigned mdc_api_call_smoke_check(void) { const char * fcn_name = "mdc_api_call_smoke_check()"; @@ -2186,6 +2189,8 @@ mdc_api_call_smoke_check(void) HDfprintf(stdout, "%s: failure_mssg2 = \"%s\".\n", fcn_name, failure_mssg2); + return !pass2; + } /* mdc_api_call_smoke_check() */ #endif /* commented out for now */ @@ -3571,7 +3576,7 @@ H5AC2_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = *------------------------------------------------------------------------- */ -static void +static unsigned check_fapl_mdc_api_errs(void) { const char * fcn_name = "check_fapl_mdc_api_errs()"; @@ -3728,6 +3733,8 @@ check_fapl_mdc_api_errs(void) HDfprintf(stdout, "%s: failure_mssg2 = \"%s\".\n", fcn_name, failure_mssg2); + return !pass2; + } /* check_fapl_mdc_api_errs() */ @@ -3747,7 +3754,7 @@ check_fapl_mdc_api_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_file_mdc_api_errs(void) { const char * fcn_name = "check_file_mdc_api_errs()"; @@ -3762,7 +3769,9 @@ check_file_mdc_api_errs(void) size_t cur_size; int cur_num_entries; double hit_rate; +#if 0 /* JRM */ H5F_t * file_ptr = NULL; +#endif /* JRM */ H5AC2_cache_config_t default_config = H5AC2__DEFAULT_CACHE_CONFIG; H5AC2_cache_config_t scratch; @@ -4095,6 +4104,8 @@ check_file_mdc_api_errs(void) HDfprintf(stdout, "%s: failure_mssg2 = \"%s\".\n", fcn_name, failure_mssg2); + return !pass2; + } /* check_file_mdc_api_errs() */ @@ -4119,6 +4130,7 @@ int main(void) { int express_test; + unsigned nerrs = 0; H5open(); @@ -4127,22 +4139,22 @@ main(void) express_test = GetTestExpress(); #if 1 - check_fapl_mdc_api_calls(); + nerrs += check_fapl_mdc_api_calls(); #endif #if 1 - check_file_mdc_api_calls(); + nerrs += check_file_mdc_api_calls(); #endif #if 0 /* this test can't be run until we start using H5C2 */ - mdc_api_call_smoke_check(); + nerrs += mdc_api_call_smoke_check(); #endif #if 1 - check_fapl_mdc_api_errs(); + nerrs += check_fapl_mdc_api_errs(); #endif #if 1 - check_file_mdc_api_errs(); + nerrs += check_file_mdc_api_errs(); #endif - return(0); + return( nerrs > 0 ); } /* main() */ diff --git a/test/cache2_common.c b/test/cache2_common.c index a419bb6..31a8301 100644 --- a/test/cache2_common.c +++ b/test/cache2_common.c @@ -1034,7 +1034,9 @@ serialize(haddr_t addr, for ( i = 0; i < entry_ptr->num_flush_ops; i++ ) { - execute_flush_op2(entry_ptr->cache_ptr, + HDassert( entry_ptr->file_ptr ); + + execute_flush_op2(entry_ptr->file_ptr, entry_ptr, &((entry_ptr->flush_ops)[i]), flags_ptr); @@ -1364,7 +1366,9 @@ free_icr(haddr_t addr, if ( pinned_entry_ptr->pinning_ref_count <= 0 ) { - unpin_entry2(pinned_entry_ptr->cache_ptr, + HDassert( pinned_entry_ptr->file_ptr ); + + unpin_entry2(pinned_entry_ptr->file_ptr, pinned_entry_ptr->type, pinned_entry_ptr->index); } @@ -1570,7 +1574,7 @@ add_flush_op2(int target_type, */ void -create_pinned_entry_dependency2(H5C2_t * cache_ptr, +create_pinned_entry_dependency2(H5F_t * file_ptr, int pinning_type, int pinning_idx, int pinned_type, @@ -1614,8 +1618,8 @@ create_pinned_entry_dependency2(H5C2_t * cache_ptr, if ( pinned_entry_ptr->pinning_ref_count == 0 ) { - protect_entry2(cache_ptr, pinned_type, pinned_idx); - unprotect_entry2(cache_ptr, pinned_type, pinned_idx, FALSE, + protect_entry2(file_ptr, pinned_type, pinned_idx); + unprotect_entry2(file_ptr, pinned_type, pinned_idx, FALSE, H5C2__PIN_ENTRY_FLAG); } @@ -1653,11 +1657,12 @@ create_pinned_entry_dependency2(H5C2_t * cache_ptr, */ void -dirty_entry2(H5C2_t * cache_ptr, +dirty_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, hbool_t dirty_pin) { + H5C2_t * cache_ptr = file_ptr->shared->cache2; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -1690,15 +1695,15 @@ dirty_entry2(H5C2_t * cache_ptr, } else { - mark_pinned_entry_dirty2(cache_ptr, type, idx, + mark_pinned_entry_dirty2(file_ptr, type, idx, FALSE, (size_t)0); } } } else { - protect_entry2(cache_ptr, type, idx); - unprotect_entry2(cache_ptr, type, idx, TRUE, H5C2__NO_FLAGS_SET); + protect_entry2(file_ptr, type, idx); + unprotect_entry2(file_ptr, type, idx, TRUE, H5C2__NO_FLAGS_SET); } } @@ -1728,12 +1733,13 @@ dirty_entry2(H5C2_t * cache_ptr, */ void -execute_flush_op2(H5C2_t * cache_ptr, +execute_flush_op2(H5F_t * file_ptr, struct test_entry_t * entry_ptr, struct flush_op * op_ptr, unsigned * flags_ptr) { - const char * fcn_name = "execute_flush_op2()"; + /* const char * fcn_name = "execute_flush_op2()"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); @@ -1765,7 +1771,7 @@ execute_flush_op2(H5C2_t * cache_ptr, HDassert( ( entry_ptr->type != op_ptr->type ) || ( entry_ptr->index != op_ptr->idx ) ); - dirty_entry2(cache_ptr, op_ptr->type, op_ptr->idx, + dirty_entry2(file_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); break; @@ -1790,7 +1796,7 @@ execute_flush_op2(H5C2_t * cache_ptr, /* change the size of some other entry */ - resize_entry2(cache_ptr, op_ptr->type, op_ptr->idx, + resize_entry2(file_ptr, op_ptr->type, op_ptr->idx, op_ptr->size, op_ptr->flag); } break; @@ -2045,12 +2051,13 @@ reset_entries2(void) */ void -resize_entry2(H5C2_t * cache_ptr, +resize_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_t resize_pin) { + H5C2_t * cache_ptr = file_ptr->shared->cache2; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -2085,14 +2092,14 @@ resize_entry2(H5C2_t * cache_ptr, } else { - mark_pinned_entry_dirty2(cache_ptr, type, idx, + mark_pinned_entry_dirty2(file_ptr, type, idx, TRUE, new_size); } } } else { - protect_entry2(cache_ptr, type, idx); - unprotect_entry_with_size_change2(cache_ptr, type, idx, + protect_entry2(file_ptr, type, idx); + unprotect_entry_with_size_change2(file_ptr, type, idx, H5C2__SIZE_CHANGED_FLAG, new_size); } @@ -2125,11 +2132,12 @@ resize_entry2(H5C2_t * cache_ptr, */ void -resize_pinned_entry2(H5C2_t * cache_ptr, +resize_pinned_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, size_t new_size) { + H5C2_t * cache_ptr = file_ptr->shared->cache2; herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -2165,7 +2173,7 @@ resize_pinned_entry2(H5C2_t * cache_ptr, entry_ptr->size = new_size; - result = H5C2_resize_pinned_entry(cache_ptr, + result = H5C2_resize_pinned_entry(file_ptr, (void *)entry_ptr, new_size); @@ -2272,7 +2280,7 @@ verify_entry_status2(H5C2_t * cache_ptr, int num_entries, struct expected_entry_status expected[]) { - const char * fcn_name = "verify_entry_status2()"; + /* const char * fcn_name = "verify_entry_status2()"; */ static char msg[128]; hbool_t in_cache = FALSE; /* will set to TRUE if necessary */ int i; @@ -2588,7 +2596,7 @@ verify_unprotected2(void) * *****************************************************************************/ -H5C2_t * +H5F_t * setup_cache2(size_t max_cache_size, size_t min_clean_size) { @@ -2600,7 +2608,7 @@ setup_cache2(size_t max_cache_size, hid_t fid = -1; H5F_t * file_ptr = NULL; H5C2_t * cache_ptr = NULL; - H5C2_t * ret_val = NULL; + H5F_t * ret_val = NULL; haddr_t actual_base_addr; hid_t fapl_id = H5P_DEFAULT; @@ -2717,6 +2725,10 @@ setup_cache2(size_t max_cache_size, if ( pass2 ) { +/* FIXME: I'm in a hurry here, I'll need to talk to John about the best way + * to do this right... -QAK + */ +#ifdef OLD_WAY cache_ptr = H5C2_create(file_ptr, max_cache_size, min_clean_size, @@ -2726,6 +2738,20 @@ setup_cache2(size_t max_cache_size, TRUE, NULL, NULL); +#else /* OLD_WAY */ + H5C2_dest(file_ptr, H5P_DATASET_XFER_DEFAULT); + + cache_ptr = H5C2_create(max_cache_size, + min_clean_size, + (NUMBER_OF_ENTRY_TYPES - 1), + (const char **)entry_type_names2, + check_write_permitted2, + TRUE, + NULL, + NULL); + + file_ptr->shared->cache2 = cache_ptr; +#endif /* OLD_WAY */ } if ( show_progress ) /* 5 */ @@ -2795,7 +2821,7 @@ setup_cache2(size_t max_cache_size, if ( pass2 ) { H5C2_stats__reset(cache_ptr); - ret_val = cache_ptr; + ret_val = file_ptr; } if ( show_progress ) /* 8 */ @@ -2827,22 +2853,28 @@ setup_cache2(size_t max_cache_size, */ void -takedown_cache2(H5C2_t * cache_ptr, +takedown_cache2(H5F_t * file_ptr, hbool_t dump_stats, hbool_t dump_detailed_stats) { char filename[512]; - if ( cache_ptr != NULL ) { + if ( file_ptr != NULL ) { + H5C2_t * cache_ptr = file_ptr->shared->cache2; if ( dump_stats ) { H5C2_stats(cache_ptr, "test cache", dump_detailed_stats); } - flush_cache2(cache_ptr, TRUE, FALSE, FALSE); + flush_cache2(file_ptr, TRUE, FALSE, FALSE); - H5C2_dest(cache_ptr, H5P_DATASET_XFER_DEFAULT); +/* FIXME: Related to earlier hack with same tag, have John check for + * correctness... -QAK + */ +#ifdef OLD_WAY + H5C2_dest(file_ptr, H5P_DATASET_XFER_DEFAULT); +#endif /* OLD_WAY */ } @@ -2900,11 +2932,14 @@ takedown_cache2(H5C2_t * cache_ptr, */ void -expunge_entry2(H5C2_t * cache_ptr, +expunge_entry2(H5F_t * file_ptr, int32_t type, int32_t idx) { /* const char * fcn_name = "expunge_entry2()"; */ +#ifndef NDEBUG + H5C2_t * cache_ptr = file_ptr->shared->cache2; +#endif /* NDEBUG */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -2927,7 +2962,7 @@ expunge_entry2(H5C2_t * cache_ptr, HDassert( ! ( entry_ptr->header.is_pinned ) ); HDassert( ! ( entry_ptr->is_pinned ) ); - result = H5C2_expunge_entry(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[type]), entry_ptr->addr); @@ -2961,17 +2996,18 @@ expunge_entry2(H5C2_t * cache_ptr, */ void -flush_cache2(H5C2_t * cache_ptr, +flush_cache2(H5F_t * file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_t dump_detailed_stats) { const char * fcn_name = "flush_cache2()"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; hbool_t show_progress = FALSE; herr_t result = 0; int mile_post = 0; - HDassert(cache_ptr); + HDassert(file_ptr); if ( show_progress ) { HDfprintf(stdout, "%s: mile_post = %d.\n", @@ -2989,12 +3025,12 @@ flush_cache2(H5C2_t * cache_ptr, if ( destroy_entries ) { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__FLUSH_INVALIDATE_FLAG); } else { - result = H5C2_flush_cache(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C2__NO_FLAGS_SET); } } @@ -3069,12 +3105,13 @@ flush_cache2(H5C2_t * cache_ptr, */ void -insert_entry2(H5C2_t * cache_ptr, +insert_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, hbool_t UNUSED dirty, unsigned int flags) { + H5C2_t * cache_ptr = file_ptr->shared->cache2; herr_t result; hbool_t insert_pinned; test_entry_t * base_addr; @@ -3098,7 +3135,7 @@ insert_entry2(H5C2_t * cache_ptr, entry_ptr->is_dirty = TRUE; - result = H5C2_insert_entry(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[type]), entry_ptr->addr, entry_ptr->size, (void *)entry_ptr, flags); @@ -3129,6 +3166,7 @@ insert_entry2(H5C2_t * cache_ptr, } HDassert( entry_ptr->cache_ptr == NULL ); + entry_ptr->file_ptr = file_ptr; entry_ptr->cache_ptr = cache_ptr; if ( insert_pinned ) { @@ -3171,13 +3209,16 @@ insert_entry2(H5C2_t * cache_ptr, */ void -mark_pinned_entry_dirty2(H5C2_t * cache_ptr, +mark_pinned_entry_dirty2(H5F_t * file_ptr, int32_t type, int32_t idx, hbool_t size_changed, size_t new_size) { /* const char * fcn_name = "mark_pinned_entry_dirty2()"; */ +#ifndef NDEBUG + H5C2_t * cache_ptr = file_ptr->shared->cache2; +#endif /* NDEBUG */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3207,7 +3248,7 @@ mark_pinned_entry_dirty2(H5C2_t * cache_ptr, entry_ptr->size = new_size; } - result = H5C2_mark_pinned_entry_dirty(cache_ptr, + result = H5C2_mark_pinned_entry_dirty(file_ptr, (void *)entry_ptr, size_changed, new_size); @@ -3269,11 +3310,14 @@ mark_pinned_entry_dirty2(H5C2_t * cache_ptr, */ void -mark_pinned_or_protected_entry_dirty2(H5C2_t * cache_ptr, +mark_pinned_or_protected_entry_dirty2(H5F_t * file_ptr, int32_t type, int32_t idx) { /* const char * fcn_name = "mark_pinned_or_protected_entry_dirty2()"; */ +#ifndef NDEBUG + H5C2_t * cache_ptr = file_ptr->shared->cache2; +#endif /* NDEBUG */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3296,7 +3340,7 @@ mark_pinned_or_protected_entry_dirty2(H5C2_t * cache_ptr, entry_ptr->is_dirty = TRUE; - result = H5C2_mark_pinned_or_protected_entry_dirty(cache_ptr, + result = H5C2_mark_pinned_or_protected_entry_dirty(file_ptr, (void *)entry_ptr); if ( ( result < 0 ) @@ -3463,11 +3507,12 @@ rename_entry2(H5C2_t * cache_ptr, */ void -protect_entry2(H5C2_t * cache_ptr, +protect_entry2(H5F_t * file_ptr, int32_t type, int32_t idx) { const char * fcn_name = "protect_entry2()"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; hbool_t verbose = FALSE; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3499,7 +3544,7 @@ protect_entry2(H5C2_t * cache_ptr, (long)(entry_ptr->size)); } - cache_entry_ptr = H5C2_protect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + cache_entry_ptr = H5C2_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[type]), entry_ptr->addr, entry_ptr->size, NULL, H5C2__NO_FLAGS_SET); @@ -3548,6 +3593,7 @@ protect_entry2(H5C2_t * cache_ptr, ( entry_ptr->cache_ptr == cache_ptr ) ); entry_ptr->cache_ptr = cache_ptr; + entry_ptr->file_ptr = file_ptr; entry_ptr->is_protected = TRUE; } @@ -3585,11 +3631,12 @@ protect_entry2(H5C2_t * cache_ptr, */ void -protect_entry_ro2(H5C2_t * cache_ptr, +protect_entry_ro2(H5F_t * file_ptr, int32_t type, int32_t idx) { /* const char * fcn_name = "protect_entry_ro2()"; */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; test_entry_t * base_addr; test_entry_t * entry_ptr; H5C2_cache_entry_t * cache_entry_ptr; @@ -3610,7 +3657,7 @@ protect_entry_ro2(H5C2_t * cache_ptr, ( ( entry_ptr->is_read_only ) && ( entry_ptr->ro_ref_count > 0 ) ) ); - cache_entry_ptr = H5C2_protect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + cache_entry_ptr = H5C2_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[type]), entry_ptr->addr, entry_ptr->size, NULL, H5C2__READ_ONLY_FLAG); @@ -3632,6 +3679,7 @@ protect_entry_ro2(H5C2_t * cache_ptr, ( entry_ptr->cache_ptr == cache_ptr ) ); entry_ptr->cache_ptr = cache_ptr; + entry_ptr->file_ptr = file_ptr; entry_ptr->is_protected = TRUE; entry_ptr->is_read_only = TRUE; entry_ptr->ro_ref_count++; @@ -3665,11 +3713,14 @@ protect_entry_ro2(H5C2_t * cache_ptr, */ void -unpin_entry2(H5C2_t * cache_ptr, +unpin_entry2(H5F_t * file_ptr, int32_t type, int32_t idx) { /* const char * fcn_name = "unpin_entry2()"; */ +#ifndef NDEBUG + H5C2_t * cache_ptr = file_ptr->shared->cache2; +#endif /* NDEBUG */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3691,7 +3742,7 @@ unpin_entry2(H5C2_t * cache_ptr, HDassert( entry_ptr->header.is_pinned ); HDassert( entry_ptr->is_pinned ); - result = H5C2_unpin_entry(cache_ptr, (void *)entry_ptr); + result = H5C2_unpin_entry(file_ptr, (void *)entry_ptr); if ( ( result < 0 ) || ( entry_ptr->header.is_pinned ) || @@ -3751,13 +3802,16 @@ unpin_entry2(H5C2_t * cache_ptr, */ void -unprotect_entry2(H5C2_t * cache_ptr, +unprotect_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, int dirty, unsigned int flags) { const char * fcn_name = "unprotect_entry2()"; +#ifndef NDEBUG + H5C2_t * cache_ptr = file_ptr->shared->cache2; +#endif /* NDEBUG */ herr_t result; hbool_t verbose = FALSE; hbool_t pin_flag_set; @@ -3805,7 +3859,7 @@ unprotect_entry2(H5C2_t * cache_ptr, fcn_name, (long)(entry_ptr->addr)); } - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[type]), entry_ptr->addr, (void *)entry_ptr, flags, (size_t)0); @@ -3907,13 +3961,16 @@ unprotect_entry2(H5C2_t * cache_ptr, */ void -unprotect_entry_with_size_change2(H5C2_t * cache_ptr, +unprotect_entry_with_size_change2(H5F_t * file_ptr, int32_t type, int32_t idx, unsigned int flags, size_t new_size) { /* const char * fcn_name = "unprotect_entry_with_size_change2()"; */ +#ifndef NDEBUG + H5C2_t * cache_ptr = file_ptr->shared->cache2; +#endif /* NDEBUG */ herr_t result; hbool_t dirty_flag_set; hbool_t pin_flag_set; @@ -3959,7 +4016,7 @@ unprotect_entry_with_size_change2(H5C2_t * cache_ptr, entry_ptr->size = new_size; } - result = H5C2_unprotect(cache_ptr, H5P_DATASET_XFER_DEFAULT, + result = H5C2_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types2[type]), entry_ptr->addr, (void *)entry_ptr, flags, new_size); @@ -4031,7 +4088,7 @@ unprotect_entry_with_size_change2(H5C2_t * cache_ptr, */ void -row_major_scan_forward2(H5C2_t * cache_ptr, +row_major_scan_forward2(H5F_t * file_ptr, int32_t max_index, int32_t lag, hbool_t verbose, @@ -4048,6 +4105,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, int dirty_unprotects) { const char * fcn_name = "row_major_scan_forward2"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; int32_t type; int32_t idx; int32_t local_max_index; @@ -4087,7 +4145,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "1(i, %d, %d) ", type, (idx + lag)); - insert_entry2(cache_ptr, type, (idx + lag), dirty_inserts, + insert_entry2(file_ptr, type, (idx + lag), dirty_inserts, H5C2__NO_FLAGS_SET); } @@ -4100,7 +4158,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "2(p, %d, %d) ", type, (idx + lag - 1)); - protect_entry2(cache_ptr, type, (idx + lag - 1)); + protect_entry2(file_ptr, type, (idx + lag - 1)); } if ( ( pass2 ) && ( (idx + lag - 2) >= 0 ) && @@ -4111,7 +4169,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "3(u, %d, %d) ", type, (idx + lag - 2)); - unprotect_entry2(cache_ptr, type, idx+lag-2, NO_CHANGE, + unprotect_entry2(file_ptr, type, idx+lag-2, NO_CHANGE, H5C2__NO_FLAGS_SET); } @@ -4138,7 +4196,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "5(p, %d, %d) ", type, (idx + lag - 3)); - protect_entry2(cache_ptr, type, (idx + lag - 3)); + protect_entry2(file_ptr, type, (idx + lag - 3)); } if ( ( pass2 ) && ( (idx + lag - 5) >= 0 ) && @@ -4149,7 +4207,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "6(u, %d, %d) ", type, (idx + lag - 5)); - unprotect_entry2(cache_ptr, type, idx+lag-5, NO_CHANGE, + unprotect_entry2(file_ptr, type, idx+lag-5, NO_CHANGE, H5C2__NO_FLAGS_SET); } @@ -4164,7 +4222,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "7(p-ro, %d, %d) ", type, (idx + lag - 5)); - protect_entry_ro2(cache_ptr, type, (idx + lag - 5)); + protect_entry_ro2(file_ptr, type, (idx + lag - 5)); } if ( ( pass2 ) && ( (idx + lag - 6) >= 0 ) && @@ -4176,7 +4234,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "8(p-ro, %d, %d) ", type, (idx + lag - 6)); - protect_entry_ro2(cache_ptr, type, (idx + lag - 6)); + protect_entry_ro2(file_ptr, type, (idx + lag - 6)); } if ( ( pass2 ) && ( (idx + lag - 7) >= 0 ) && @@ -4188,7 +4246,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "9(p-ro, %d, %d) ", type, (idx + lag - 7)); - protect_entry_ro2(cache_ptr, type, (idx + lag - 7)); + protect_entry_ro2(file_ptr, type, (idx + lag - 7)); } if ( ( pass2 ) && ( (idx + lag - 7) >= 0 ) && @@ -4200,7 +4258,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "10(u-ro, %d, %d) ", type, (idx + lag - 7)); - unprotect_entry2(cache_ptr, type, (idx + lag - 7), + unprotect_entry2(file_ptr, type, (idx + lag - 7), FALSE, H5C2__NO_FLAGS_SET); } @@ -4213,7 +4271,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "11(u-ro, %d, %d) ", type, (idx + lag - 8)); - unprotect_entry2(cache_ptr, type, (idx + lag - 8), + unprotect_entry2(file_ptr, type, (idx + lag - 8), FALSE, H5C2__NO_FLAGS_SET); } @@ -4226,7 +4284,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "12(u-ro, %d, %d) ", type, (idx + lag - 9)); - unprotect_entry2(cache_ptr, type, (idx + lag - 9), + unprotect_entry2(file_ptr, type, (idx + lag - 9), FALSE, H5C2__NO_FLAGS_SET); } } /* if ( do_mult_ro_protects ) */ @@ -4237,7 +4295,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "13(p, %d, %d) ", type, idx); - protect_entry2(cache_ptr, type, idx); + protect_entry2(file_ptr, type, idx); } if ( ( pass2 ) && ( (idx - lag + 2) >= 0 ) && @@ -4248,7 +4306,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "14(u, %d, %d) ", type, (idx - lag + 2)); - unprotect_entry2(cache_ptr, type, idx-lag+2, NO_CHANGE, + unprotect_entry2(file_ptr, type, idx-lag+2, NO_CHANGE, H5C2__NO_FLAGS_SET); } @@ -4260,7 +4318,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "15(p, %d, %d) ", type, (idx - lag + 1)); - protect_entry2(cache_ptr, type, (idx - lag + 1)); + protect_entry2(file_ptr, type, (idx - lag + 1)); } @@ -4278,7 +4336,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "16(u, %d, %d) ", type, (idx - lag)); - unprotect_entry2(cache_ptr, type, idx - lag, + unprotect_entry2(file_ptr, type, idx - lag, NO_CHANGE, H5C2__NO_FLAGS_SET); break; @@ -4289,7 +4347,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "17(u, %d, %d) ", type, (idx - lag)); - unprotect_entry2(cache_ptr, type, idx - lag, + unprotect_entry2(file_ptr, type, idx - lag, NO_CHANGE, H5C2__NO_FLAGS_SET); } else { @@ -4297,7 +4355,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "18(u, %d, %d) ", type, (idx - lag)); - unprotect_entry2(cache_ptr, type, idx - lag, + unprotect_entry2(file_ptr, type, idx - lag, dirty_unprotects, H5C2__NO_FLAGS_SET); } @@ -4309,7 +4367,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, HDfprintf(stdout, "19(u-del, %d, %d) ", type, (idx - lag)); - unprotect_entry2(cache_ptr, type, idx - lag, + unprotect_entry2(file_ptr, type, idx - lag, NO_CHANGE, H5C2__DELETED_FLAG); break; @@ -4321,7 +4379,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, "20(u-del, %d, %d) ", type, (idx - lag)); - unprotect_entry2(cache_ptr, type, idx - lag, + unprotect_entry2(file_ptr, type, idx - lag, NO_CHANGE, H5C2__DELETED_FLAG); } else { @@ -4330,7 +4388,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, "21(u-del, %d, %d) ", type, (idx - lag)); - unprotect_entry2(cache_ptr, type, idx - lag, + unprotect_entry2(file_ptr, type, idx - lag, dirty_destroys, H5C2__DELETED_FLAG); } @@ -4351,7 +4409,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "22(u, %d, %d) ", type, (idx - lag)); - unprotect_entry2(cache_ptr, type, idx - lag, + unprotect_entry2(file_ptr, type, idx - lag, dirty_unprotects, H5C2__NO_FLAGS_SET); } } @@ -4397,7 +4455,7 @@ row_major_scan_forward2(H5C2_t * cache_ptr, */ void -hl_row_major_scan_forward2(H5C2_t * cache_ptr, +hl_row_major_scan_forward2(H5F_t * file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, @@ -4407,6 +4465,7 @@ hl_row_major_scan_forward2(H5C2_t * cache_ptr, hbool_t dirty_inserts) { const char * fcn_name = "hl_row_major_scan_forward2"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; int32_t type; int32_t idx; int32_t i; @@ -4443,7 +4502,7 @@ hl_row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry2(cache_ptr, type, (idx + lag), dirty_inserts, + insert_entry2(file_ptr, type, (idx + lag), dirty_inserts, H5C2__NO_FLAGS_SET); } @@ -4456,12 +4515,12 @@ hl_row_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, i); - protect_entry2(cache_ptr, type, i); + protect_entry2(file_ptr, type, i); if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry2(cache_ptr, type, i, NO_CHANGE, + unprotect_entry2(file_ptr, type, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i--; @@ -4511,7 +4570,7 @@ hl_row_major_scan_forward2(H5C2_t * cache_ptr, */ void -row_major_scan_backward2(H5C2_t * cache_ptr, +row_major_scan_backward2(H5F_t * file_ptr, int32_t max_index, int32_t lag, hbool_t verbose, @@ -4528,6 +4587,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, int dirty_unprotects) { const char * fcn_name = "row_major_scan_backward2"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; int32_t type; int32_t idx; int32_t local_max_index; @@ -4562,7 +4622,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag)); - insert_entry2(cache_ptr, type, (idx - lag), dirty_inserts, + insert_entry2(file_ptr, type, (idx - lag), dirty_inserts, H5C2__NO_FLAGS_SET); } @@ -4575,7 +4635,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 1)); - protect_entry2(cache_ptr, type, (idx - lag + 1)); + protect_entry2(file_ptr, type, (idx - lag + 1)); } if ( ( pass2 ) && ( (idx - lag + 2) >= 0 ) && @@ -4586,7 +4646,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); - unprotect_entry2(cache_ptr, type, idx-lag+2, NO_CHANGE, + unprotect_entry2(file_ptr, type, idx-lag+2, NO_CHANGE, H5C2__NO_FLAGS_SET); } @@ -4613,7 +4673,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 3)); - protect_entry2(cache_ptr, type, (idx - lag + 3)); + protect_entry2(file_ptr, type, (idx - lag + 3)); } if ( ( pass2 ) && ( (idx - lag + 5) >= 0 ) && @@ -4624,7 +4684,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 5)); - unprotect_entry2(cache_ptr, type, idx-lag+5, NO_CHANGE, + unprotect_entry2(file_ptr, type, idx-lag+5, NO_CHANGE, H5C2__NO_FLAGS_SET); } @@ -4639,7 +4699,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, HDfprintf(stdout, "(p-ro, %d, %d) ", type, (idx - lag + 5)); - protect_entry_ro2(cache_ptr, type, (idx - lag + 5)); + protect_entry_ro2(file_ptr, type, (idx - lag + 5)); } if ( ( pass2 ) && ( (idx - lag + 6) >= 0 ) && @@ -4651,7 +4711,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, HDfprintf(stdout, "(p-ro, %d, %d) ", type, (idx - lag + 6)); - protect_entry_ro2(cache_ptr, type, (idx - lag + 6)); + protect_entry_ro2(file_ptr, type, (idx - lag + 6)); } if ( ( pass2 ) && ( (idx - lag + 7) >= 0 ) && @@ -4663,7 +4723,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, HDfprintf(stdout, "(p-ro, %d, %d) ", type, (idx - lag + 7)); - protect_entry_ro2(cache_ptr, type, (idx - lag + 7)); + protect_entry_ro2(file_ptr, type, (idx - lag + 7)); } if ( ( pass2 ) && ( (idx - lag + 7) >= 0 ) && @@ -4675,7 +4735,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, HDfprintf(stdout, "(u-ro, %d, %d) ", type, (idx - lag + 7)); - unprotect_entry2(cache_ptr, type, (idx - lag + 7), + unprotect_entry2(file_ptr, type, (idx - lag + 7), FALSE, H5C2__NO_FLAGS_SET); } @@ -4688,7 +4748,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, HDfprintf(stdout, "(u-ro, %d, %d) ", type, (idx - lag + 8)); - unprotect_entry2(cache_ptr, type, (idx - lag + 8), + unprotect_entry2(file_ptr, type, (idx - lag + 8), FALSE, H5C2__NO_FLAGS_SET); } @@ -4701,7 +4761,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, HDfprintf(stdout, "(u-ro, %d, %d) ", type, (idx - lag + 9)); - unprotect_entry2(cache_ptr, type, (idx - lag + 9), + unprotect_entry2(file_ptr, type, (idx - lag + 9), FALSE, H5C2__NO_FLAGS_SET); } } /* if ( do_mult_ro_protects ) */ @@ -4712,7 +4772,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); - protect_entry2(cache_ptr, type, idx); + protect_entry2(file_ptr, type, idx); } @@ -4724,7 +4784,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); - unprotect_entry2(cache_ptr, type, idx+lag-2, NO_CHANGE, + unprotect_entry2(file_ptr, type, idx+lag-2, NO_CHANGE, H5C2__NO_FLAGS_SET); } @@ -4736,7 +4796,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, (idx + lag - 1)); - protect_entry2(cache_ptr, type, (idx + lag - 1)); + protect_entry2(file_ptr, type, (idx + lag - 1)); } @@ -4751,36 +4811,36 @@ row_major_scan_backward2(H5C2_t * cache_ptr, case 0: if ( (entries2[type])[idx+lag].is_dirty ) { - unprotect_entry2(cache_ptr, type, idx + lag, + unprotect_entry2(file_ptr, type, idx + lag, NO_CHANGE, H5C2__NO_FLAGS_SET); } else { - unprotect_entry2(cache_ptr, type, idx + lag, + unprotect_entry2(file_ptr, type, idx + lag, dirty_unprotects, H5C2__NO_FLAGS_SET); } break; case 1: /* we just did an insert */ - unprotect_entry2(cache_ptr, type, idx + lag, + unprotect_entry2(file_ptr, type, idx + lag, NO_CHANGE, H5C2__NO_FLAGS_SET); break; case 2: if ( (entries2[type])[idx + lag].is_dirty ) { - unprotect_entry2(cache_ptr, type, idx + lag, + unprotect_entry2(file_ptr, type, idx + lag, NO_CHANGE, H5C2__DELETED_FLAG); } else { - unprotect_entry2(cache_ptr, type, idx + lag, + unprotect_entry2(file_ptr, type, idx + lag, dirty_destroys, H5C2__DELETED_FLAG); } break; case 3: /* we just did an insrt */ - unprotect_entry2(cache_ptr, type, idx + lag, + unprotect_entry2(file_ptr, type, idx + lag, NO_CHANGE, H5C2__DELETED_FLAG); break; @@ -4798,7 +4858,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); - unprotect_entry2(cache_ptr, type, idx + lag, + unprotect_entry2(file_ptr, type, idx + lag, dirty_unprotects, H5C2__NO_FLAGS_SET); } } @@ -4844,7 +4904,7 @@ row_major_scan_backward2(H5C2_t * cache_ptr, */ void -hl_row_major_scan_backward2(H5C2_t * cache_ptr, +hl_row_major_scan_backward2(H5F_t * file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, @@ -4854,6 +4914,7 @@ hl_row_major_scan_backward2(H5C2_t * cache_ptr, hbool_t dirty_inserts) { const char * fcn_name = "hl_row_major_scan_backward2"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; int32_t type; int32_t idx; int32_t i; @@ -4890,7 +4951,7 @@ hl_row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry2(cache_ptr, type, (idx + lag), dirty_inserts, + insert_entry2(file_ptr, type, (idx + lag), dirty_inserts, H5C2__NO_FLAGS_SET); } @@ -4903,12 +4964,12 @@ hl_row_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, i); - protect_entry2(cache_ptr, type, i); + protect_entry2(file_ptr, type, i); if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry2(cache_ptr, type, i, NO_CHANGE, + unprotect_entry2(file_ptr, type, i, NO_CHANGE, H5C2__NO_FLAGS_SET); } i--; @@ -4954,7 +5015,7 @@ hl_row_major_scan_backward2(H5C2_t * cache_ptr, */ void -col_major_scan_forward2(H5C2_t * cache_ptr, +col_major_scan_forward2(H5F_t * file_ptr, int32_t max_index, int32_t lag, hbool_t verbose, @@ -4966,6 +5027,7 @@ col_major_scan_forward2(H5C2_t * cache_ptr, int dirty_unprotects) { const char * fcn_name = "col_major_scan_forward2()"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; int i; int32_t type; int32_t idx; @@ -4976,7 +5038,7 @@ col_major_scan_forward2(H5C2_t * cache_ptr, for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ ) { - local_max_index[i] = MIN(max_index, max_indices2[type]); + local_max_index[i] = MIN(max_index, max_indices2[i]); } HDassert( lag > 5 ); @@ -5005,7 +5067,7 @@ col_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry2(cache_ptr, type, (idx + lag), dirty_inserts, + insert_entry2(file_ptr, type, (idx + lag), dirty_inserts, H5C2__NO_FLAGS_SET); } @@ -5017,7 +5079,7 @@ col_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); - protect_entry2(cache_ptr, type, idx); + protect_entry2(file_ptr, type, idx); } if ( ( pass2 ) && ( (idx - lag) >= 0 ) && @@ -5027,7 +5089,7 @@ col_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); - unprotect_entry2(cache_ptr, type, idx - lag, + unprotect_entry2(file_ptr, type, idx - lag, dirty_unprotects, H5C2__NO_FLAGS_SET); } @@ -5073,7 +5135,7 @@ col_major_scan_forward2(H5C2_t * cache_ptr, */ void -hl_col_major_scan_forward2(H5C2_t * cache_ptr, +hl_col_major_scan_forward2(H5F_t * file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, @@ -5084,6 +5146,7 @@ hl_col_major_scan_forward2(H5C2_t * cache_ptr, int dirty_unprotects) { const char * fcn_name = "hl_col_major_scan_forward2()"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; int32_t type; int32_t idx; int32_t lag = 200; @@ -5127,7 +5190,7 @@ hl_col_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, i); - insert_entry2(cache_ptr, type, i, dirty_inserts, + insert_entry2(file_ptr, type, i, dirty_inserts, H5C2__NO_FLAGS_SET); } @@ -5136,7 +5199,7 @@ hl_col_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, i); - protect_entry2(cache_ptr, type, i); + protect_entry2(file_ptr, type, i); } if ( ( pass2 ) && ( i >= 0 ) && @@ -5146,7 +5209,7 @@ hl_col_major_scan_forward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry2(cache_ptr, type, i, + unprotect_entry2(file_ptr, type, i, dirty_unprotects, H5C2__NO_FLAGS_SET); } @@ -5194,7 +5257,7 @@ hl_col_major_scan_forward2(H5C2_t * cache_ptr, */ void -col_major_scan_backward2(H5C2_t * cache_ptr, +col_major_scan_backward2(H5F_t * file_ptr, int32_t max_index, int32_t lag, hbool_t verbose, @@ -5206,6 +5269,7 @@ col_major_scan_backward2(H5C2_t * cache_ptr, int dirty_unprotects) { const char * fcn_name = "col_major_scan_backward2()"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; int i; int mile_stone = 1; int32_t type; @@ -5217,7 +5281,7 @@ col_major_scan_backward2(H5C2_t * cache_ptr, for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ ) { - local_max_index[i] = MIN(max_index, max_indices2[type]); + local_max_index[i] = MIN(max_index, max_indices2[i]); } HDassert( lag > 5 ); @@ -5249,7 +5313,7 @@ col_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag)); - insert_entry2(cache_ptr, type, (idx - lag), dirty_inserts, + insert_entry2(file_ptr, type, (idx - lag), dirty_inserts, H5C2__NO_FLAGS_SET); } @@ -5261,7 +5325,7 @@ col_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); - protect_entry2(cache_ptr, type, idx); + protect_entry2(file_ptr, type, idx); } if ( ( pass2 ) && ( (idx + lag) >= 0 ) && @@ -5271,7 +5335,7 @@ col_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); - unprotect_entry2(cache_ptr, type, idx + lag, + unprotect_entry2(file_ptr, type, idx + lag, dirty_unprotects, H5C2__NO_FLAGS_SET); } @@ -5323,7 +5387,7 @@ col_major_scan_backward2(H5C2_t * cache_ptr, */ void -hl_col_major_scan_backward2(H5C2_t * cache_ptr, +hl_col_major_scan_backward2(H5F_t * file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, @@ -5334,6 +5398,7 @@ hl_col_major_scan_backward2(H5C2_t * cache_ptr, int dirty_unprotects) { const char * fcn_name = "hl_col_major_scan_backward2()"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; int32_t type; int32_t idx; int32_t lag = 50; @@ -5376,7 +5441,7 @@ hl_col_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, i); - insert_entry2(cache_ptr, type, i, dirty_inserts, + insert_entry2(file_ptr, type, i, dirty_inserts, H5C2__NO_FLAGS_SET); } @@ -5385,7 +5450,7 @@ hl_col_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, i); - protect_entry2(cache_ptr, type, i); + protect_entry2(file_ptr, type, i); } if ( ( pass2 ) && ( i >= 0 ) && @@ -5394,7 +5459,7 @@ hl_col_major_scan_backward2(H5C2_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry2(cache_ptr, type, i, + unprotect_entry2(file_ptr, type, i, dirty_unprotects, H5C2__NO_FLAGS_SET); } @@ -5418,3 +5483,4 @@ hl_col_major_scan_backward2(H5C2_t * cache_ptr, return; } /* hl_col_major_scan_backward2() */ + diff --git a/test/cache2_common.h b/test/cache2_common.h index 81f9255..47b9b5a 100644 --- a/test/cache2_common.h +++ b/test/cache2_common.h @@ -195,6 +195,10 @@ typedef struct test_entry_t struct test_entry_t * self; /* pointer to this entry -- used for * sanity checking. */ + H5F_t * file_ptr; /* pointer to the file in which the + * entry resides, or NULL if the entry + * is not in a file. + */ H5C2_t * cache_ptr; /* pointer to the cache in which * the entry resides, or NULL if the * entry is not in cache. @@ -638,28 +642,28 @@ haddr_t type_and_index_to_addr2(int32_t type, int32_t idx); #endif -void dirty_entry2(H5C2_t * cache_ptr, +void dirty_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, hbool_t dirty_pin); -void expunge_entry2(H5C2_t * cache_ptr, +void expunge_entry2(H5F_t * file_ptr, int32_t type, int32_t idx); -void insert_entry2(H5C2_t * cache_ptr, +void insert_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, hbool_t dirty, unsigned int flags); -void mark_pinned_entry_dirty2(H5C2_t * cache_ptr, +void mark_pinned_entry_dirty2(H5F_t * file_ptr, int32_t type, int32_t idx, hbool_t size_changed, size_t new_size); -void mark_pinned_or_protected_entry_dirty2(H5C2_t * cache_ptr, +void mark_pinned_or_protected_entry_dirty2(H5F_t * file_ptr, int32_t type, int32_t idx); @@ -668,11 +672,11 @@ void rename_entry2(H5C2_t * cache_ptr, int32_t idx, hbool_t main_addr); -void protect_entry2(H5C2_t * cache_ptr, +void protect_entry2(H5F_t * file_ptr, int32_t type, int32_t idx); -void protect_entry_ro2(H5C2_t * cache_ptr, +void protect_entry_ro2(H5F_t * file_ptr, int32_t type, int32_t idx); @@ -680,33 +684,33 @@ hbool_t entry_in_cache2(H5C2_t * cache_ptr, int32_t type, int32_t idx); -void create_pinned_entry_dependency2(H5C2_t * cache_ptr, +void create_pinned_entry_dependency2(H5F_t * file_ptr, int pinning_type, int pinning_idx, int pinned_type, int pinned_idx); -void execute_flush_op2(H5C2_t * cache_ptr, +void execute_flush_op2(H5F_t * file_ptr, struct test_entry_t * entry_ptr, struct flush_op * op_ptr, unsigned * flags_ptr); void reset_entries2(void); -void resize_entry2(H5C2_t * cache_ptr, +void resize_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_t resize_pin); -void resize_pinned_entry2(H5C2_t * cache_ptr, +void resize_pinned_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, size_t new_size); -H5C2_t * setup_cache2(size_t max_cache_size, size_t min_clean_size); +H5F_t * setup_cache2(size_t max_cache_size, size_t min_clean_size); -void row_major_scan_forward2(H5C2_t * cache_ptr, +void row_major_scan_forward2(H5F_t * file_ptr, int32_t max_index, int32_t lag, hbool_t verbose, @@ -722,7 +726,7 @@ void row_major_scan_forward2(H5C2_t * cache_ptr, int dirty_destroys, int dirty_unprotects); -void hl_row_major_scan_forward2(H5C2_t * cache_ptr, +void hl_row_major_scan_forward2(H5F_t * file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, @@ -731,7 +735,7 @@ void hl_row_major_scan_forward2(H5C2_t * cache_ptr, hbool_t do_inserts, hbool_t dirty_inserts); -void row_major_scan_backward2(H5C2_t * cache_ptr, +void row_major_scan_backward2(H5F_t * file_ptr, int32_t max_index, int32_t lag, hbool_t verbose, @@ -747,7 +751,7 @@ void row_major_scan_backward2(H5C2_t * cache_ptr, int dirty_destroys, int dirty_unprotects); -void hl_row_major_scan_backward2(H5C2_t * cache_ptr, +void hl_row_major_scan_backward2(H5F_t * file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, @@ -756,7 +760,7 @@ void hl_row_major_scan_backward2(H5C2_t * cache_ptr, hbool_t do_inserts, hbool_t dirty_inserts); -void col_major_scan_forward2(H5C2_t * cache_ptr, +void col_major_scan_forward2(H5F_t * file_ptr, int32_t max_index, int32_t lag, hbool_t verbose, @@ -767,7 +771,7 @@ void col_major_scan_forward2(H5C2_t * cache_ptr, hbool_t dirty_inserts, int dirty_unprotects); -void hl_col_major_scan_forward2(H5C2_t * cache_ptr, +void hl_col_major_scan_forward2(H5F_t * file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, @@ -777,7 +781,7 @@ void hl_col_major_scan_forward2(H5C2_t * cache_ptr, hbool_t dirty_inserts, int dirty_unprotects); -void col_major_scan_backward2(H5C2_t * cache_ptr, +void col_major_scan_backward2(H5F_t * file_ptr, int32_t max_index, int32_t lag, hbool_t verbose, @@ -788,7 +792,7 @@ void col_major_scan_backward2(H5C2_t * cache_ptr, hbool_t dirty_inserts, int dirty_unprotects); -void hl_col_major_scan_backward2(H5C2_t * cache_ptr, +void hl_col_major_scan_backward2(H5F_t * file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, @@ -798,26 +802,26 @@ void hl_col_major_scan_backward2(H5C2_t * cache_ptr, hbool_t dirty_inserts, int dirty_unprotects); -void takedown_cache2(H5C2_t * cache_ptr, +void takedown_cache2(H5F_t * file_ptr, hbool_t dump_stats, hbool_t dump_detailed_stats); -void flush_cache2(H5C2_t * cache_ptr, +void flush_cache2(H5F_t * file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_t dump_detailed_stats); -void unpin_entry2(H5C2_t * cache_ptr, +void unpin_entry2(H5F_t * file_ptr, int32_t type, int32_t idx); -void unprotect_entry2(H5C2_t * cache_ptr, +void unprotect_entry2(H5F_t * file_ptr, int32_t type, int32_t idx, int dirty, unsigned int flags); -void unprotect_entry_with_size_change2(H5C2_t * cache_ptr, +void unprotect_entry_with_size_change2(H5F_t * file_ptr, int32_t type, int32_t idx, unsigned int flags, diff --git a/test/cache2_journal.c b/test/cache2_journal.c index a045573..fa2145f 100644 --- a/test/cache2_journal.c +++ b/test/cache2_journal.c @@ -59,7 +59,7 @@ static void write_noflush_verify(H5C2_jbrb_t * struct_ptr, static void check_mdj_config_block_IO(void); -static void test_mdj_conf_blk_read_write_discard(H5C2_t * cache_ptr, +static void test_mdj_conf_blk_read_write_discard(H5F_t * file_ptr, const char * jrnl_file_path); static void check_superblock_extensions(void); @@ -238,27 +238,27 @@ check_mdj_config_block_IO(void) /* with length some multiple of 4. */ /*************************************************************************/ - test_mdj_conf_blk_read_write_discard(cache_ptr, "a"); + test_mdj_conf_blk_read_write_discard(file_ptr, "a"); if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - test_mdj_conf_blk_read_write_discard(cache_ptr, "ab"); + test_mdj_conf_blk_read_write_discard(file_ptr, "ab"); if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - test_mdj_conf_blk_read_write_discard(cache_ptr, "abc"); + test_mdj_conf_blk_read_write_discard(file_ptr, "abc"); if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - test_mdj_conf_blk_read_write_discard(cache_ptr, "abcd"); + test_mdj_conf_blk_read_write_discard(file_ptr, "abcd"); if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - test_mdj_conf_blk_read_write_discard(cache_ptr, "abcde"); + test_mdj_conf_blk_read_write_discard(file_ptr, "abcde"); if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - test_mdj_conf_blk_read_write_discard(cache_ptr, + test_mdj_conf_blk_read_write_discard(file_ptr, "abcdefghijklmnopqrstuvwxyz"); if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); @@ -284,7 +284,7 @@ check_mdj_config_block_IO(void) if ( pass2 ) { - result = H5C2_create_journal_config_block(cache_ptr, + result = H5C2_create_journal_config_block(file_ptr, H5P_DATASET_XFER_DEFAULT, test_path); @@ -404,7 +404,7 @@ check_mdj_config_block_IO(void) cache_ptr->mdj_conf_block_ptr = NULL; cache_ptr->mdj_file_name_ptr = NULL; - result = H5C2_load_journal_config_block(cache_ptr, + result = H5C2_load_journal_config_block(file_ptr, H5P_DATASET_XFER_DEFAULT, block_addr, block_len); @@ -506,10 +506,11 @@ check_mdj_config_block_IO(void) */ static void -test_mdj_conf_blk_read_write_discard(H5C2_t * cache_ptr, +test_mdj_conf_blk_read_write_discard(H5F_t * file_ptr, const char * jrnl_file_path) { const char * fcn_name = "test_mdj_conf_blk_read_write_discard()"; + H5C2_t * cache_ptr = file_ptr->shared->cache2; hbool_t show_progress = FALSE; int cp = 0; herr_t result; @@ -542,7 +543,7 @@ test_mdj_conf_blk_read_write_discard(H5C2_t * cache_ptr, if ( pass2 ) { - result = H5C2_create_journal_config_block(cache_ptr, + result = H5C2_create_journal_config_block(file_ptr, H5P_DATASET_XFER_DEFAULT, jrnl_file_path); @@ -602,7 +603,7 @@ test_mdj_conf_blk_read_write_discard(H5C2_t * cache_ptr, cache_ptr->mdj_conf_block_ptr = NULL; cache_ptr->mdj_file_name_ptr = NULL; - result = H5C2_load_journal_config_block(cache_ptr, + result = H5C2_load_journal_config_block(file_ptr, H5P_DATASET_XFER_DEFAULT, block_addr, block_len); @@ -653,7 +654,7 @@ test_mdj_conf_blk_read_write_discard(H5C2_t * cache_ptr, if ( pass2 ) { - result = H5C2_discard_journal_config_block(cache_ptr, + result = H5C2_discard_journal_config_block(file_ptr, H5P_DATASET_XFER_DEFAULT); if ( result != SUCCEED ) { @@ -721,7 +722,6 @@ static void check_superblock_extensions(void) { const char * fcn_name = "check_superblock_extensions()"; - const char * journal_file_name = "journal_file.txt"; char filename[512]; hbool_t show_progress = FALSE; haddr_t mdc_jrnl_block_loc = 0x1000; @@ -1429,7 +1429,7 @@ check_buffer_writes(void) if ( result != 0) { pass2 = FALSE; - failure_mssg2 = "H5C2_jb_init failed"; + failure_mssg2 = "H5C2_jb_init failed, check 1"; } /* end if */ @@ -1769,7 +1769,7 @@ check_message_format(void) if ( result != 0) { pass2 = FALSE; - failure_mssg2 = "H5C2_jb_init failed"; + failure_mssg2 = "H5C2_jb_init failed, check 2"; } /* end if */ @@ -1804,7 +1804,7 @@ check_message_format(void) /* trans number */ 1, /* base address */ (haddr_t)0, /* data length */ 1, - /* data */ "A") + /* data */ (const uint8_t *)"A") != SUCCEED ) { pass2 = FALSE; @@ -1825,7 +1825,7 @@ check_message_format(void) /* trans number */ 1, /* base address */ (haddr_t)1, /* data length */ 2, - /* data */ "AB") + /* data */ (const uint8_t *)"AB") != SUCCEED ) { pass2 = FALSE; @@ -1846,7 +1846,7 @@ check_message_format(void) /* trans number */ 1, /* base address */ (haddr_t)3, /* data length */ 4, - /* data */ "CDEF") + /* data */ (const uint8_t *)"CDEF") != SUCCEED ) { pass2 = FALSE; @@ -1902,7 +1902,7 @@ check_message_format(void) /* trans number */ 2, /* base address */ (haddr_t)285, /* data length */ 11, - /* data */ "Test Data?!") + /* data */ (const uint8_t *)"Test Data?!") != SUCCEED ) { pass2 = FALSE; @@ -2022,7 +2022,7 @@ check_message_format(void) /* trans number */ 3, /* base address */ (haddr_t)28591, /* data length */ 6, - /* data */ "#1nN`}") + /* data */ (const uint8_t *)"#1nN`}") != SUCCEED ) { pass2 = FALSE; @@ -2236,7 +2236,7 @@ check_legal_calls(void) if ( result != SUCCEED) { pass2 = FALSE; - failure_mssg2 = "H5C2_jb_init failed"; + failure_mssg2 = "H5C2_jb_init failed, check 3"; } /* end if */ @@ -2295,7 +2295,7 @@ check_legal_calls(void) /* Transaction # */ 1, /* Base Address */ (haddr_t)123456789, /* Length */ 16, - /* Body */ "This should fail") + /* Body */ (const uint8_t *)"This should fail") == SUCCEED ) { pass2 = FALSE; @@ -2375,7 +2375,7 @@ check_legal_calls(void) /* Transaction # */ 2, /* Base Address */ (haddr_t)123456789, /* Length */ 16, - /* Body */ "This should fail") + /* Body */ (const uint8_t *)"This should fail") == SUCCEED ) { pass2 = FALSE; @@ -2396,7 +2396,7 @@ check_legal_calls(void) /* Transaction # */ 1, /* Base Address */ (haddr_t)123456789, /* Length */ 51, - /* Body */ "This is the first transaction during transaction 1.") + /* Body */ (const uint8_t *)"This is the first transaction during transaction 1.") != SUCCEED ) { pass2 = FALSE; @@ -2492,7 +2492,7 @@ check_legal_calls(void) /* Transaction # */ 2, /* Base Address */ (haddr_t)7465, /* Length */ 51, - /* Body */ "This is the first transaction during transaction 2!") + /* Body */ (const uint8_t *)"This is the first transaction during transaction 2!") != SUCCEED ) { pass2 = FALSE; @@ -2513,7 +2513,7 @@ check_legal_calls(void) /* Transaction # */ 2, /* Base Address */ (haddr_t)123456789, /* Length */ 60, - /* Body */ "... And here's your second transaction during transaction 2.") + /* Body */ (const uint8_t *)"... And here's your second transaction during transaction 2.") != SUCCEED ) { pass2 = FALSE; @@ -2743,7 +2743,7 @@ check_transaction_tracking(void) if ( result != SUCCEED) { pass2 = FALSE; - failure_mssg2 = "H5C2_jb_init failed"; + failure_mssg2 = "H5C2_jb_init failed, check 4"; } /* end if */ @@ -2868,7 +2868,7 @@ check_transaction_tracking(void) if ( result != SUCCEED) { pass2 = FALSE; - failure_mssg2 = "H5C2_jb_init failed"; + failure_mssg2 = "H5C2_jb_init failed, check 5"; } /* end if */ @@ -2973,7 +2973,7 @@ check_transaction_tracking(void) if ( result != SUCCEED) { pass2 = FALSE; - failure_mssg2 = "H5C2_jb_init failed"; + failure_mssg2 = "H5C2_jb_init failed, check 6"; } /* end if */ @@ -3090,7 +3090,7 @@ check_transaction_tracking(void) if ( result != SUCCEED) { pass2 = FALSE; - failure_mssg2 = "H5C2_jb_init failed"; + failure_mssg2 = "H5C2_jb_init failed, check 7"; } /* end if */ @@ -3238,7 +3238,7 @@ write_verify_trans_num(H5C2_jbrb_t * struct_ptr, /* Transaction # */ trans_num, /* Base Address */ (haddr_t)16, /* Length */ 9, - /* Body */ "XXXXXXXXX") + /* Body */ (const uint8_t *)"XXXXXXXXX") != SUCCEED ) { pass2 = FALSE; @@ -3254,7 +3254,7 @@ write_verify_trans_num(H5C2_jbrb_t * struct_ptr, /* Transaction # */ trans_num, /* Base Address */ (haddr_t)16, /* Length */ 8, - /* Body */ "XXXXXXXX") + /* Body */ (const uint8_t *)"XXXXXXXX") != SUCCEED ) { pass2 = FALSE; @@ -3270,7 +3270,7 @@ write_verify_trans_num(H5C2_jbrb_t * struct_ptr, /* Transaction # */ trans_num, /* Base Address */ (haddr_t)16, /* Length */ 7, - /* Body */ "XXXXXXX") + /* Body */ (const uint8_t *)"XXXXXXX") != SUCCEED ) { pass2 = FALSE; diff --git a/tools/h5recover/testh5recover.sh.in b/tools/h5recover/testh5recover.sh.in index 9a6531b..d285901 100644 --- a/tools/h5recover/testh5recover.sh.in +++ b/tools/h5recover/testh5recover.sh.in @@ -29,6 +29,7 @@ TOOLCTLDataFile=CTL$TOOLDataFile RECOVERTOOL=h5recover # The tool name RECOVERTOOL_BIN=`pwd`/$RECOVERTOOL # The path of the tool binary H5DIFF=../h5diff/h5diff +H5DIFF_BIN=`pwd`/../h5diff/$H5DIFF # The path of the h5diff tool binary TESTDIR=`pwd`/../testfiles @@ -74,7 +75,7 @@ TOOLTEST() { TESTING $TOOL $@ $RUNSERIAL $TOOL_BIN $@ # expect first diff to fail - $RUNSERIAL $H5DIFF $TOOLDataFile $TOOLCTLDataFile > /dev/null 2>&1 + $RUNSERIAL $H5DIFF_BIN $TOOLDataFile $TOOLCTLDataFile > /dev/null 2>&1 if [ $? = 0 ]; then echo first diff did not fail as expected fi @@ -82,12 +83,12 @@ TOOLTEST() { # h5recover is not ready yet. Redirect its output to /dev/null. $RUNSERIAL $RECOVERTOOL_BIN $TOOLDataFile > /dev/null # second diff should produce expected output - $RUNSERIAL $H5DIFF $TOOLDataFile $TOOLCTLDataFile > $actual + $RUNSERIAL $H5DIFF_BIN $TOOLDataFile $TOOLCTLDataFile > $actual ( echo "#############################" echo "Expected output for '$TOOL $@'" echo "#############################" - $RUNSERIAL $H5DIFF $TOOLDataFile $TOOLCTLDataFile + $RUNSERIAL $H5DIFF_BIN $TOOLDataFile $TOOLCTLDataFile ) >$actual 2>$actual_err cat $actual_err >> $actual -- cgit v0.12