summaryrefslogtreecommitdiffstats
path: root/src/H5Goh.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/H5Goh.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/H5Goh.c')
-rw-r--r--src/H5Goh.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/H5Goh.c b/src/H5Goh.c
index 598cd5a..9b070a6 100644
--- a/src/H5Goh.c
+++ b/src/H5Goh.c
@@ -242,3 +242,64 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_group_get_oloc() */
+/*-------------------------------------------------------------------------
+ * Function: H5O_group_bh_info
+ *
+ * Purpose: Retrieve storage for 1.8 btree and heap
+ * Retrieve storage for 1.6 btree and heap via H5G_stab_bh_info()
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi
+ * July 12 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5O_group_bh_info(H5O_loc_t *oloc, H5O_t *oh, hid_t dxpl_id, H5_ih_info_t *bh_info)
+{
+ herr_t ret_value=SUCCEED; /* Return value */
+ hsize_t huge_bt_size=0;
+ H5O_linfo_t linfo; /* Link info message */
+ H5O_stab_t stabinfo; /* Info about symbol table */
+
+
+
+ FUNC_ENTER_NOAPI(H5O_group_bh_info, FAIL)
+
+ /* Sanity check */
+ HDassert(oloc);
+ HDassert(oh);
+ HDassert(bh_info);
+
+ if(NULL==H5O_msg_read_real(oloc->file, dxpl_id, oh, H5O_LINFO_ID, &linfo)) {
+ H5E_clear_stack(NULL);
+ if(NULL==H5O_msg_read_real(oloc->file, dxpl_id, oh, H5O_STAB_ID, &stabinfo)) {
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't find LINFO nor STAB messages")
+ } else { /* STAB */
+ if (H5G_stab_bh_info(oloc, &stabinfo, dxpl_id, bh_info) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve pre-1.8 group btree & heap info")
+ }
+ } else { /* LINFO */
+ if (H5F_addr_defined(linfo.corder_bt2_addr)) {
+ if (H5B2_info_iterate(oloc->file, dxpl_id, H5G_BT2_CORDER,
+ linfo.corder_bt2_addr, &bh_info->index_size) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info")
+ }
+ if (H5F_addr_defined(linfo.name_bt2_addr)) {
+ if (H5B2_info_iterate(oloc->file, dxpl_id, H5G_BT2_NAME,
+ linfo.name_bt2_addr, &bh_info->index_size) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info")
+ }
+ huge_bt_size = 0;
+ if (H5F_addr_defined(linfo.fheap_addr)) {
+ if (H5HF_fheap_info(oloc->file, dxpl_id, linfo.fheap_addr,
+ &bh_info->heap_size, &huge_bt_size) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve fractal heap storage info")
+ }
+ bh_info->index_size += huge_bt_size;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5O_group_bh_info() */