summaryrefslogtreecommitdiffstats
path: root/src/H5Dint.c
diff options
context:
space:
mode:
authorFrank Willmore <Frank.Willmore@hdfgroup.org>2016-12-19 18:09:38 (GMT)
committerFrank Willmore <Frank.Willmore@hdfgroup.org>2016-12-19 18:09:38 (GMT)
commitd0a7400a344394f2a17157d2c8250adfbd57e93a (patch)
tree29d1e3be8400846f432656b09d360556d789ed8e /src/H5Dint.c
parenta2e93075f2ec86dad367a8aafadc20f6386f9b0e (diff)
parentab3963b28e59419f8e857ec224dd4efa3ea6dd8e (diff)
downloadhdf5-d0a7400a344394f2a17157d2c8250adfbd57e93a.zip
hdf5-d0a7400a344394f2a17157d2c8250adfbd57e93a.tar.gz
hdf5-d0a7400a344394f2a17157d2c8250adfbd57e93a.tar.bz2
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit 'ab3963b28e59419f8e857ec224dd4efa3ea6dd8e': (214 commits) Merge SWMR-related testing to existing tests. Bring over tweak for missing environment variable. Update CMake configuration files with SWMR accumulator changes. Add missing accumulator test. Merge SWMR-oriented accumulator tests from revise_chunks to develop. Bring Java SWMR changes from revise_chunks to develop branch Snapshot version 1.9 release 235 Change dlopen from RTLD_NOW to RTLD_LAZY Fix bad implementation of Windows nanosleep equivalent. Removed NDEBUG guards from H5AC test functions. Bring SWMR-related tools changes from revise_chunks to develop. Bring over changes from revise_chunks that cleanup recent SWMR changes from code review feedback. Updated the H5FS cache code to grab the correct tag and modified the freespace test to use dxpls that have been tagged with the H5AC__FREESPACE_TAG global tag instead of H5AC_ind_read_dxpl_id. The library code now expects the owner of the free space manager to tag it so the owner-less free space managers in the freespace tag had to be tagged with *something* to avoid cache errors. Updated the comment for the valgrind fix. Fixed a valgrind problem in file shutdown exposed by the swmr.c test. Reduce timeout as normal run time on windows is less then 10 min Updated the icc flags (C flags only). Another Java oversight (sorry, don't have Java configured on my Mac) Correct oversight in Java test and remove direct VFD from SWMR supported drivers. Bring SWMR support in to the main development branch. (Finally!) More tests and the tool and API wrappers will be coming in over the weekend. ...
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r--src/H5Dint.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 8a00be2..5a11581 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -1303,7 +1303,7 @@ done:
if(H5F_addr_defined(new_dset->oloc.addr)) {
if(H5O_dec_rc_by_loc(&(new_dset->oloc), dxpl_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object")
- if(H5O_close(&(new_dset->oloc)) < 0)
+ if(H5O_close(&(new_dset->oloc), NULL) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release object header")
if(file) {
if(H5O_delete(file, dxpl_id, new_dset->oloc.addr) < 0)
@@ -1738,7 +1738,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id)
done:
if(ret_value < 0) {
- if(H5F_addr_defined(dataset->oloc.addr) && H5O_close(&(dataset->oloc)) < 0)
+ if(H5F_addr_defined(dataset->oloc.addr) && H5O_close(&(dataset->oloc), NULL) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header")
if(dataset->shared) {
if(layout_init)
@@ -1780,9 +1780,10 @@ done:
herr_t
H5D_close(H5D_t *dataset)
{
- hbool_t free_failed = FALSE;
- hbool_t corked; /* Whether the dataset is corked or not */
- herr_t ret_value = SUCCEED; /* Return value */
+ hbool_t free_failed = FALSE; /* Set if freeing sub-components failed */
+ hbool_t corked; /* Whether the dataset is corked or not */
+ hbool_t file_closed = TRUE; /* H5O_close also closed the file? */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1797,6 +1798,7 @@ H5D_close(H5D_t *dataset)
dataset->shared->fo_count--;
if(dataset->shared->fo_count == 0) {
+
/* Flush the dataset's information. Continue to close even if it fails. */
if(H5D__flush_real(dataset, H5AC_ind_read_dxpl_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info")
@@ -1891,12 +1893,12 @@ H5D_close(H5D_t *dataset)
(H5O_msg_reset(H5O_FILL_ID, &dataset->shared->dcpl_cache.fill) < 0) ||
(H5O_msg_reset(H5O_EFL_ID, &dataset->shared->dcpl_cache.efl) < 0);
- /* Uncork cache entries with object address tag */
- if(H5AC_cork(dataset->oloc.file, dataset->oloc.addr, H5AC__GET_CORKED, &corked) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status")
- if(corked)
- if(H5AC_cork(dataset->oloc.file, dataset->oloc.addr, H5AC__UNCORK, NULL) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTUNCORK, FAIL, "unable to uncork an object")
+ /* Uncork cache entries with object address tag */
+ if(H5AC_cork(dataset->oloc.file, dataset->oloc.addr, H5AC__GET_CORKED, &corked) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status")
+ if(corked)
+ if(H5AC_cork(dataset->oloc.file, dataset->oloc.addr, H5AC__UNCORK, NULL) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTUNCORK, FAIL, "unable to uncork an object")
/*
* Release datatype, dataspace and creation property list -- there isn't
@@ -1914,9 +1916,17 @@ H5D_close(H5D_t *dataset)
/* Close the dataset object */
/* (This closes the file, if this is the last object open) */
- if(H5O_close(&(dataset->oloc)) < 0)
+ if(H5O_close(&(dataset->oloc), &file_closed) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header")
+ /* Evict dataset metadata if evicting on close */
+ if(!file_closed && H5F_SHARED(dataset->oloc.file) && H5F_EVICT_ON_CLOSE(dataset->oloc.file)) {
+ if(H5AC_flush_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, H5AC_ind_read_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata")
+ if(H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, FALSE, H5AC_ind_read_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata")
+ } /* end if */
+
/*
* Free memory. Before freeing the memory set the file pointer to NULL.
* We always check for a null file pointer in other H5D functions to be
@@ -1924,8 +1934,8 @@ H5D_close(H5D_t *dataset)
* above).
*/
dataset->oloc.file = NULL;
-
dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared);
+
} /* end if */
else {
/* Decrement the ref. count for this object in the top file */
@@ -1934,7 +1944,7 @@ H5D_close(H5D_t *dataset)
/* Check reference count for this object in the top file */
if(H5FO_top_count(dataset->oloc.file, dataset->oloc.addr) == 0) {
- if(H5O_close(&(dataset->oloc)) < 0)
+ if(H5O_close(&(dataset->oloc), NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close")
} /* end if */
else
@@ -1943,16 +1953,16 @@ H5D_close(H5D_t *dataset)
HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "problem attempting to free location")
} /* end else */
- /* Release the dataset's path info */
- if(H5G_name_free(&(dataset->path)) < 0)
- free_failed = TRUE;
+ /* Release the dataset's path info */
+ if(H5G_name_free(&(dataset->path)) < 0)
+ free_failed = TRUE;
/* Free the dataset's memory structure */
dataset = H5FL_FREE(H5D_t, dataset);
/* Check if anything failed in the middle... */
if(free_failed)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't free a component of the dataset, but the dataset was freed anyway.")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't free a component of the dataset, but the dataset was freed anyway.")
done:
FUNC_LEAVE_NOAPI(ret_value)