summaryrefslogtreecommitdiffstats
path: root/src/H5C2.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2008-07-14 11:38:42 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2008-07-14 11:38:42 (GMT)
commit15a8348003deaebaa6405f0ab223944bffa2d1d1 (patch)
tree8dab83ebe4519ff7da2bbb5ea199209cdace1be6 /src/H5C2.c
parent97f51bfde14d16893b9556216e643a34f751b5f1 (diff)
downloadhdf5-15a8348003deaebaa6405f0ab223944bffa2d1d1.zip
hdf5-15a8348003deaebaa6405f0ab223944bffa2d1d1.tar.gz
hdf5-15a8348003deaebaa6405f0ab223944bffa2d1d1.tar.bz2
[svn-r15348] Checking in a collection of bug fixes and added test code -- specifically:
1) Fix for failure to detect journaling in progress on HDF5 files which were not closed correctly. Also associated test code. Note that this required addition of code to test for journaling in progress and enable journaling at the end of H5F_flush(). In passing, I was able to get rid of the wacky code that queued journaling setup at cache creation time. 2) Test code for startup and shutdown of journaling on an open file. 3) Updates to start checking journal output against architype files instead of just generating architypes at test time. Note that per Quincey's request, I have checked in gziped versions of the architype files. At some point, we will have to add code to automatically unzip these files, but for the time being you will have to go to test/testfiles and "gunzip *.gz". The journal tests will still pass if you don't, but you will get a warning about missing test files. 4) Fixed bug in journal entry logging code that allowed a comment to appear in the journal file before the journal file header. (Mike M,: Please review my fix to verify that I haven't clobbered anything.) 5) Additional test code. Note that more test code would be a good idea, but this set of bug fixes should be enough to get us through the basic demo -- at least as far as the metadata cache is concerned. Tested serial on Phoenix, and parallel on Kagiso. Also, tested serial on Linew just prior to some last minute minor edits.
Diffstat (limited to 'src/H5C2.c')
-rw-r--r--src/H5C2.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/src/H5C2.c b/src/H5C2.c
index bf571e8..f261e08 100644
--- a/src/H5C2.c
+++ b/src/H5C2.c
@@ -434,21 +434,23 @@ done:
* journaling in progress, and fail if it does unless
* the journal_recovered parameter is TRUE.
*
+ * JRM -- 7/10/08
+ * Removed the f, dxpl_id, and journal_recovered parameters,
+ * as checking for journaling in progress is no longer handled
+ * in H5C2_create().
+ *
*-------------------------------------------------------------------------
*/
H5C2_t *
-H5C2_create(H5F_t * f,
- hid_t dxpl_id,
- 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),
H5C2_write_permitted_func_t check_write_permitted,
hbool_t write_permitted,
H5C2_log_flush_func_t log_flush,
- void * aux_ptr,
- hbool_t journal_recovered)
+ void * aux_ptr)
{
int i;
H5C2_t * cache_ptr = NULL;
@@ -648,16 +650,6 @@ H5C2_create(H5F_t * f,
cache_ptr->jwipl_head_ptr = NULL;
cache_ptr->jwipl_tail_ptr = NULL;
- cache_ptr->mdj_startup_pending = FALSE;
- cache_ptr->mdj_startup_f = NULL;
- cache_ptr->mdj_startup_dxpl_id = -1;
- cache_ptr->mdj_startup_jrnl_file_name = NULL;
- cache_ptr->mdj_startup_buf_size = 0;
- cache_ptr->mdj_startup_num_bufs = 0;
- cache_ptr->mdj_startup_use_aio = FALSE;
- cache_ptr->mdj_startup_human_readable = FALSE;
-
-
if ( H5C2_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) {
/* this should be impossible... */
@@ -671,19 +663,17 @@ H5C2_create(H5F_t * f,
cache_ptr->skip_dxpl_id_checks = FALSE;
cache_ptr->prefix[0] = '\0'; /* empty string */
- /* test to see if there is a metadata journal that must be recovered
- * before we can access the file. Do this now after the cache is
- * initialized, as the code for this test assumes a functional
- * cache.
+ /* We used to check for journaling here, but the super block hasn't
+ * been read in yet at cache creation time -- thus the check for
+ * journaling has been moved to H5AC2_check_for_journaling(), which
+ * is simply a * wrapper for H5C2_check_for_journaling().
+ *
+ * H5AC2_check_for_journaling() is called at the end of H5Fopen() --
+ * at which point the superblock has been read.
+ *
+ * Note that H5Fopen() is called by both H5Fcreate() and H5Fopen().
*/
- if ( H5C2_check_for_journaling(f, dxpl_id, cache_ptr, journal_recovered)
- != SUCCEED ) {
-
- HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, \
- "H5C2_check_for_journaling() reports failure.")
- }
-
/* Set return value */
ret_value = cache_ptr;
@@ -947,6 +937,15 @@ H5C2_dest(H5F_t * f,
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC );
+ if ( cache_ptr->mdj_enabled ) {
+
+ if ( H5C2_end_journaling(f, dxpl_id, cache_ptr) != SUCCEED ) {
+
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
+ "H5C2_end_journaling() failed.")
+ }
+ }
+
if ( H5C2_flush_cache(f, dxpl_id,
H5C2__FLUSH_INVALIDATE_FLAG) < 0 ) {