summaryrefslogtreecommitdiffstats
path: root/src/H5FD.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-03-19 17:02:23 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-03-19 17:02:23 (GMT)
commitd317b8b404bea67439bf9dbb8565f5532d69aa1a (patch)
tree9a1f0dc90bfcd195f4be93088b8c25b76d54fd74 /src/H5FD.c
parente10de8f3d65bd8ad0ef5484a56f1a9807693a967 (diff)
downloadhdf5-d317b8b404bea67439bf9dbb8565f5532d69aa1a.zip
hdf5-d317b8b404bea67439bf9dbb8565f5532d69aa1a.tar.gz
hdf5-d317b8b404bea67439bf9dbb8565f5532d69aa1a.tar.bz2
[svn-r6496] Purpose:
Refactoring of Flush Logic Description: The Flushing logic passed in multiple flags to indicate what type of flush it was: closing, invalidate, alloc only. This made extending the function of the flush logic to handle other flags annoying. Solution: I changed it to be just one bitmasked flag to indicate what type of flushing to do. I also added the CLEAR_ONLY flag, which will be used in the FPHDF5 stuff. Platforms tested: h5committest doesn't work for me (my environment isn't setup on the other machines I guess). I tested it manually: Linux parallel & C++ Sol Fortran Modi4 parallel & Fortran.
Diffstat (limited to 'src/H5FD.c')
-rw-r--r--src/H5FD.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 3fe75cc..4c01663 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -3202,7 +3202,7 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, unsigned closing)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list");
/* Do the real work */
- if (H5FD_flush(file,dxpl_id,closing)<0)
+ if (H5FD_flush(file, dxpl_id, closing ? H5_FLUSH_CLOSING : H5_FLUSH_NONE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file flush request failed");
done:
@@ -3226,10 +3226,14 @@ done:
* Quincey Koziol, May 20, 2002
* Added 'closing' parameter
*
+ * Bill Wendling, March 18, 2003
+ * Changed closing flag to FLAGS so that more than just one
+ * can be supported.
+ *
*-------------------------------------------------------------------------
*/
herr_t
-H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing)
+H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned flags)
{
herr_t ret_value=SUCCEED; /* Return value */
@@ -3248,8 +3252,11 @@ H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing)
file->accum_dirty=FALSE;
} /* end if */
- if (file->cls->flush && (file->cls->flush)(file,dxpl_id,closing)<0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver flush request failed");
+ if ((flags & H5_FLUSH_CLEAR_ONLY) == 0)
+ /* Flush only if we're not clearing the dirty bits in the caches */
+ if (file->cls->flush &&
+ (file->cls->flush)(file, dxpl_id, flags & H5_FLUSH_CLOSING)<0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver flush request failed");
done:
FUNC_LEAVE_NOAPI(ret_value);