diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-20 12:43:30 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-20 12:43:30 (GMT) |
commit | 83f50e5a722f7a58562a0885fef695f74bce7285 (patch) | |
tree | 604f4dad662be4824a77eb85cffa3639cd35a9de /test/cache_common.c | |
parent | 02a23331992c618bb3cacb35bc0ea52f36ba1482 (diff) | |
download | hdf5-83f50e5a722f7a58562a0885fef695f74bce7285.zip hdf5-83f50e5a722f7a58562a0885fef695f74bce7285.tar.gz hdf5-83f50e5a722f7a58562a0885fef695f74bce7285.tar.bz2 |
[svn-r18865] Description:
Bring r18864 from trunk to 1.8 branch:
General cleanups to align metadata journaling branch and trunk
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
(h5committested on trunk)
Diffstat (limited to 'test/cache_common.c')
-rw-r--r-- | test/cache_common.c | 127 |
1 files changed, 92 insertions, 35 deletions
diff --git a/test/cache_common.c b/test/cache_common.c index 405a9ea..0d7df25 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -64,19 +64,84 @@ hbool_t try_core_file_driver = FALSE; hbool_t core_file_driver_failed = FALSE; const char *failure_mssg = NULL; -test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES]; -test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES]; -test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES]; -test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES]; -test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES]; -test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES]; -test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES]; -test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES]; -test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES]; -test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES]; +static test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES]; +static test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES]; +static test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES]; +static test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES]; +static test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES]; +static test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES]; +static test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES]; +static test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES]; +static test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES]; +static test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES]; hbool_t orig_entry_arrays_init = FALSE; +static herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t small_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t large_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest); + +static herr_t pico_dest(H5F_t * f, void * thing); +static herr_t nano_dest(H5F_t * f, void * thing); +static herr_t micro_dest(H5F_t * f, void * thing); +static herr_t tiny_dest(H5F_t * f, void * thing); +static herr_t small_dest(H5F_t * f, void * thing); +static herr_t medium_dest(H5F_t * f, void * thing); +static herr_t large_dest(H5F_t * f, void * thing); +static herr_t huge_dest(H5F_t * f, void * thing); +static herr_t monster_dest(H5F_t * f, void * thing); +static herr_t variable_dest(H5F_t * f, void * thing); + +static herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); + +static void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); + +static herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr); + test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] = { pico_entries, @@ -276,6 +341,7 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, /* address translation funtions: */ + /*------------------------------------------------------------------------- * Function: addr_to_type_and_index * @@ -1672,25 +1738,20 @@ reset_entries(void) /*------------------------------------------------------------------------- - * Function: resize_entry + * Function: resize_entry * - * Purpose: Given a pointer to a cache, an entry type, an index, and + * Purpose: Given a pointer to a cache, an entry type, an index, and * a new size, set the size of the target entry to the new size. * * Note that at present, the type of the entry must be * VARIABLE_ENTRY_TYPE. * - * If the in_cache parameter is true, verify that the - * target entry is in the cache. If it - * isn't, scream and die. If it is, use the - * H5C_resize_entry() call to resize it. - * - * Do nothing if pass is false on entry. + * Do nothing if pass is false on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer - * 6/10/04 + * Programmer: John Mainzer + * 1/11/08 * *------------------------------------------------------------------------- */ @@ -1699,7 +1760,7 @@ void resize_entry(H5F_t * file_ptr, int32_t type, int32_t idx, - size_t new_size, + size_t new_size, hbool_t in_cache) { test_entry_t * base_addr; @@ -1754,8 +1815,8 @@ resize_entry(H5F_t * file_ptr, HDassert( entry_ptr->size = (entry_ptr->header).size ); } - } - } + } + } } else { protect_entry(file_ptr, type, idx); @@ -2310,7 +2371,7 @@ setup_cache(size_t max_cache_size, cache_ptr = H5C_create(max_cache_size, min_clean_size, (NUMBER_OF_ENTRY_TYPES - 1), - (const char **)entry_type_names, + (const char **)entry_type_names, check_write_permitted, TRUE, NULL, @@ -2411,7 +2472,7 @@ setup_cache(size_t max_cache_size, * Return: void * * Programmer: John Mainzer - * 6/11/04 + * 9/14/07 * *------------------------------------------------------------------------- */ @@ -3014,10 +3075,9 @@ protect_entry_ro(H5F_t * file_ptr, int32_t type, int32_t idx) { - /* const char * fcn_name = "protect_entry_ro()"; */ H5C_t *cache_ptr; - test_entry_t * base_addr; - test_entry_t * entry_ptr; + test_entry_t *base_addr; + test_entry_t *entry_ptr; H5C_cache_entry_t * cache_entry_ptr; if ( pass ) { @@ -3090,7 +3150,6 @@ void unpin_entry(int32_t type, int32_t idx) { - /* const char * fcn_name = "unpin_entry()"; */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3110,7 +3169,7 @@ unpin_entry(int32_t type, HDassert( entry_ptr->header.is_pinned ); HDassert( entry_ptr->is_pinned ); - result = H5C_unpin_entry((void *)entry_ptr); + result = H5C_unpin_entry(entry_ptr); if ( ( result < 0 ) || ( entry_ptr->header.is_pinned ) || @@ -3912,7 +3971,7 @@ row_major_scan_backward(H5F_t * file_ptr, } else { unprotect_entry(file_ptr, type, idx + lag, - (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } break; @@ -3947,7 +4006,7 @@ row_major_scan_backward(H5F_t * file_ptr, ( ( idx + lag) <= max_indices[type] ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); unprotect_entry(file_ptr, type, idx + lag, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); @@ -4090,8 +4149,6 @@ hl_row_major_scan_backward(H5F_t * file_ptr, * Programmer: John Mainzer * 6/23/04 * - * Modifications: - * *------------------------------------------------------------------------- */ |