summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-03-19 18:58:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-03-19 18:58:54 (GMT)
commita52914987ebff61d0347172e11520af02a5a6b4f (patch)
tree2bfce5cf8f4a54dfb07b5e1a6a13c3404237722f /src/H5F.c
parentd317b8b404bea67439bf9dbb8565f5532d69aa1a (diff)
downloadhdf5-a52914987ebff61d0347172e11520af02a5a6b4f.zip
hdf5-a52914987ebff61d0347172e11520af02a5a6b4f.tar.gz
hdf5-a52914987ebff61d0347172e11520af02a5a6b4f.tar.bz2
[svn-r6497] Purpose:
Finish code cleanup Description: Wrap up the conversion of H5F_flush's multiple boolean flags into a single bitfield of flags by pushing the flags down into the H5AC_flush and H5F_istore_flush routines. Also, changed the flags from H5_FLUSH_<foo> to H5F_FLUSH_<foo> to be more consistent with rest of library. And reverted the changes to H5FDflush and H5FD_flush routines. Platforms tested: FreeBSD 4.7 (sleipnir) Solaris 5.8 (sol) IRIX64 6.5 (modi4) w/parallel Misc. update:
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/H5F.c b/src/H5F.c
index aab9d64..fdca262 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -674,7 +674,7 @@ H5F_flush_all_cb(H5F_t *f, hid_t UNUSED fid, const void *_invalidate)
FUNC_ENTER_NOINIT(H5F_flush_all_cb);
- H5F_flush(f, H5F_SCOPE_LOCAL, (invalidate ? H5_FLUSH_INVALIDATE : H5_FLUSH_NONE));
+ H5F_flush(f, H5F_SCOPE_LOCAL, (invalidate ? H5F_FLUSH_INVALIDATE : H5F_FLUSH_NONE));
FUNC_LEAVE_NOAPI(0);
}
@@ -1894,7 +1894,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
shared->base_addr = shared->boot_addr;
shared->consist_flags = 0x03;
- if (H5F_flush(file, dxpl_id, H5F_SCOPE_LOCAL, H5_FLUSH_ALLOC_ONLY) < 0)
+ if (H5F_flush(file, dxpl_id, H5F_SCOPE_LOCAL, H5F_FLUSH_ALLOC_ONLY) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to write file superblock");
/* Create and open the root group */
@@ -2379,7 +2379,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "object is not associated with a file");
/* Flush the file */
- if (H5F_flush(f, H5AC_dxpl_id, scope, H5_FLUSH_NONE) < 0)
+ if (H5F_flush(f, H5AC_dxpl_id, scope, H5F_FLUSH_NONE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "flush failed");
done:
@@ -2483,11 +2483,11 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags)
for (i = 0; i < f->mtab.nmounts; i++)
/* Flush but don't pass down the ALLOC_ONLY flag if there */
if (H5F_flush(f->mtab.child[i].file, dxpl_id, scope,
- flags & ~H5_FLUSH_ALLOC_ONLY) < 0)
+ flags & ~H5F_FLUSH_ALLOC_ONLY) < 0)
nerrors++;
/* Avoid flushing buffers & caches when alloc_only set */
- if ((flags & H5_FLUSH_ALLOC_ONLY) == 0) {
+ if ((flags & H5F_FLUSH_ALLOC_ONLY) == 0) {
/* flush any cached compact storage raw data */
if (H5D_flush(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache");
@@ -2498,7 +2498,7 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags)
* metadata and "small data" blocks back to the free lists in the
* file.
*/
- if (flags & H5_FLUSH_INVALIDATE) {
+ if (flags & H5F_FLUSH_INVALIDATE) {
if (f->shared->lf->feature_flags & H5FD_FEAT_AGGREGATE_METADATA) {
/* Return the unused portion of the metadata block to a free list */
if (f->shared->lf->eoma != 0)
@@ -2541,11 +2541,11 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags)
} /* end if */
/* flush the entire raw data cache */
- if (H5F_istore_flush(f, dxpl_id, flags & H5_FLUSH_INVALIDATE) < 0)
+ if (H5F_istore_flush(f, dxpl_id, flags & (H5F_FLUSH_INVALIDATE|H5F_FLUSH_CLEAR_ONLY)) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush raw data cache");
/* flush (and invalidate) the entire meta data cache */
- if (H5AC_flush(f, dxpl_id, NULL, HADDR_UNDEF, flags & H5_FLUSH_INVALIDATE) < 0)
+ if (H5AC_flush(f, dxpl_id, NULL, HADDR_UNDEF, flags & (H5F_FLUSH_INVALIDATE|H5F_FLUSH_CLEAR_ONLY)) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush meta data cache");
} /* end if */
@@ -2619,7 +2619,7 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags)
assert(driver_size<=sizeof(dbuf));
} /* end if */
- if (flags & H5_FLUSH_ALLOC_ONLY) {
+ if (flags & H5F_FLUSH_ALLOC_ONLY) {
haddr_t addr;
/*
@@ -2689,9 +2689,9 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags)
} /* end else */
/* If we're not just allocating... */
- if ((flags & H5_FLUSH_ALLOC_ONLY) == 0)
+ if ((flags & H5F_FLUSH_ALLOC_ONLY) == 0)
/* ...flush file buffers to disk. */
- if (H5FD_flush(f->shared->lf, dxpl_id, flags) < 0)
+ if (H5FD_flush(f->shared->lf, dxpl_id, (flags&H5F_FLUSH_CLOSING)>0) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed");
/* Check flush errors for children - errors are already on the stack */
@@ -2894,7 +2894,7 @@ H5F_close(H5F_t *f)
/* Flush and destroy all caches */
if (H5F_flush(f, H5AC_dxpl_id, H5F_SCOPE_LOCAL,
- H5_FLUSH_INVALIDATE | H5_FLUSH_CLOSING) < 0)
+ H5F_FLUSH_INVALIDATE | H5F_FLUSH_CLOSING) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache");
} /* end if */