summaryrefslogtreecommitdiffstats
path: root/src/H5Aint.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-11-14 03:37:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-11-14 03:37:43 (GMT)
commit5084f8a5ebc3200315e95729d09628a800d442a2 (patch)
treeaab68007e2c603ff14498d8918cf3ead28c05c86 /src/H5Aint.c
parentb00e032eb3ed0fc8d9ad44eb0ce5766efb4ac071 (diff)
downloadhdf5-5084f8a5ebc3200315e95729d09628a800d442a2.zip
hdf5-5084f8a5ebc3200315e95729d09628a800d442a2.tar.gz
hdf5-5084f8a5ebc3200315e95729d09628a800d442a2.tar.bz2
[svn-r17889] Description:
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 FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5Aint.c')
-rw-r--r--src/H5Aint.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/H5Aint.c b/src/H5Aint.c
index 475239a..7115b52 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -314,6 +314,7 @@ herr_t
H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable)
{
+ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */
hsize_t nrec; /* # of records in v2 B-tree */
herr_t ret_value = SUCCEED; /* Return value */
@@ -326,9 +327,13 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
HDassert(H5F_addr_defined(ainfo->name_bt2_addr));
HDassert(atable);
+ /* Open the name index v2 B-tree */
+ if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr)))
+ HGOTO_ERROR(H5E_ATTR, 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(f, dxpl_id, H5A_BT2_NAME, ainfo->name_bt2_addr, &nrec) < 0)
+ if(H5B2_get_nrec_2(bt2_name, &nrec) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve # of records in index")
/* Set size of table */
@@ -371,6 +376,10 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
atable->attrs = NULL;
done:
+ /* Release resources */
+ if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0)
+ HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5A_dense_build_table() */
@@ -692,6 +701,7 @@ done:
htri_t
H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo)
{
+ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */
htri_t ret_value; /* Return value */
FUNC_ENTER_NOAPI(H5A_get_ainfo, FAIL)
@@ -713,9 +723,13 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo)
if(ainfo->nattrs == HSIZET_MAX) {
/* Check if we are using "dense" attribute storage */
if(H5F_addr_defined(ainfo->fheap_addr)) {
+ /* Open the name index v2 B-tree */
+ if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr)))
+ HGOTO_ERROR(H5E_ATTR, 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(f, dxpl_id, H5A_BT2_NAME, ainfo->name_bt2_addr, &ainfo->nattrs) < 0)
+ if(H5B2_get_nrec_2(bt2_name, &ainfo->nattrs) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve # of records in index")
} /* end if */
else
@@ -725,6 +739,10 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo)
} /* end if */
done:
+ /* Release resources */
+ if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0)
+ HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5A_get_ainfo() */