summaryrefslogtreecommitdiffstats
path: root/src/H5SM.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-10-14 13:16:25 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-10-14 13:16:25 (GMT)
commit22cd1b61cc33d61a705b369f81649b7180ec27a5 (patch)
treea3146c86c11cd99e13e3855e8157fdbeb62fa3d6 /src/H5SM.c
parentc9d37a8e3f4fe142f6beee0a1117d9904659456d (diff)
downloadhdf5-22cd1b61cc33d61a705b369f81649b7180ec27a5.zip
hdf5-22cd1b61cc33d61a705b369f81649b7180ec27a5.tar.gz
hdf5-22cd1b61cc33d61a705b369f81649b7180ec27a5.tar.bz2
[svn-r15861] Description:
Various bug fixes & cleanups with VFDs and file free space changes, along with cleaning up compiler warnings. Enable more VFDs (for 'make check-vfd' testing) for many tests. Tested on: Mac OS X/32 10.5.5 (amazon) in debug mode Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5SM.c')
-rwxr-xr-xsrc/H5SM.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/H5SM.c b/src/H5SM.c
index f782e68..d942399 100755
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -1759,6 +1759,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id)
H5F_file_t *shared = f->shared; /* Shared file info (convenience variable) */
H5O_shmesg_table_t sohm_table; /* SOHM message from superblock extension */
H5SM_master_table_t *table = NULL; /* SOHM master table */
+ htri_t status; /* Status for message existing */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5SM_get_info, FAIL)
@@ -1768,27 +1769,20 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id)
HDassert(f && shared);
HDassert(fc_plist);
- /* Read in shared message information, if it exists */
- if(NULL == H5O_msg_read(ext_loc, H5O_SHMESG_ID, &sohm_table, dxpl_id)) {
- /* Reset error from "failed" message read */
- H5E_clear_stack(NULL);
-
- /* No SOHM info in file */
- shared->sohm_addr = HADDR_UNDEF;
- shared->sohm_nindexes = 0;
- shared->sohm_vers = 0;
-
- /* Shared object header messages are disabled */
- if(H5P_set(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &shared->sohm_nindexes) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set number of SOHM indexes")
- } /* end if */
- else {
+ /* Check for the extension having a 'shared message info' message */
+ if((status = H5O_msg_exists(ext_loc, H5O_SHMESG_ID, dxpl_id)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to read object header")
+ if(status) {
unsigned index_flags[H5O_SHMESG_MAX_NINDEXES]; /* Message flags for each index */
unsigned minsizes[H5O_SHMESG_MAX_NINDEXES]; /* Minimum message size for each index */
unsigned sohm_l2b; /* SOHM list-to-btree cutoff */
unsigned sohm_b2l; /* SOHM btree-to-list cutoff */
unsigned u; /* Local index variable */
+ /* Retrieve the 'shared message info' structure */
+ if(NULL == H5O_msg_read(ext_loc, H5O_SHMESG_ID, &sohm_table, dxpl_id))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "shared message info message not present")
+
/* Portably initialize the arrays */
HDmemset(index_flags, 0, sizeof(index_flags));
HDmemset(minsizes, 0, sizeof(minsizes));
@@ -1836,6 +1830,16 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set SOHM cutoff in property list")
if(H5P_set(fc_plist, H5F_CRT_SHMSG_BTREE_MIN_NAME, &sohm_b2l) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set SOHM cutoff in property list")
+ } /* end if */
+ else {
+ /* No SOHM info in file */
+ shared->sohm_addr = HADDR_UNDEF;
+ shared->sohm_nindexes = 0;
+ shared->sohm_vers = 0;
+
+ /* Shared object header messages are disabled */
+ if(H5P_set(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &shared->sohm_nindexes) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set number of SOHM indexes")
} /* end else */
done: