summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-08-11 21:27:58 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-08-11 21:27:58 (GMT)
commitd20da589dd51cf3fe184bffce8851bd5d032e7f4 (patch)
tree7a04d4ec975064ba805fbc83ed56426ee1ac4469 /src/H5F.c
parent3552beb08b10a9037691905b5dec644428a9ac35 (diff)
downloadhdf5-d20da589dd51cf3fe184bffce8851bd5d032e7f4.zip
hdf5-d20da589dd51cf3fe184bffce8851bd5d032e7f4.tar.gz
hdf5-d20da589dd51cf3fe184bffce8851bd5d032e7f4.tar.bz2
[svn-r22668] Description:
Have free space manager use temporary address space for storing the section info, until the file is flushed or closed. Tested on: Mac OSX/64 10.7.4 (amazon) w/debug, gcc 4.7.x, C++, FORTRAN & threadsafe (h5committest forthcoming)
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 5d13ea6..12c25cd 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1051,13 +1051,15 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush)
* Only try to flush the file if it was opened with write access, and if
* the caller requested a flush.
*/
- if((f->shared->flags & H5F_ACC_RDWR) && flush)
+ if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush)
if(H5F_flush(f, dxpl_id, TRUE) < 0)
+ /* Push error, but keep going*/
HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
/* Release the external file cache */
if(f->shared->efc) {
if(H5F_efc_destroy(f->shared->efc) < 0)
+ /* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't destroy external file cache")
f->shared->efc = NULL;
} /* end if */
@@ -1075,6 +1077,14 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush)
if(H5MF_close(f, dxpl_id) < 0)
/* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file free space info")
+
+ /* Flush the file again (if requested), as shutting down the
+ * free space manager may dirty some data structures again.
+ */
+ if(flush)
+ if(H5F_flush(f, dxpl_id, TRUE) < 0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
} /* end if */
/* Unpin the superblock, since we're about to destroy the cache */