From f8884cf6fa006b78b4824a767f9f3a4bcb8b7834 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 2 Jul 2015 12:18:59 -0500 Subject: [svn-r27325] fix some bugs introduced by merger. --- src/H5C.c | 5 ++++- src/H5Fint.c | 2 +- src/H5Fsuper_cache.c | 9 +++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/H5C.c b/src/H5C.c index f7c8202..7141af4 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -7539,6 +7539,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ hbool_t was_dirty; haddr_t new_addr = HADDR_UNDEF; haddr_t old_addr = HADDR_UNDEF; + haddr_t entry_addr; size_t new_len = 0; size_t new_compressed_len = 0; herr_t ret_value = SUCCEED; /* Return value */ @@ -7551,6 +7552,8 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(entry_ptr); + entry_addr = entry_ptr->addr; + /* If defined, initialize *entry_size_change_ptr to 0 */ if(entry_size_change_ptr != NULL) *entry_size_change_ptr = 0; @@ -8144,7 +8147,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ } /* if (destroy) */ if(cache_ptr->log_flush) - if((cache_ptr->log_flush)(cache_ptr, entry_ptr->addr, was_dirty, flags) < 0) + if((cache_ptr->log_flush)(cache_ptr, entry_addr, was_dirty, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed.") done: diff --git a/src/H5Fint.c b/src/H5Fint.c index 8f4f228..cfbb388 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1199,7 +1199,7 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing) if(TRUE == should_truncate) { /* Truncate the file to the current allocated size */ - if(H5FD_truncate(f->shared->lf, dxpl_id, (unsigned)TRUE) < 0) + if(H5FD_truncate(f->shared->lf, dxpl_id, closing) < 0) HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") if(H5F_super_dirty(f) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to mark Super Block dirty") diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 6242d57..5109360 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -106,7 +106,7 @@ const H5AC_class_t H5AC_SUPERBLOCK[1] = {{ H5F__cache_superblock_get_load_size,/* 'get_load_size' callback */ H5F__cache_superblock_deserialize, /* 'deserialize' callback */ H5F__cache_superblock_image_len, /* 'image_len' callback */ - NULL,//H5F__cache_superblock_pre_serialize,/* 'pre_serialize' callback */ + H5F__cache_superblock_pre_serialize,/* 'pre_serialize' callback */ H5F__cache_superblock_serialize, /* 'serialize' callback */ H5F__cache_superblock_notify, /* 'notify' callback */ H5F__cache_superblock_free_icr, /* 'free_icr' callback */ @@ -541,7 +541,6 @@ H5F__cache_superblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, if(H5F_addr_defined(sblock->ext_addr)) { size_t driver_size; /* Size of driver info block (bytes)*/ H5O_loc_t ext_loc; /* "Object location" for superblock extension */ - htri_t exists; /* Status for message existing */ HDassert(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); @@ -897,7 +896,7 @@ H5F__cache_superblock_notify(H5C_notify_action_t action, const H5F_t *f, void *t if(H5O_msg_write(&ext_loc, H5O_EOA_ID, mesg_flags, H5O_UPDATE_TIME, &eoa_msg, dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "unable to update EOA header message") } /* end if */ - +#if 0 /* Check for ignoring the driver info for this file */ if(!H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) { /* Check for driver info message */ @@ -920,7 +919,7 @@ H5F__cache_superblock_notify(H5C_notify_action_t action, const H5F_t *f, void *t HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "unable to update driver info header message") } /* end if */ } /* end if */ - +#endif /* Close the superblock extension object header */ if(H5F_super_ext_close((H5F_t *)f, &ext_loc, dxpl_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") @@ -998,8 +997,6 @@ H5F__cache_drvrinfo_get_load_size(const void H5_ATTR_UNUSED *udata, size_t *imag FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5F__cache_drvrinfo_get_load_size() */ - htri_t exists; /* Status for message existing */ - H5FD_mem_t mt; /*------------------------------------------------------------------------- -- cgit v0.12