summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Dchunk.c13
-rw-r--r--src/H5Dcompact.c4
-rw-r--r--src/H5Dcontig.c4
-rw-r--r--src/H5Dint.c16
-rw-r--r--src/H5Dpkg.h2
-rw-r--r--src/H5Dprivate.h2
-rw-r--r--src/H5F.c22
-rw-r--r--src/H5FDprivate.h2
-rw-r--r--src/H5Fprivate.h10
9 files changed, 33 insertions, 42 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 736f356..d90f705 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -181,7 +181,7 @@ static herr_t H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type
static herr_t H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t *fm);
-static herr_t H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id, unsigned flags);
+static herr_t H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id, hbool_t closing);
static herr_t H5D_chunk_io_term(const H5D_chunk_map_t *fm);
/* "Nonexistent" layout operation callback */
@@ -1944,7 +1944,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id, unsigned flags)
+H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id, hbool_t closing)
{
H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */
@@ -1969,16 +1969,17 @@ H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id, unsigned flags)
/* Loop over all entries in the chunk cache */
for(ent = rdcc->head; ent; ent = next) {
next = ent->next;
- if((flags & H5F_FLUSH_CLOSING)) {
+ if(closing) {
if(H5D_chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0)
nerrors++;
- } else {
+ } /* end if */
+ else {
if(H5D_chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0)
nerrors++;
- }
+ } /* end else */
} /* end for */
if(nerrors)
- HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index 831ab13..252e0dc 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -69,7 +69,7 @@ static ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info,
static ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]);
-static herr_t H5D_compact_flush(H5D_t *dset, hid_t dxpl_id, unsigned flags);
+static herr_t H5D_compact_flush(H5D_t *dset, hid_t dxpl_id, hbool_t closing);
/*********************/
@@ -347,7 +347,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_compact_flush(H5D_t *dset, hid_t dxpl_id, unsigned UNUSED flags)
+H5D_compact_flush(H5D_t *dset, hid_t dxpl_id, hbool_t UNUSED closing)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index 712b17c..09075f4 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -65,7 +65,7 @@ static herr_t H5D_contig_construct(H5F_t *f, H5D_t *dset);
static herr_t H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t *cm);
-static herr_t H5D_contig_flush(H5D_t *dset, hid_t dxpl_id, unsigned flags);
+static herr_t H5D_contig_flush(H5D_t *dset, hid_t dxpl_id, hbool_t closing);
/* Helper routines */
static herr_t H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset,
@@ -1186,7 +1186,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_contig_flush(H5D_t *dset, hid_t dxpl_id, unsigned UNUSED flags)
+H5D_contig_flush(H5D_t *dset, hid_t dxpl_id, hbool_t UNUSED closing)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 7bdf75d..8789289 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -48,7 +48,7 @@
typedef struct {
const H5F_t *f; /* Pointer to file being flushed */
hid_t dxpl_id; /* DXPL for I/O operations */
- unsigned flags; /* Flags for flush operation */
+ hbool_t closing; /* Whether the file is closing */
} H5D_flush_ud_t;
@@ -66,7 +66,7 @@ static herr_t H5D_init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space)
static herr_t H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset,
hid_t dapl_id);
static herr_t H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id);
-static herr_t H5D_flush_real(H5D_t *dataset, hid_t dxpl_id, unsigned flags);
+static herr_t H5D_flush_real(H5D_t *dataset, hid_t dxpl_id, hbool_t closing);
/*********************/
@@ -1361,7 +1361,7 @@ H5D_close(H5D_t *dataset)
dataset->shared->fo_count--;
if(dataset->shared->fo_count == 0) {
/* Flush the dataset's information */
- if(H5D_flush_real(dataset, H5AC_dxpl_id, H5F_FLUSH_NONE) < 0)
+ if(H5D_flush_real(dataset, H5AC_dxpl_id, FALSE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info")
/* Free the data sieve buffer, if it's been allocated */
@@ -2234,7 +2234,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_flush_real(H5D_t *dataset, hid_t dxpl_id, unsigned flags)
+H5D_flush_real(H5D_t *dataset, hid_t dxpl_id, hbool_t closing)
{
H5O_t *oh = NULL; /* Pointer to dataset's object header */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2278,7 +2278,7 @@ H5D_flush_real(H5D_t *dataset, hid_t dxpl_id, unsigned flags)
/* Flush cached raw data for each kind of dataset layout */
if(dataset->shared->layout.ops->flush &&
- (dataset->shared->layout.ops->flush)(dataset, dxpl_id, flags) < 0)
+ (dataset->shared->layout.ops->flush)(dataset, dxpl_id, closing) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush raw data")
done:
@@ -2319,7 +2319,7 @@ H5D_flush_cb(void *_dataset, hid_t UNUSED id, void *_udata)
/* Check for dataset in same file */
if(udata->f == dataset->oloc.file) {
/* Flush the dataset's information */
- if(H5D_flush_real(dataset, udata->dxpl_id, udata->flags) < 0)
+ if(H5D_flush_real(dataset, udata->dxpl_id, udata->closing) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to flush cached dataset info")
} /* end if */
@@ -2342,7 +2342,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags)
+H5D_flush(const H5F_t *f, hid_t dxpl_id, hbool_t closing)
{
H5D_flush_ud_t udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2355,7 +2355,7 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags)
/* Set user data for callback */
udata.f = f;
udata.dxpl_id = dxpl_id;
- udata.flags = flags;
+ udata.closing = closing;
/* Iterate over all the open datasets */
H5I_search(H5I_DATASET, H5D_flush_cb, &udata, FALSE);
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index df7dd51..4eb565c 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -119,7 +119,7 @@ typedef ssize_t (*H5D_layout_writevv_func_t)(const struct H5D_io_info_t *io_info
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]);
typedef herr_t (*H5D_layout_flush_func_t)(H5D_t *dataset, hid_t dxpl_id,
- unsigned flags);
+ hbool_t closing);
typedef herr_t (*H5D_layout_io_term_func_t)(const struct H5D_chunk_map_t *cm);
/* Typedef for grouping layout I/O routines */
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h
index 4c6ed79..ba8048c 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -162,7 +162,7 @@ H5_DLL herr_t H5D_close(H5D_t *dataset);
H5_DLL H5O_loc_t *H5D_oloc(H5D_t *dataset);
H5_DLL H5G_name_t *H5D_nameof(H5D_t *dataset);
H5_DLL H5T_t *H5D_typeof(const H5D_t *dset);
-H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags);
+H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id, hbool_t closing);
/* Functions that operate on vlen data */
H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id,
diff --git a/src/H5F.c b/src/H5F.c
index 2291a3e..353c0fc 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -72,7 +72,7 @@ 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_flush_real(H5F_t *f, hid_t dxpl_id, unsigned flags);
+static herr_t H5F_flush_real(H5F_t *f, hid_t dxpl_id, hbool_t closing);
static herr_t H5F_close(H5F_t *f);
/* Declare a free list to manage the H5F_t struct */
@@ -1023,7 +1023,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id)
/* Flush all caches and indicate we are closing the file */
/* (The caches should already be clean and we should just be invalidating objects) */
- if(H5F_flush_real(f, dxpl_id, H5F_FLUSH_CLOSING) < 0)
+ if(H5F_flush_real(f, dxpl_id, TRUE) < 0)
/* Push error, but keep going*/
HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
} /* end if */
@@ -1661,7 +1661,7 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope)
} /* end if */
/* Call the "real" flush routine, for this file */
- if(H5F_flush_real(f, dxpl_id, H5F_FLUSH_NONE) < 0)
+ if(H5F_flush_real(f, dxpl_id, FALSE) < 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 */
@@ -1676,9 +1676,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5F_flush_real
*
- * Purpose: Flushes (and optionally invalidates) cached data plus the
- * file superblock. If the logical file size field is zero
- * then it is updated to be the length of the superblock.
+ * Purpose: Flushes (and optionally invalidates) cached data.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1689,7 +1687,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_flush_real(H5F_t *f, hid_t dxpl_id, unsigned flags)
+H5F_flush_real(H5F_t *f, hid_t dxpl_id, hbool_t closing)
{
unsigned H5AC_flags = H5AC__NO_FLAGS_SET; /* Flags for H5AC_flush() */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1700,7 +1698,7 @@ H5F_flush_real(H5F_t *f, hid_t dxpl_id, unsigned flags)
HDassert(f);
/* Flush any cached dataset storage raw data */
- if(H5D_flush(f, dxpl_id, flags) < 0)
+ if(H5D_flush(f, dxpl_id, closing) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache")
/* If we will be closing the file, we should release the free space
@@ -1709,7 +1707,7 @@ H5F_flush_real(H5F_t *f, hid_t dxpl_id, unsigned flags)
* holding some data structures in memory and also because releasing free
* space can shrink the file's 'eoa' value)
*/
- if(flags & H5F_FLUSH_CLOSING) {
+ if(closing) {
/* Shutdown file free space manager(s) */
if(H5MF_close(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file free space info")
@@ -1726,7 +1724,7 @@ H5F_flush_real(H5F_t *f, hid_t dxpl_id, unsigned flags)
} /* end else */
/* Flush (and invalidate, if requested) the entire metadata cache */
- if(flags & H5F_FLUSH_CLOSING) {
+ if(closing) {
H5AC_flags |= H5AC__FLUSH_INVALIDATE_FLAG;
/* Unpin the superblock, since we're about to destroy the cache */
@@ -1743,7 +1741,7 @@ H5F_flush_real(H5F_t *f, hid_t dxpl_id, unsigned flags)
HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush metadata accumulator")
/* Flush file buffers to disk. */
- if(H5FD_flush(f->shared->lf, dxpl_id, (unsigned)((flags & H5F_FLUSH_CLOSING) > 0)) < 0)
+ if(H5FD_flush(f->shared->lf, dxpl_id, closing) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed")
done:
@@ -1954,7 +1952,7 @@ H5F_try_close(H5F_t *f)
*/
if(f->intent&H5F_ACC_RDWR) {
/* Flush all caches */
- if(H5F_flush_real(f, H5AC_dxpl_id, H5F_FLUSH_NONE) < 0)
+ if(H5F_flush_real(f, H5AC_dxpl_id, FALSE) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
} /* end if */
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index 6b2e4fe..fc38566 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -72,7 +72,7 @@ H5_DLL herr_t H5FD_read(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type,
haddr_t addr, size_t size, void *buf/*out*/);
H5_DLL herr_t H5FD_write(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type,
haddr_t addr, size_t size, const void *buf);
-H5_DLL herr_t H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing);
+H5_DLL herr_t H5FD_flush(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
H5_DLL herr_t H5FD_truncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
H5_DLL herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum);
H5_DLL herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle);
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 9a6cdb1..574c4dc 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -28,6 +28,7 @@
/* Private headers needed by this file */
+
/****************************/
/* Library Private Typedefs */
/****************************/
@@ -38,15 +39,6 @@ typedef struct H5F_t H5F_t;
/* Block aggregation structure */
typedef struct H5F_blk_aggr_t H5F_blk_aggr_t;
-/*===----------------------------------------------------------------------===
- * Flush Flags
- *===----------------------------------------------------------------------===
- *
- * Flags passed into the flush routines which indicate what type of
- * flush we want to do. They can be ORed together.
- */
-#define H5F_FLUSH_NONE (0U) /* No flags specified */
-#define H5F_FLUSH_CLOSING (1U << 0) /* Closing the file */
/*
* Encode and decode macros for file meta-data.