summaryrefslogtreecommitdiffstats
path: root/src/H5HFtest.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-04-30 13:32:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-04-30 13:32:41 (GMT)
commit4965bf1839b4219c3063e27d37bc59a777cc1fb5 (patch)
tree925c87307aa9c13c66c301b0d3ca9283e9b20d32 /src/H5HFtest.c
parenteb96132022da938d4b54ae4dd482919a178c4ee5 (diff)
downloadhdf5-4965bf1839b4219c3063e27d37bc59a777cc1fb5.zip
hdf5-4965bf1839b4219c3063e27d37bc59a777cc1fb5.tar.gz
hdf5-4965bf1839b4219c3063e27d37bc59a777cc1fb5.tar.bz2
[svn-r12317] Purpose:
Code checkpoint Description: More progress on fractal heap, can now re-open an existing heap, although the free space algorithm still needs work. Also, use the new "pinned entry" metadata cache code. Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4 (heping) Solaris 9 (shanti) Linux 2.4/64 (mir)
Diffstat (limited to 'src/H5HFtest.c')
-rw-r--r--src/H5HFtest.c46
1 files changed, 11 insertions, 35 deletions
diff --git a/src/H5HFtest.c b/src/H5HFtest.c
index c01475c..4b627fd 100644
--- a/src/H5HFtest.c
+++ b/src/H5HFtest.c
@@ -84,33 +84,20 @@
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_get_cparam_test(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, H5HF_create_t *cparam)
+H5HF_get_cparam_test(H5HF_t *fh, H5HF_create_t *cparam)
{
- H5HF_t *hdr = NULL; /* Pointer to the fractal heap header */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT(H5HF_get_cparam_test)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_cparam_test)
/* Check arguments. */
- HDassert(f);
- HDassert(H5F_addr_defined(fh_addr));
+ HDassert(fh);
HDassert(cparam);
- /* Look up the fractal heap header */
- if(NULL == (hdr = H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, NULL, NULL, H5AC_READ)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap header")
-
/* Get fractal heap creation parameters */
- cparam->addrmap = hdr->addrmap;
- cparam->standalone_size = hdr->standalone_size;
- HDmemcpy(&(cparam->managed), &(hdr->man_dtable.cparam), sizeof(H5HF_dtable_cparam_t));
-
-done:
- /* Release fractal heap header node */
- if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
- HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap header info")
+ cparam->addrmap = fh->hdr->addrmap;
+ cparam->standalone_size = fh->hdr->standalone_size;
+ HDmemcpy(&(cparam->managed), &(fh->hdr->man_dtable.cparam), sizeof(H5HF_dtable_cparam_t));
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5HF_get_cparam_test() */
@@ -130,28 +117,17 @@ done:
*-------------------------------------------------------------------------
*/
hsize_t
-H5HF_get_dblock_free_test(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, unsigned row)
+H5HF_get_dblock_free_test(H5HF_t *fh, unsigned row)
{
- H5HF_t *hdr = NULL; /* Pointer to the fractal heap header */
hsize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5HF_get_dblock_free_test)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_dblock_free_test)
/* Check arguments. */
- HDassert(f);
- HDassert(H5F_addr_defined(fh_addr));
-
- /* Look up the fractal heap header */
- if(NULL == (hdr = H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, NULL, NULL, H5AC_READ)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, 0, "unable to load fractal heap header")
+ HDassert(fh);
/* Return direct block free space */
- ret_value = hdr->man_dtable.row_dblock_free[row];
-
-done:
- /* Release fractal heap header node */
- if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
- HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, 0, "unable to release fractal heap header info")
+ ret_value = fh->hdr->man_dtable.row_dblock_free[row];
FUNC_LEAVE_NOAPI(ret_value)
} /* H5HF_get_dblock_free_test() */