summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5F.c80
-rw-r--r--src/H5Fmount.c2
-rw-r--r--src/H5Fpkg.h2
-rw-r--r--src/H5Fpublic.h3
-rw-r--r--src/H5trace.c4
5 files changed, 29 insertions, 62 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 1c77122..6ae0759 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -71,7 +71,6 @@ static herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void** file_hand
static H5F_t *H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id,
H5FD_t *lf);
static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id);
-static herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope);
static herr_t H5F_close(H5F_t *f);
/* Declare a free list to manage the H5F_t struct */
@@ -1615,12 +1614,21 @@ H5Fflush(hid_t object_id, H5F_scope_t scope)
* Nothing to do if the file is read only. This determination is
* made at the shared open(2) flags level, implying that opening a
* file twice, once for read-only and once for read-write, and then
- * calling H5F_flush() with the read-only handle, still causes data
+ * calling H5Fflush() with the read-only handle, still causes data
* to be flushed.
*/
if(H5F_ACC_RDWR & f->shared->flags) {
- if(H5F_flush(f, H5AC_dxpl_id, scope) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "flush failed")
+ /* Flush other files, depending on scope */
+ if(H5F_SCOPE_GLOBAL == scope) {
+ /* Call the flush routine for mounted file hierarchies */
+ if(H5F_flush_mounts(f, H5AC_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy")
+ } /* end if */
+ else {
+ /* Call the flush routine, for this file */
+ if(H5F_flush(f, H5AC_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information")
+ } /* end else */
} /* end if */
done:
@@ -1631,47 +1639,6 @@ done:
/*-------------------------------------------------------------------------
* Function: H5F_flush
*
- * Purpose: Flushes cached data, possibly in all mounted files,
- * depending on the SCOPE.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 29 1997
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT(H5F_flush)
-
- /* Sanity check arguments */
- HDassert(f);
-
- /* Flush other files, depending on scope */
- if(H5F_SCOPE_GLOBAL == scope) {
- /* Call the flush routine for mounted file hierarchies */
- if(H5F_flush_mounts(f, dxpl_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy")
- } /* end if */
- else {
- /* Call the "real" flush routine, for this file */
- if(H5F_flush_real(f, dxpl_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information")
- } /* end else */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_flush() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5F_flush_real
- *
* Purpose: Flushes cached data.
*
* Return: Non-negative on success/Negative on failure
@@ -1683,18 +1650,19 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F_flush_real(H5F_t *f, hid_t dxpl_id)
+H5F_flush(H5F_t *f, hid_t dxpl_id)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5F_flush_real, FAIL)
+ FUNC_ENTER_NOAPI(H5F_flush, FAIL)
/* Sanity check arguments */
HDassert(f);
/* Flush any cached dataset storage raw data */
if(H5D_flush(f, dxpl_id) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache")
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache")
/* Release any space allocated to space aggregators, so that the eoa value
* corresponds to the end of the space written to in the file.
@@ -1703,23 +1671,27 @@ H5F_flush_real(H5F_t *f, hid_t dxpl_id)
* 'eoa' value is written in superblock -QAK)
*/
if(H5MF_free_aggrs(f, dxpl_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file space")
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file space")
/* Flush the entire metadata cache */
if(H5AC_flush(f, dxpl_id) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache")
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache")
/* Flush out the metadata accumulator */
if(H5F_accum_flush(f, dxpl_id) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush metadata accumulator")
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush metadata accumulator")
/* Flush file buffers to disk. */
if(H5FD_flush(f->shared->lf, dxpl_id, FALSE) < 0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed")
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_flush_real() */
+} /* end H5F_flush() */
/*-------------------------------------------------------------------------
@@ -1925,7 +1897,7 @@ H5F_try_close(H5F_t *f)
*/
if(f->intent&H5F_ACC_RDWR) {
/* Flush all caches */
- if(H5F_flush_real(f, H5AC_dxpl_id) < 0)
+ if(H5F_flush(f, H5AC_dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
} /* end if */
diff --git a/src/H5Fmount.c b/src/H5Fmount.c
index 0d26edf..f70a7c6 100644
--- a/src/H5Fmount.c
+++ b/src/H5Fmount.c
@@ -658,7 +658,7 @@ H5F_flush_mounts_recurse(H5F_t *f, hid_t dxpl_id)
nerrors++;
/* Call the "real" flush routine, for this file */
- if(H5F_flush_real(f, dxpl_id) < 0)
+ if(H5F_flush(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information")
/* Check flush errors for children - errors are already on the stack */
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 0b4c9be..37ad094 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -288,7 +288,7 @@ H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1];
/* General routines */
H5_DLL herr_t H5F_init(void);
H5_DLL haddr_t H5F_locate_signature(H5FD_t *file, hid_t dxpl_id);
-H5_DLL herr_t H5F_flush_real(H5F_t *f, hid_t dxpl_id);
+H5_DLL herr_t H5F_flush(H5F_t *f, hid_t dxpl_id);
/* File mount related routines */
H5_DLL herr_t H5F_close_mounts(H5F_t *f);
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index e23ad2d..20814b6 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -79,8 +79,7 @@
/* The difference between a single file and a set of mounted files */
typedef enum H5F_scope_t {
H5F_SCOPE_LOCAL = 0, /*specified file handle only */
- H5F_SCOPE_GLOBAL = 1, /*entire virtual file */
- H5F_SCOPE_DOWN = 2 /*for internal use only */
+ H5F_SCOPE_GLOBAL = 1 /*entire virtual file */
} H5F_scope_t;
/* Unlimited file size for H5Pset_external() */
diff --git a/src/H5trace.c b/src/H5trace.c
index 172a7f7..5f1e128 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -674,10 +674,6 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5F_SCOPE_GLOBAL:
fprintf(out, "H5F_SCOPE_GLOBAL");
break;
- case H5F_SCOPE_DOWN:
- fprintf(out, "H5F_SCOPE_DOWN "
- "/*FOR INTERNAL USE ONLY!*/");
- break;
default:
fprintf(out, "%ld", (long)scope);
break;