summaryrefslogtreecommitdiffstats
path: root/src/H5HFhdr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-05 22:47:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-05 22:47:56 (GMT)
commit93170b425a30c328c3db0183d8870c6e535c9d7c (patch)
treeb329e021fddcf8544e8f928eae0401eac8796752 /src/H5HFhdr.c
parentf0ecd713070b869c0d89d2ff0c991ade04852177 (diff)
downloadhdf5-93170b425a30c328c3db0183d8870c6e535c9d7c.zip
hdf5-93170b425a30c328c3db0183d8870c6e535c9d7c.tar.gz
hdf5-93170b425a30c328c3db0183d8870c6e535c9d7c.tar.bz2
[svn-r18716] Description:
Bring r18715 from metadata journaling merging branch to trunk: Changes to further align trunk with state of metadata journaling branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5HFhdr.c')
-rw-r--r--src/H5HFhdr.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c
index 54b4ff9..c51fc82 100644
--- a/src/H5HFhdr.c
+++ b/src/H5HFhdr.c
@@ -516,6 +516,51 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5HF_hdr_protect
+ *
+ * Purpose: Convenience wrapper around H5AC_protect on an indirect block
+ *
+ * Return: Pointer to indirect block on success, NULL on failure
+ *
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * May 5 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+H5HF_hdr_t *
+H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw)
+{
+ H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */
+ H5HF_hdr_t *hdr; /* Fractal heap header */
+ H5HF_hdr_t *ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_protect)
+
+ /* Check arguments */
+ HDassert(f);
+ HDassert(H5F_addr_defined(addr));
+
+ /* Set up userdata for protect call */
+ cache_udata.f = f;
+ cache_udata.dxpl_id = dxpl_id;
+
+ /* Lock the heap header into memory */
+ if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, addr, &cache_udata, rw)))
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header")
+
+ /* Set the header's address */
+ hdr->heap_addr = addr;
+
+ /* Set the return value */
+ ret_value = hdr;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HF_hdr_protect() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5HF_hdr_incr
*
* Purpose: Increment component reference count on shared heap header