summaryrefslogtreecommitdiffstats
path: root/testpar/t_cache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-06 14:19:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-06 14:19:28 (GMT)
commitb95c7d1879120c542490c031c70b88f6e5fa7eaa (patch)
treea5f2c84b23c43eb342220d811d2b9d4f69fb738b /testpar/t_cache.c
parent2c38d7ea30aa8829eb7790f7aa25b16dee93fb8f (diff)
downloadhdf5-b95c7d1879120c542490c031c70b88f6e5fa7eaa.zip
hdf5-b95c7d1879120c542490c031c70b88f6e5fa7eaa.tar.gz
hdf5-b95c7d1879120c542490c031c70b88f6e5fa7eaa.tar.bz2
[svn-r18722] Description:
Bring r18721 from trunk to 1.8 branch: Bring r18720 from metadata journaling merging branch to trunk: Bring changes from metadata journaling branch to 'merging' branch: Rename H5[A]C_mark_pinned_or_protected_entry_dirty() to H5[A]C_mark_entry_dirty() and get rid of H5[A]C_mark_pinned_entry_dirty(). Tested on: FreeBSD/32 6.3 (duty) in debug mode (h5committested on trunk)
Diffstat (limited to 'testpar/t_cache.c')
-rw-r--r--testpar/t_cache.c110
1 files changed, 22 insertions, 88 deletions
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 5639e59..6430ecb 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -359,8 +359,8 @@ void lock_and_unlock_random_entries(H5C_t * cache_ptr, H5F_t * file_ptr,
void lock_and_unlock_random_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
int min_idx, int max_idx);
void lock_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx);
-void mark_pinned_entry_dirty(int32_t idx, hbool_t size_changed, size_t new_size);
-void mark_pinned_or_protected_entry_dirty(int32_t idx);
+void mark_entry_dirty(H5C_t * cache_ptr, H5F_t * file_ptr,
+ int32_t idx);
void pin_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx,
hbool_t global, hbool_t dirty);
void pin_protected_entry(int32_t idx, hbool_t global);
@@ -2762,7 +2762,7 @@ lock_entry(H5C_t * cache_ptr,
/*****************************************************************************
- * Function: mark_pinned_entry_dirty()
+ * Function: mark_entry_dirty()
*
* Purpose: Mark dirty the entry indicated by the index,
*
@@ -2773,21 +2773,21 @@ lock_entry(H5C_t * cache_ptr,
* Programmer: John Mainzer
* 4/14/06
*
- * Modifications:
- *
*****************************************************************************/
void
-mark_pinned_entry_dirty(int32_t idx,
- hbool_t size_changed,
- size_t new_size)
+mark_entry_dirty(H5C_t * cache_ptr,
+ H5F_t * file_ptr,
+ int32_t idx)
{
- const char * fcn_name = "mark_pinned_entry_dirty()";
+ const char * fcn_name = "mark_entry_dirty()";
herr_t result;
struct datum * entry_ptr;
if ( nerrors == 0 ) {
+ HDassert( file_ptr );
+ HDassert( cache_ptr );
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
HDassert( idx < virt_num_data_entries );
@@ -2799,16 +2799,14 @@ mark_pinned_entry_dirty(int32_t idx,
(entry_ptr->ver)++;
entry_ptr->dirty = TRUE;
- result = H5AC_mark_pinned_entry_dirty((void *)entry_ptr,
- size_changed,
- new_size);
+ result = H5AC_mark_entry_dirty( (void *)entry_ptr);
if ( result < 0 ) {
nerrors++;
if ( verbose ) {
HDfprintf(stdout,
- "%d:%s: error in H5AC_mark_pinned_entry_dirty().\n",
+ "%d:%s: error in H5AC_mark_entry_dirty().\n",
world_mpi_rank, fcn_name);
}
}
@@ -2820,65 +2818,7 @@ mark_pinned_entry_dirty(int32_t idx,
return;
-} /* mark_pinned_entry_dirty() */
-
-
-/*****************************************************************************
- * Function: mark_pinned_or_protected_entry_dirty()
- *
- * Purpose: Use the H5AC_mark_pinned_or_protected_entry_dirty() call to
- * mark dirty the entry indicated by the index,
- *
- * Do nothing if nerrors is non-zero on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 5/18/06
- *
- * Modifications:
- *
- *****************************************************************************/
-
-void
-mark_pinned_or_protected_entry_dirty(int32_t idx)
-{
- const char * fcn_name = "mark_pinned_or_protected_entry_dirty()";
- herr_t result;
- struct datum * entry_ptr;
-
- if ( nerrors == 0 ) {
-
- HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
- HDassert( idx < virt_num_data_entries );
-
- entry_ptr = &(data[idx]);
-
- HDassert ( entry_ptr->locked || entry_ptr->global_pinned );
-
- (entry_ptr->ver)++;
- entry_ptr->dirty = TRUE;
-
- result = H5AC_mark_pinned_or_protected_entry_dirty((void *)entry_ptr);
-
- if ( result < 0 ) {
-
- nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: error in %s.\n",
- world_mpi_rank, fcn_name,
- "H5AC_mark_pinned_or_protected_entry_dirty()");
- }
- }
- else if ( ! ( entry_ptr->locked ) )
- {
- global_dirty_pins++;
- }
- }
-
- return;
-
-} /* mark_pinned_or_protected_entry_dirty() */
+} /* mark_entry_dirty() */
/*****************************************************************************
@@ -3751,7 +3691,7 @@ unpin_entry(H5C_t * cache_ptr,
if ( dirty ) {
- mark_pinned_entry_dirty(idx, FALSE, (size_t)0);
+ mark_entry_dirty(cache_ptr, file_ptr, idx);
}
@@ -5080,8 +5020,7 @@ smoke_check_4(void)
* Function: smoke_check_5()
*
* Purpose: Similar to smoke check 1, but modified to verify that
- * H5AC_mark_pinned_or_protected_entry_dirty() works in
- * the parallel case.
+ * H5AC_mark_entry_dirty() works in the parallel case.
*
* Return: Success: TRUE
*
@@ -5199,7 +5138,7 @@ smoke_check_5(void)
if ( i % 2 == 0 )
{
- mark_pinned_or_protected_entry_dirty(i);
+ mark_entry_dirty(cache_ptr, file_ptr, i);
}
unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
@@ -5235,13 +5174,9 @@ smoke_check_5(void)
}
if ( i % 4 == 0 )
- {
- mark_pinned_or_protected_entry_dirty(i);
- }
+ mark_entry_dirty(cache_ptr, file_ptr, i);
else
- {
- mark_pinned_entry_dirty(i, FALSE, (size_t)0);
- }
+ mark_entry_dirty(cache_ptr, file_ptr, i);
if ( i % 8 <= 4 ) {
@@ -5361,8 +5296,7 @@ smoke_check_5(void)
*
* - H5AC_flush()
* - H5AC_set()
- * - H5AC_mark_pinned_entry_dirty()
- * - H5AC_mark_pinned_or_protected_entry_dirty()
+ * - H5AC_mark_entry_dirty()
* H5AC_rename()
* - H5AC_pin_protected_entry()
* - H5AC_protect()
@@ -5405,7 +5339,7 @@ trace_file_check(void)
"H5AC_set 0x4 15 0x0 4 0\n",
"H5AC_set 0x8 15 0x0 6 0\n",
"H5AC_protect 0 15 H5AC_WRITE 2 1\n",
- "H5AC_mark_pinned_or_protected_entry_dirty 0 0\n",
+ "H5AC_mark_entry_dirty 0 0\n",
"H5AC_unprotect 0 15 0 0 0\n",
"H5AC_protect 2 15 H5AC_WRITE 2 1\n",
"H5AC_pin_protected_entry 2 0\n",
@@ -5415,7 +5349,7 @@ trace_file_check(void)
"H5AC_protect 4 15 H5AC_WRITE 4 1\n",
"H5AC_pin_protected_entry 4 0\n",
"H5AC_unprotect 4 15 0 0 0\n",
- "H5AC_mark_pinned_entry_dirty 0x4 0 0 0\n",
+ "H5AC_mark_entry_dirty 0x4 0 0 0\n",
"H5AC_resize_pinned_entry 0x4 2 0\n",
"H5AC_resize_pinned_entry 0x4 4 0\n",
"H5AC_unpin_entry 4 0\n",
@@ -5511,7 +5445,7 @@ trace_file_check(void)
insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET);
lock_entry(cache_ptr, file_ptr, 0);
- mark_pinned_or_protected_entry_dirty(0);
+ mark_entry_dirty(cache_ptr, file_ptr, 0);
unlock_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET);
lock_entry(cache_ptr, file_ptr, 1);
@@ -5524,7 +5458,7 @@ trace_file_check(void)
lock_entry(cache_ptr, file_ptr, 2);
pin_protected_entry(2, TRUE);
unlock_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET);
- mark_pinned_entry_dirty(2, FALSE, 0);
+ mark_entry_dirty(cache_ptr, file_ptr, 2);
resize_entry(2, data[2].len / 2);
resize_entry(2, data[2].len);
unpin_entry(cache_ptr, file_ptr, 2, TRUE, FALSE, FALSE);