diff options
Diffstat (limited to 'src/H5Doh.c')
-rw-r--r-- | src/H5Doh.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/H5Doh.c b/src/H5Doh.c index e59fe8b..620554e0 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -327,3 +327,43 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_dset_get_oloc() */ +/*------------------------------------------------------------------------- + * Function: H5O_dset_bh_info + * + * Purpose: Returns the amount of btree storage that is used for chunked + * dataset. + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Vailin Choi + * July 11, 2007 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_dset_bh_info(H5O_loc_t *oloc, H5O_t *oh, hid_t dxpl_id, H5_ih_info_t *bh_info) +{ + H5O_layout_t layout; /* Data storage layout message */ + herr_t ret_value=SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5O_dset_bh_info, FAIL) + + /* Sanity check */ + HDassert(oloc); + HDassert(oh); + HDassert(bh_info); + + if (NULL==H5O_msg_read_real(oloc->file, dxpl_id, oh, H5O_LAYOUT_ID, &layout)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find LAYOUT message") + else { + if ((layout.type == H5D_CHUNKED) && (layout.u.chunk.addr != HADDR_UNDEF)) { + ret_value = H5D_obj_istore_bh_info(oloc, &layout, dxpl_id, &(bh_info->index_size)); + if (ret_value < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine chunked dataset btree info") + } + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_dset_bh_info() */ |