summaryrefslogtreecommitdiffstats
path: root/src/H5FAhdr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-05-15 02:00:27 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-05-15 02:00:27 (GMT)
commit71bc00a0b50e803a7d4076c6f2249fa1c2c3670e (patch)
tree0d6c10185306a9e1b6e7eac31d9f57f61401184b /src/H5FAhdr.c
parent668be45b5678fc38c58fbb657c04b557c7baffe7 (diff)
downloadhdf5-71bc00a0b50e803a7d4076c6f2249fa1c2c3670e.zip
hdf5-71bc00a0b50e803a7d4076c6f2249fa1c2c3670e.tar.gz
hdf5-71bc00a0b50e803a7d4076c6f2249fa1c2c3670e.tar.bz2
[svn-r27076] Description:
Clean up H5FA interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel
Diffstat (limited to 'src/H5FAhdr.c')
-rw-r--r--src/H5FAhdr.c66
1 files changed, 65 insertions, 1 deletions
diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c
index 23a554a..5970ff0 100644
--- a/src/H5FAhdr.c
+++ b/src/H5FAhdr.c
@@ -393,6 +393,70 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */
/*-------------------------------------------------------------------------
+ * Function: H5FA__hdr_protect
+ *
+ * Purpose: Convenience wrapper around protecting fixed array header
+ *
+ * Return: Non-NULL pointer to index block on success/NULL on failure
+ *
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Aug 12 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+BEGIN_FUNC(PKG, ERR,
+H5FA_hdr_t *, NULL, NULL,
+H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata,
+ H5AC_protect_t rw))
+
+ /* Local variables */
+
+ /* Sanity check */
+ HDassert(f);
+ HDassert(H5F_addr_defined(fa_addr));
+
+ /* Protect the header */
+ if(NULL == (ret_value = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, rw)))
+ H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr)
+
+CATCH
+
+END_FUNC(PKG) /* end H5FA__hdr_protect() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FA__hdr_unprotect
+ *
+ * Purpose: Convenience wrapper around unprotecting fixed array header
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Aug 12 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+BEGIN_FUNC(PKG, ERR,
+herr_t, SUCCEED, FAIL,
+H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags))
+
+ /* Local variables */
+
+ /* Sanity check */
+ HDassert(hdr);
+
+ /* Unprotect the header */
+ if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0)
+ H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array hdr, address = %llu", (unsigned long long)hdr->addr)
+
+CATCH
+
+END_FUNC(PKG) /* end H5EA__hdr_unprotect() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5FA__hdr_delete
*
* Purpose: Delete a fixed array, starting with the header
@@ -436,7 +500,7 @@ HDfprintf(stderr, "%s: hdr->dblk_addr = %a\n", FUNC, hdr->dblk_addr);
#endif /* H5FA_DEBUG */
/* Delete Fixed Array Data block */
- if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr, hdr->cparam.nelmts) < 0)
+ if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr) < 0)
H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array data block")
} /* end if */