summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
authorMike McGreevy <mamcgree@hdfgroup.org>2010-06-15 20:00:22 (GMT)
committerMike McGreevy <mamcgree@hdfgroup.org>2010-06-15 20:00:22 (GMT)
commit60ecd356b2e24f125a5fd7abbdb57569af76f3ba (patch)
treed5f77e77b2f5d62529e98101ed7af65d0dcd3650 /src/H5AC.c
parent84f6de6f28553171029bc61560eb869bc2207fa2 (diff)
downloadhdf5-60ecd356b2e24f125a5fd7abbdb57569af76f3ba.zip
hdf5-60ecd356b2e24f125a5fd7abbdb57569af76f3ba.tar.gz
hdf5-60ecd356b2e24f125a5fd7abbdb57569af76f3ba.tar.bz2
[svn-r19005] Purpose:
Commit metadata tagging framework. Description: This check-in contains a new framework whose goal is to apply a tag value to each new entry in the metadata cache as it is created. This tag value is such that it relates each piece of metadata to the HDF5 object that it belongs to (dataset, group, et cetera). This changeset includes the framework that applies the tags as well as a suite of tests to verify correct tag application, though does not yet make use of the tag values to flush/evict individual objects. Please refer to the "flush/evict individual objects" RFC for further discussion of these changes. Tested: jam, amani, linew (h5committest) liberty, abe, blue print
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c126
1 files changed, 126 insertions, 0 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index e3994e5..6c88e44 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -4037,3 +4037,129 @@ done:
} /* H5AC_flush_entries() */
#endif /* H5_HAVE_PARALLEL */
+
+/*------------------------------------------------------------------------------
+ * Function: H5AC_ignore_tags()
+ *
+ * Purpose: Override all assertion frameworks and force application of
+ * global tag everywhere. This should really only be used in the
+ * tests that need to access functions without going through
+ * API paths.
+ *
+ * Return: SUCCEED on success, FAIL otherwise.
+ *
+ * Programmer: Mike McGreevy
+ * December 1, 2009
+ *
+ *------------------------------------------------------------------------------
+ */
+herr_t
+H5AC_ignore_tags(H5F_t * f)
+{
+ /* Variable Declarations */
+ H5AC_t * cache_ptr = NULL;
+ herr_t ret_value = SUCCEED;
+
+ /* Function Enter Macro */
+ FUNC_ENTER_NOAPI(H5AC_ignore_tags, FAIL)
+
+ /* Assertions */
+ HDassert(f);
+ HDassert(f->shared);
+ HDassert(f->shared->cache);
+
+ /* Get cache pointer */
+ cache_ptr = f->shared->cache;
+
+ /* Set up a new metadata tag */
+ if (H5C_ignore_tags(cache_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed.")
+
+done:
+
+ /* Function Leave Macro */
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5AC_ignore_tags() */
+
+
+/*------------------------------------------------------------------------------
+ * Function: H5AC_tag()
+ *
+ * Purpose: Sets the metadata tag property in the provided property list.
+ *
+ * Return: SUCCEED on success, FAIL otherwise.
+ *
+ * Programmer: Mike McGreevy
+ * December 1, 2009
+ *
+ *------------------------------------------------------------------------------
+ */
+herr_t
+H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t * prev_tag)
+{
+ /* Variable Declarations */
+ H5P_genplist_t *dxpl; /* dataset transfer property list */
+ herr_t ret_value = SUCCEED;
+
+ /* Function Enter Macro */
+ FUNC_ENTER_NOAPI_NOINIT(H5AC_tag)
+
+ /* Check Arguments */
+ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
+
+ /* Get the current tag value and return that (if prev_tag is NOT null)*/
+ if (prev_tag) {
+ if( (H5P_get(dxpl, "H5AC_metadata_tag", prev_tag)) < 0 )
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query dxpl");
+ }
+
+ /* Set the provided tag value in the dxpl_id. */
+ if(H5P_set(dxpl, "H5AC_metadata_tag", &metadata_tag) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set property in dxpl")
+
+done:
+
+ /* Function Leave Macro */
+ FUNC_LEAVE_NOAPI(ret_value);
+
+} /* H5AC_tag */
+
+
+/*------------------------------------------------------------------------------
+ * Function: H5AC_retag_copied_metadata()
+ *
+ * Purpose: Searches through cache index for all entries with the
+ * H5AC__COPIED_TAG, indicating that it was created as a
+ * result of an object copy, and applies the provided tag.
+ *
+ * Return: SUCCEED on success, FAIL otherwise.
+ *
+ * Programmer: Mike McGreevy
+ * March 17, 2010
+ *
+ *------------------------------------------------------------------------------
+ */
+herr_t
+H5AC_retag_copied_metadata(H5F_t * f, haddr_t metadata_tag)
+{
+ /* Variable Declarations */
+ herr_t ret_value = SUCCEED;
+
+ /* Function Enter Macro */
+ FUNC_ENTER_NOAPI_NOINIT(H5AC_retag_copied_metadata)
+
+ /* Assertions */
+ HDassert(f);
+ HDassert(f->shared);
+
+ /* Call cache-level function to retag entries */
+ H5C_retag_copied_metadata(f->shared->cache, metadata_tag);
+
+done:
+
+ /* Function Leave Macro */
+ FUNC_LEAVE_NOAPI(ret_value);
+
+} /* H5AC_retag_copied_metadata */