summaryrefslogtreecommitdiffstats
path: root/src/H5HFstat.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/H5HFstat.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/H5HFstat.c')
-rw-r--r--src/H5HFstat.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/src/H5HFstat.c b/src/H5HFstat.c
index 8d6b2ba..5b07e05 100644
--- a/src/H5HFstat.c
+++ b/src/H5HFstat.c
@@ -126,9 +126,10 @@ H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats)
herr_t
H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size)
{
- H5HF_hdr_t *hdr; /* Fractal heap header */
- herr_t ret_value = SUCCEED; /* Return value */
- hsize_t meta_size = 0; /* free space storage size */
+ H5HF_hdr_t *hdr; /* Fractal heap header */
+ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */
+ hsize_t meta_size = 0; /* free space storage size */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5HF_size, FAIL)
@@ -151,35 +152,29 @@ H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size)
if(H5HF_man_iblock_size(hdr->f, dxpl_id, hdr, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0, heap_size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to get fractal heap storage info for indirect block")
- /* Get B-tree storage for huge objects in fractal heap */
+ /* Check for B-tree storage of huge objects in fractal heap */
if(H5F_addr_defined(hdr->huge_bt2_addr)) {
- const H5B2_class_t *huge_bt2_class; /* Class for huge v2 B-tree */
-
- /* Determine the class of the huge v2 B-tree */
- if(hdr->huge_ids_direct)
- if(hdr->filter_len > 0)
- huge_bt2_class = H5HF_BT2_FILT_DIR;
- else
- huge_bt2_class = H5HF_BT2_DIR;
- else
- if(hdr->filter_len > 0)
- huge_bt2_class = H5HF_BT2_FILT_INDIR;
- else
- huge_bt2_class = H5HF_BT2_INDIR;
-
- /* Get the B-tree storage for the appropriate class */
- if(H5B2_iterate_size(hdr->f, dxpl_id, huge_bt2_class, hdr->huge_bt2_addr, heap_size) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info")
+ /* Open the huge object index v2 B-tree */
+ if(NULL == (bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr)))
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' objects")
+
+ /* Get the B-tree storage */
+ if(H5B2_iterate_size_2(bt2, dxpl_id, heap_size) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info")
} /* end if */
/* Get storage for free-space tracking info */
if(H5F_addr_defined(hdr->fs_addr)) {
if(H5HF_space_size(hdr, dxpl_id, &meta_size) < 0)
- HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't retrieve FS meta storage info")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve FS meta storage info")
*heap_size += meta_size;
- }
+ } /* end if */
done:
+ /* Release resources */
+ if(bt2 && H5B2_close(bt2, dxpl_id) < 0)
+ HDONE_ERROR(H5E_HEAP, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for tracking 'huge' objects")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5HF_size() */