summaryrefslogtreecommitdiffstats
path: root/src/H5Distore.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2007-07-13 21:12:25 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2007-07-13 21:12:25 (GMT)
commitd44b27ddcc66a8ed55f5069eabbf4c287ce1d99a (patch)
treeab22bfaa95add178894e6c649dc4b8aea0d196f4 /src/H5Distore.c
parent31a2af29ca7aa91fcd47eb018a02ff2e425c5b55 (diff)
downloadhdf5-d44b27ddcc66a8ed55f5069eabbf4c287ce1d99a.zip
hdf5-d44b27ddcc66a8ed55f5069eabbf4c287ce1d99a.tar.gz
hdf5-d44b27ddcc66a8ed55f5069eabbf4c287ce1d99a.tar.bz2
[svn-r13978] purpose:
New feature. Description: Added routines to report on the amount of storage for: 1) 1.6 btree and heap storage info for groups 2) 1.8 btree, fractal heap storage info for groups, attributes and SOHM table 3) btree storage for chunked datasets 4) 1.8 superblock extension size. Platform tested: h5committested.
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r--src/H5Distore.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 7e27d1e..297a480 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -4027,3 +4027,47 @@ H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int inden
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_debug() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_istore_btree_size
+ *
+ * Purpose: Retrieve the amount of B-tree storage for chunked dataset
+ *
+ * Return: Success: Non-negative
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi
+ * June 8, 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5D_obj_istore_bh_info(H5O_loc_t *oloc, H5O_layout_t *layout, hid_t dxpl_id, hsize_t *btree_size)
+{
+ H5D_istore_it_ud1_t udata;
+ herr_t ret_value=SUCCEED;
+ H5B_info_ud_t bh_udata;
+
+ FUNC_ENTER_NOAPI(H5D_obj_istore_bh_info, FAIL)
+
+ HDassert(oloc);
+ HDassert(layout);
+ HDassert(btree_size);
+
+ if(H5D_istore_shared_create(oloc->file, layout)<0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
+
+ HDmemset(&udata, 0, sizeof udata);
+ udata.common.mesg = layout;
+
+ bh_udata.udata = &udata;
+ bh_udata.btree_size = btree_size;
+ if ((ret_value = H5B_iterate_btree_size(oloc->file, dxpl_id, H5B_ISTORE, NULL, layout->u.chunk.addr, &bh_udata)) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to iterate over chunk B-tree")
+done:
+ if(layout->u.chunk.btree_shared==NULL)
+ HGOTO_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil")
+ if(H5RC_DEC(layout->u.chunk.btree_shared)<0)
+ HGOTO_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D_obj_istore_bh_info() */