summaryrefslogtreecommitdiffstats
path: root/src/H5Gobj.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-11-14 03:42:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-11-14 03:42:31 (GMT)
commit437b17f2b45d4b1afb9606ae444338b5abd40b79 (patch)
tree8b50c07477c3dfc87c732fdaf394d3ae675f8d91 /src/H5Gobj.c
parented505ff5fa2c80071880472f7135cdc8ebdb96b7 (diff)
downloadhdf5-437b17f2b45d4b1afb9606ae444338b5abd40b79.zip
hdf5-437b17f2b45d4b1afb9606ae444338b5abd40b79.tar.gz
hdf5-437b17f2b45d4b1afb9606ae444338b5abd40b79.tar.bz2
[svn-r17890] Description:
Bring r17889 from trunk to 1.8 branch: Switch a bunch of misc. places in interfaces that were already converted to use the refactored v2 B-tree routines to use the refactored v2 B-tree routines. Tested on: FreeBSD/32 6.3 (duty) in debug mode (h5committested on trunk)
Diffstat (limited to 'src/H5Gobj.c')
-rw-r--r--src/H5Gobj.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/H5Gobj.c b/src/H5Gobj.c
index edc68e4..fe85d18 100644
--- a/src/H5Gobj.c
+++ b/src/H5Gobj.c
@@ -253,7 +253,7 @@ H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo,
(ginfo->est_num_entries * link_size);
} /* end if */
else
- hdr_size = 4 + 2 * H5F_SIZEOF_ADDR(f);
+ hdr_size = (size_t)(4 + 2 * H5F_SIZEOF_ADDR(f));
/*
* Create group's object header. It has a zero link count
@@ -309,6 +309,7 @@ done:
htri_t
H5G_obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id)
{
+ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */
htri_t ret_value; /* Return value */
FUNC_ENTER_NOAPI(H5G_obj_get_linfo, FAIL)
@@ -329,9 +330,13 @@ H5G_obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id)
if(linfo->nlinks == HSIZET_MAX) {
/* Check if we are using "dense" link storage */
if(H5F_addr_defined(linfo->fheap_addr)) {
+ /* Open the name index v2 B-tree */
+ if(NULL == (bt2_name = H5B2_open(grp_oloc->file, dxpl_id, linfo->name_bt2_addr)))
+ HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index")
+
/* Retrieve # of records in "name" B-tree */
/* (should be same # of records in all indices) */
- if(H5B2_get_nrec(grp_oloc->file, dxpl_id, H5G_BT2_NAME, linfo->name_bt2_addr, &linfo->nlinks) < 0)
+ if(H5B2_get_nrec_2(bt2_name, &linfo->nlinks) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve # of records in index")
} /* end if */
else {
@@ -343,6 +348,10 @@ H5G_obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id)
} /* end if */
done:
+ /* Release resources */
+ if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0)
+ HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G_obj_get_linfo() */