summaryrefslogtreecommitdiffstats
path: root/src/H5B2cache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-01 17:05:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-01 17:05:23 (GMT)
commit90c94ab5d7e86b7573d3d92cf11b14e4fd90dab8 (patch)
treeb2f7787df09c5f036ba1f90a2283ad0c9dcaa179 /src/H5B2cache.c
parente3abb6e11a2dba5e57e1b36b9b4303a0007a5311 (diff)
downloadhdf5-90c94ab5d7e86b7573d3d92cf11b14e4fd90dab8.zip
hdf5-90c94ab5d7e86b7573d3d92cf11b14e4fd90dab8.tar.gz
hdf5-90c94ab5d7e86b7573d3d92cf11b14e4fd90dab8.tar.bz2
[svn-r17944] Description:
Bring r17943 from trunk to 1.8 branch: Finish refactoring v2 B-trees so that they can have client callback context provided to the encode/decode callbacks. Tested on: FreeBSD/64 6.3 (liberty) (h5committested on trunk)
Diffstat (limited to 'src/H5B2cache.c')
-rw-r--r--src/H5B2cache.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index c7cfbdb..695252e 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -144,7 +144,8 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{
*-------------------------------------------------------------------------
*/
static H5B2_hdr_t *
-H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1, void UNUSED *udata2)
+H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1,
+ void *ctx_udata)
{
H5B2_create_t cparam; /* B-tree creation parameters */
H5B2_subid_t id; /* ID of B-tree class, as found in file */
@@ -234,7 +235,7 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *ud
/* Initialize B-tree header info */
cparam.cls = H5B2_client_class_g[id];
- if(H5B2_hdr_init(f, hdr, &cparam, depth) < 0)
+ if(H5B2_hdr_init(f, hdr, &cparam, ctx_udata, depth) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't initialize B-tree header info")
/* Set the B-tree header's address */
@@ -561,7 +562,7 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_uda
native = internal->int_native;
for(u = 0; u < internal->nrec; u++) {
/* Decode record */
- if((udata->hdr->cls->decode)(f, p, native) < 0)
+ if((udata->hdr->cls->decode)(p, native, udata->hdr->cb_ctx) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode B-tree record")
/* Move to next record */
@@ -660,7 +661,7 @@ H5B2_cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr
native = internal->int_native;
for(u = 0; u < internal->nrec; u++) {
/* Encode record */
- if((internal->hdr->cls->encode)(f, p, native) < 0)
+ if((internal->hdr->cls->encode)(p, native, internal->hdr->cb_ctx) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record")
/* Move to next record */
@@ -913,7 +914,7 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nrec, v
native = leaf->leaf_native;
for(u = 0; u < leaf->nrec; u++) {
/* Decode record */
- if((hdr->cls->decode)(f, p, native) < 0)
+ if((hdr->cls->decode)(p, native, hdr->cb_ctx) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, NULL, "unable to decode B-tree record")
/* Move to next record */
@@ -996,7 +997,7 @@ H5B2_cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5
native = leaf->leaf_native;
for(u = 0; u < leaf->nrec; u++) {
/* Encode record */
- if((leaf->hdr->cls->encode)(f, p, native) < 0)
+ if((leaf->hdr->cls->encode)(p, native, leaf->hdr->cb_ctx) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record")
/* Move to next record */