summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-06-15 18:55:59 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-06-15 18:55:59 (GMT)
commit75aa26981b4becc6926f4100707d9614e84a041c (patch)
tree5b2be7e3509907340ab99f272ba50d5e7cac98ac /src/H5Fint.c
parent77a223347552ceb2029c1d2677f7aec4d3cd6684 (diff)
downloadhdf5-75aa26981b4becc6926f4100707d9614e84a041c.zip
hdf5-75aa26981b4becc6926f4100707d9614e84a041c.tar.gz
hdf5-75aa26981b4becc6926f4100707d9614e84a041c.tar.bz2
[svn-r30084] First pass at the evict-on-close feature.
The features is controlled via H5Pset/get_evict_on_close() and is currently enabled by default (it will be disabled by default in the final implementation). There is a bug in the code where the eviction of tagged metadata fails due to some of the metadata being dirty, resulting in error return values and test failures.
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 80c593b..5b7fdda 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -954,6 +954,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
H5FD_class_t *drvr; /*file driver class info */
H5P_genplist_t *a_plist; /*file access property list */
H5F_close_degree_t fc_degree; /*file close degree */
+ hbool_t evict_on_close; /* evict on close value from plist */
H5F_t *ret_value = NULL; /*actual return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1118,6 +1119,21 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "file close degree doesn't match")
} /* end if */
+ /* Record the evict-on-close MDC behavior. If it's the first time opening
+ * the file, set it to access property list value; if it's the second time
+ * or later, verify that the access property list value matches the value
+ * in shared file structure.
+ */
+ if(H5P_get(a_plist, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, &evict_on_close) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get evict on close value")
+
+ if(shared->nrefs == 1) {
+ shared->evict_on_close = evict_on_close;
+ } else if(shared->nrefs > 1) {
+ if(shared->evict_on_close != evict_on_close)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "file evict-on-close value doesn't match")
+ } /* end if */
+
/* Formulate the absolute path for later search of target file for external links */
if(H5_build_extpath(name, &file->extpath) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to build extpath")