summaryrefslogtreecommitdiffstats
path: root/src/H5Bcache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-04-02 01:48:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-04-02 01:48:23 (GMT)
commitbacf7149e948c6c33401a9ecb0ad16e60805a9a2 (patch)
tree8e4a2b205b7bbed025d6b58066f55a8e21c920d4 /src/H5Bcache.c
parent2b8896eea1636e62ee6cbdd8bc6344b18c704566 (diff)
downloadhdf5-bacf7149e948c6c33401a9ecb0ad16e60805a9a2.zip
hdf5-bacf7149e948c6c33401a9ecb0ad16e60805a9a2.tar.gz
hdf5-bacf7149e948c6c33401a9ecb0ad16e60805a9a2.tar.bz2
[svn-r18495] Description:
Bring r18494 from trunk to 1.8 branch: Bring r18491 from metadata journaling "merging" branch to trunk: Extract data structure 'destroy' routines from metadata cache client 'destroy' callbacks. Tested on: FreeBSD/32 6.3 (duty) w/debug (h5committested on trunk)
Diffstat (limited to 'src/H5Bcache.c')
-rw-r--r--src/H5Bcache.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index 476bbe6..e9210ca 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -57,6 +57,7 @@
/* Metadata cache callbacks */
static H5B_t *H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata);
static herr_t H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b, unsigned UNUSED * flags_ptr);
+static herr_t H5B_dest(H5F_t *f, H5B_t *bt);
static herr_t H5B_clear(H5F_t *f, H5B_t *b, hbool_t destroy);
static herr_t H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr);
@@ -181,7 +182,8 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
done:
if(!ret_value && bt)
- (void)H5B_dest(f, bt);
+ if(H5B_node_dest(bt) < 0)
+ HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_load() */ /*lint !e818 Can't make udata a pointer to const */
@@ -291,7 +293,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5B_dest(H5F_t *f, H5B_t *bt)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -322,11 +324,9 @@ H5B_dest(H5F_t *f, H5B_t *bt)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree node")
} /* end if */
- /* Release resources for B-tree node */
- bt->child = H5FL_SEQ_FREE(haddr_t, bt->child);
- bt->native = H5FL_BLK_FREE(native_block, bt->native);
- H5RC_DEC(bt->rc_shared);
- bt = H5FL_FREE(H5B_t, bt);
+ /* Destroy B-tree node */
+ if(H5B_node_dest(bt) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node")
done:
FUNC_LEAVE_NOAPI(ret_value)