summaryrefslogtreecommitdiffstats
path: root/src/H5B2stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5B2stat.c')
-rw-r--r--src/H5B2stat.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/H5B2stat.c b/src/H5B2stat.c
index b00df55..1251195 100644
--- a/src/H5B2stat.c
+++ b/src/H5B2stat.c
@@ -86,6 +86,7 @@ H5B2_stat_info(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type,
haddr_t addr, H5B2_stat_t *info)
{
H5B2_t *bt2 = NULL; /* Pointer to the B-tree header */
+ H5B2_shared_t *shared; /* Pointer to B-tree's shared information */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5B2_stat_info)
@@ -100,8 +101,15 @@ H5B2_stat_info(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type,
if(NULL == (bt2 = H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, type, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
-/* XXX: Fill in metadata statistics for the heap */
- info = info; /* Quiet compiler for now) */
+ /* Get pointer to reference counted shared B-tree info */
+ shared = H5RC_GET_OBJ(bt2->shared);
+
+ /* Get information about the B-tree */
+ info->depth = bt2->depth;
+ info->nrecords = bt2->root.all_nrec;
+ info->branch_nrec = shared->branch_nrec;
+ info->twig_nrec = shared->twig_nrec;
+ info->leaf_nrec = shared->leaf_nrec;
done:
/* Release B-tree header node */