summaryrefslogtreecommitdiffstats
path: root/src/H5MF.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-08-25 14:14:21 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-08-25 14:14:21 (GMT)
commitb043ee1241522fc0b87787ead985f5d9f3b7af26 (patch)
treed7f3eeea14b36276fb1c29904dcf092c6d81116b /src/H5MF.c
parent6c5e37a5938f3dc614f908d5d955b3103db4f367 (diff)
downloadhdf5-b043ee1241522fc0b87787ead985f5d9f3b7af26.zip
hdf5-b043ee1241522fc0b87787ead985f5d9f3b7af26.tar.gz
hdf5-b043ee1241522fc0b87787ead985f5d9f3b7af26.tar.bz2
[svn-r17417] Description:
Bring r17365:17416 from trunk to revise_chunks branch 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/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.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5MF.c')
-rw-r--r--src/H5MF.c75
1 files changed, 7 insertions, 68 deletions
diff --git a/src/H5MF.c b/src/H5MF.c
index 639a65f..b59af88 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -938,74 +938,6 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
/*-------------------------------------------------------------------------
- * Function: H5MF_free_aggrs
- *
- * Purpose: Reset a block aggregator, returning any space back to file
- *
- * Return: Success: Non-negative
- * Failure: Negative
- *
- * Programmer: Vailin Choi
- * July 1st, 2009
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id)
-{
- H5F_blk_aggr_t *first_aggr; /* First aggregator to reset */
- H5F_blk_aggr_t *second_aggr; /* Second aggregator to reset */
- haddr_t ma_addr = HADDR_UNDEF; /* Base "metadata aggregator" address */
- hsize_t ma_size = 0; /* Size of "metadata aggregator" */
- haddr_t sda_addr = HADDR_UNDEF; /* Base "small data aggregator" address */
- hsize_t sda_size = 0; /* Size of "small data aggregator" */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5MF_free_aggrs, FAIL)
-
- /* Check args */
- HDassert(f);
- HDassert(f->shared);
- HDassert(f->shared->lf);
-
- /* Retrieve metadata aggregator info, if available */
- if(H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats")
-
- /* Retrieve 'small data' aggregator info, if available */
- if(H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query small data aggregator stats")
-
- /* Make certain we release the aggregator that's later in the file first */
- /* (so the file shrinks properly) */
- if(H5F_addr_defined(ma_addr) && H5F_addr_defined(sda_addr)) {
- if(H5F_addr_lt(ma_addr, sda_addr)) {
- first_aggr = &(f->shared->sdata_aggr);
- second_aggr = &(f->shared->meta_aggr);
- } /* end if */
- else {
- first_aggr = &(f->shared->meta_aggr);
- second_aggr = &(f->shared->sdata_aggr);
- } /* end else */
- } /* end if */
- else {
- first_aggr = &(f->shared->meta_aggr);
- second_aggr = &(f->shared->sdata_aggr);
- } /* end else */
-
- /* Release the unused portion of the metadata and "small data" blocks back
- * to the free lists in the file.
- */
- if(H5MF_aggr_reset(f, dxpl_id, first_aggr) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't reset metadata block")
- if(H5MF_aggr_reset(f, dxpl_id, second_aggr) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't reset 'small data' block")
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5MF_free_aggrs() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5MF_close
*
* Purpose: Close the free space tracker(s) for a file
@@ -1033,6 +965,11 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
HDassert(f->shared);
HDassert(f->shared->lf);
+ /* Free the space in aggregators */
+ /* (for space not at EOF, it may be put into free space managers) */
+ if(H5MF_free_aggrs(f, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't free aggregators")
+
/* Iterate over all the free space types that have managers and get each free list's space */
for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
#ifdef H5MF_ALLOC_DEBUG_MORE
@@ -1083,6 +1020,8 @@ HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC);
} /* end if */
} /* end for */
+ /* Free the space in aggregators (again) */
+ /* (in case any free space information re-started them) */
if(H5MF_free_aggrs(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't free aggregators")