diff options
Diffstat (limited to 'src/H5Goh.c')
-rw-r--r-- | src/H5Goh.c | 61 |
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() */ |