summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-04-29 20:13:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-04-29 20:13:49 (GMT)
commitb05a1c671317403994e4bff5564563f41d348eea (patch)
tree97245dc33498888a05394a888d47a22acb06580c
parent789e672956c99300d6e22f602fae5bc2fe286ce6 (diff)
downloadhdf5-b05a1c671317403994e4bff5564563f41d348eea.zip
hdf5-b05a1c671317403994e4bff5564563f41d348eea.tar.gz
hdf5-b05a1c671317403994e4bff5564563f41d348eea.tar.bz2
[svn-r18671] Description:
Mostly minor code cleanups and reformatting to better set up udata parameters when protecting metadata cache entries. Also, some changes to better align with state of code on the trunk. Tested on: Mac OS X/32 10.6.3 (amazon) w/debug (h5committest not required on this branch)
-rw-r--r--src/H5B2.c76
-rw-r--r--src/H5B2dbg.c21
-rw-r--r--src/H5B2int.c153
-rw-r--r--src/H5B2pkg.h7
-rw-r--r--src/H5B2stat.c3
-rw-r--r--src/H5B2test.c16
-rw-r--r--src/H5C.c12
-rw-r--r--src/H5Distore.c4
-rw-r--r--src/H5F.c4
-rw-r--r--src/H5FDmpiposix.c2
-rw-r--r--src/H5FSsection.c3
-rw-r--r--src/H5Fsuper.c1
-rw-r--r--src/H5Gnode.c20
-rw-r--r--src/H5HF.c1
-rw-r--r--src/H5HFcache.c16
-rw-r--r--src/H5HFdblock.c6
-rw-r--r--src/H5HFman.c2
-rw-r--r--test/cache.c1
18 files changed, 152 insertions, 196 deletions
diff --git a/src/H5B2.c b/src/H5B2.c
index bf38fd4..5579ba8 100644
--- a/src/H5B2.c
+++ b/src/H5B2.c
@@ -181,10 +181,9 @@ H5B2_insert(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HDassert(type);
HDassert(H5F_addr_defined(addr));
+ /* Look up the b-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the b-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -268,10 +267,9 @@ H5B2_iterate(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HDassert(H5F_addr_defined(addr));
HDassert(op);
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -357,10 +355,9 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HDassert(type);
HDassert(H5F_addr_defined(addr));
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -418,7 +415,7 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
/* Make callback for current record */
if(op && (op)(H5B2_INT_NREC(internal, shared, idx), op_data) < 0) {
/* Unlock current node */
- if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation")
@@ -438,11 +435,10 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
{
H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */
+ /* Lock B-tree leaf node */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(curr_node_ptr.node_nrec);
cache_leaf_udata.bt2_shared = bt2_shared;
-
- /* Lock B-tree leaf node */
if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
@@ -529,10 +525,9 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HDassert(H5F_addr_defined(addr));
HDassert(op);
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -646,11 +641,10 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
{
H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */
+ /* Lock B-tree leaf node */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(curr_node_ptr.node_nrec);
cache_leaf_udata.bt2_shared = bt2_shared;
-
- /* Lock B-tree leaf node */
if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
@@ -710,10 +704,9 @@ H5B2_remove(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HDassert(type);
HDassert(H5F_addr_defined(addr));
+ /* Look up the b-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the b-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -759,7 +752,7 @@ H5B2_remove(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
done:
/* Release the B-tree header info */
- if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, bt2_flags) < 0)
+ if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, bt2_flags) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info")
FUNC_LEAVE_NOAPI(ret_value)
@@ -797,10 +790,9 @@ H5B2_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type,
HDassert(type);
HDassert(H5F_addr_defined(addr));
+ /* Look up the b-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the b-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -854,7 +846,7 @@ H5B2_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type,
done:
/* Release the B-tree header info */
- if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, bt2_flags) < 0)
+ if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, bt2_flags) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info")
FUNC_LEAVE_NOAPI(ret_value)
@@ -878,9 +870,9 @@ herr_t
H5B2_get_nrec(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
hsize_t *nrec)
{
- H5B2_t *bt2=NULL; /* Pointer to the B-tree header */
+ H5B2_t *bt2 = NULL; /* Pointer to the B-tree header */
H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5B2_get_nrec, FAIL)
@@ -890,11 +882,10 @@ H5B2_get_nrec(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HDassert(H5F_addr_defined(addr));
HDassert(nrec);
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
- if (NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
+ if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
/* Get B-tree number of records */
@@ -902,7 +893,7 @@ H5B2_get_nrec(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
done:
/* Release B-tree header node */
- if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0)
+ if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info")
FUNC_LEAVE_NOAPI(ret_value)
@@ -951,10 +942,9 @@ H5B2_neighbor(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HDassert(H5F_addr_defined(addr));
HDassert(op);
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -978,7 +968,7 @@ H5B2_neighbor(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
done:
/* Release the B-tree header info */
- if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0)
+ if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)0, bt2, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info")
FUNC_LEAVE_NOAPI(ret_value)
@@ -1023,10 +1013,9 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HDassert(type);
HDassert(H5F_addr_defined(addr));
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -1096,10 +1085,9 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HDassert(H5F_addr_defined(addr));
HDassert(op);
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -1149,7 +1137,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
next_node_ptr=internal->node_ptrs[idx];
/* Unlock current node */
- if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
/* Set pointer to next node to load */
@@ -1159,12 +1147,12 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
hbool_t changed; /* Whether the 'modify' callback changed the record */
/* Make callback for current record */
- if ( (op)(H5B2_INT_NREC(internal,shared,idx), op_data, &changed) <0) {
+ if((op)(H5B2_INT_NREC(internal,shared,idx), op_data, &changed) < 0) {
/* Make certain that the callback didn't modify the value if it failed */
HDassert(changed==FALSE);
/* Unlock current node */
- if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree find operation")
@@ -1174,7 +1162,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
internal_flags |= changed ? H5AC__DIRTIED_FLAG : 0;
/* Unlock current node */
- if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr,(size_t)0, internal, internal_flags) < 0)
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr,(size_t)0, internal, internal_flags) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
HGOTO_DONE(SUCCEED);
@@ -1189,12 +1177,11 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */
hbool_t changed = FALSE;/* Whether the 'modify' callback changed the record */
+ /* Lock B-tree leaf node */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(curr_node_ptr.node_nrec);
cache_leaf_udata.bt2_shared = bt2_shared;
-
- /* Lock B-tree leaf node */
- if (NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
/* Locate record */
@@ -1202,7 +1189,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
if(cmp != 0) {
/* Unlock leaf node */
- if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
/* Note: don't push error on stack, leave that to next higher level,
@@ -1217,12 +1204,12 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
} /* end if */
else {
/* Make callback for current record */
- if ((op)(H5B2_LEAF_NREC(leaf,shared,idx), op_data, &changed) <0) {
+ if((op)(H5B2_LEAF_NREC(leaf,shared,idx), op_data, &changed) < 0) {
/* Make certain that the callback didn't modify the value if it failed */
HDassert(changed==FALSE);
/* Unlock current node */
- if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree find operation")
@@ -1233,7 +1220,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
leaf_flags |= (changed ? H5AC__DIRTIED_FLAG : 0);
/* Unlock current node */
- if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, leaf_flags) < 0)
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)0, leaf, leaf_flags) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
}
@@ -1279,10 +1266,9 @@ H5B2_iterate_size(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t add
HDassert(H5F_addr_defined(addr));
HDassert(btree_size);
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c
index 72c92ba..dd23432 100644
--- a/src/H5B2dbg.c
+++ b/src/H5B2dbg.c
@@ -109,12 +109,11 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
HDassert(fwidth >= 0);
HDassert(type);
- cache_udata.f = f;
- cache_udata.type = type;
-
/*
* Load the B-tree header.
*/
+ cache_udata.f = f;
+ cache_udata.type = type;
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header")
@@ -225,12 +224,11 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
HDassert(H5F_addr_defined(hdr_addr));
HDassert(nrec > 0);
- cache_udata.f = f;
- cache_udata.type = type;
-
/*
* Load the B-tree header.
*/
+ cache_udata.f = f;
+ cache_udata.type = type;
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header")
@@ -342,6 +340,7 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
unsigned u; /* Local index variable */
char temp_str[128]; /* Temporary string, for formatting */
H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */
+ H5B2_leaf_cache_ud_t cache_leaf_udata; /* User-data for callback */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5B2_leaf_debug, FAIL)
@@ -358,12 +357,11 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
HDassert(H5F_addr_defined(hdr_addr));
HDassert(nrec > 0);
- cache_udata.f = f;
- cache_udata.type = type;
-
/*
* Load the B-tree header.
*/
+ cache_udata.f = f;
+ cache_udata.type = type;
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header")
@@ -374,7 +372,10 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
/*
* Load the B-tree leaf node
*/
- if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, addr, (size_t)shared->node_size, &cache_udata, H5AC_READ)))
+ cache_leaf_udata.f = f;
+ cache_leaf_udata.nrec = &nrec;
+ cache_leaf_udata.bt2_shared = bt2->shared;
+ if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree leaf node")
/* Release the B-tree header */
diff --git a/src/H5B2int.c b/src/H5B2int.c
index e132169..072f9bd 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -440,16 +440,14 @@ H5B2_split1(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_
left_addr = internal->node_ptrs[idx].addr;
right_addr = internal->node_ptrs[idx + 1].addr;
+ /* Protect both leafs */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(internal->node_ptrs[idx].node_nrec);
cache_leaf_udata.bt2_shared = internal->shared;
-
- /* Protect both leafs */
if(NULL == (left_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, left_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
cache_leaf_udata.nrec = &(internal->node_ptrs[idx + 1].node_nrec);
-
if(NULL == (right_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, right_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
@@ -663,7 +661,7 @@ H5B2_redistribute2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *int
HDassert(internal);
/* Get the pointer to the shared B-tree info */
- shared=(H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
+ shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
HDassert(shared);
/* Check for the kind of B-tree node to redistribute */
@@ -677,9 +675,9 @@ H5B2_redistribute2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *int
right_addr = internal->node_ptrs[idx+1].addr;
/* Lock left & right B-tree child nodes */
- if (NULL == (left_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, left_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE)))
+ if(NULL == (left_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, left_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
- if (NULL == (right_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, right_addr, internal->node_ptrs[idx+1].node_nrec, (depth - 1), H5AC_WRITE)))
+ if(NULL == (right_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, right_addr, internal->node_ptrs[idx+1].node_nrec, (depth - 1), H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
/* More setup for child nodes */
@@ -701,17 +699,15 @@ H5B2_redistribute2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *int
left_addr = internal->node_ptrs[idx].addr;
right_addr = internal->node_ptrs[idx+1].addr;
+ /* Lock left & right B-tree child nodes */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(internal->node_ptrs[idx].node_nrec);
cache_leaf_udata.bt2_shared = internal->shared;
-
- /* Lock left & right B-tree child nodes */
- if (NULL == (left_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, left_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (left_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, left_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
cache_leaf_udata.nrec = &(internal->node_ptrs[idx + 1].node_nrec);
-
- if (NULL == (right_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, right_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (right_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, right_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
/* More setup for child nodes */
@@ -848,9 +844,9 @@ H5B2_redistribute2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *int
#endif /* H5B2_DEBUG */
/* Release child nodes (marked as dirty) */
- if (H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0)
+ if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
- if (H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG) < 0)
+ if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
done:
@@ -901,7 +897,7 @@ H5B2_redistribute3(H5F_t *f, hid_t dxpl_id, unsigned depth,
HDassert(internal_flags_ptr);
/* Get the pointer to the shared B-tree info */
- shared=(H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
+ shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
HDassert(shared);
/* Check for the kind of B-tree node to redistribute */
@@ -917,11 +913,11 @@ H5B2_redistribute3(H5F_t *f, hid_t dxpl_id, unsigned depth,
right_addr = internal->node_ptrs[idx+1].addr;
/* Lock B-tree child nodes */
- if (NULL == (left_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, left_addr, internal->node_ptrs[idx-1].node_nrec, (depth - 1), H5AC_WRITE)))
+ if(NULL == (left_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, left_addr, internal->node_ptrs[idx-1].node_nrec, (depth - 1), H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
- if (NULL == (middle_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, middle_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE)))
+ if(NULL == (middle_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, middle_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
- if (NULL == (right_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, right_addr, internal->node_ptrs[idx+1].node_nrec, (depth - 1), H5AC_WRITE)))
+ if(NULL == (right_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, right_addr, internal->node_ptrs[idx+1].node_nrec, (depth - 1), H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
/* More setup for child nodes */
@@ -949,22 +945,19 @@ H5B2_redistribute3(H5F_t *f, hid_t dxpl_id, unsigned depth,
middle_addr = internal->node_ptrs[idx].addr;
right_addr = internal->node_ptrs[idx+1].addr;
+ /* Lock B-tree child nodes */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(internal->node_ptrs[idx-1].node_nrec);
cache_leaf_udata.bt2_shared = internal->shared;
-
- /* Lock B-tree child nodes */
- if (NULL == (left_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, left_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (left_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, left_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
cache_leaf_udata.nrec = &(internal->node_ptrs[idx].node_nrec);
-
- if (NULL == (middle_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, middle_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (middle_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, middle_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
cache_leaf_udata.nrec = &(internal->node_ptrs[idx+1].node_nrec);
-
- if (NULL == (right_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, right_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (right_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, right_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
/* More setup for child nodes */
@@ -1231,11 +1224,11 @@ H5B2_redistribute3(H5F_t *f, hid_t dxpl_id, unsigned depth,
#endif /* H5B2_DEBUG */
/* Unlock child nodes (marked as dirty) */
- if (H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0)
+ if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
- if (H5AC_unprotect(f, dxpl_id, child_class, middle_addr, (size_t)0, middle_child, H5AC__DIRTIED_FLAG) < 0)
+ if(H5AC_unprotect(f, dxpl_id, child_class, middle_addr, (size_t)0, middle_child, H5AC__DIRTIED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
- if (H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG) < 0)
+ if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
done:
@@ -1282,7 +1275,7 @@ H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth,
HDassert(internal_flags_ptr);
/* Get the pointer to the shared B-tree info */
- shared=(H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
+ shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
HDassert(shared);
/* Check for the kind of B-tree node to split */
@@ -1320,16 +1313,14 @@ H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth,
left_addr = internal->node_ptrs[idx].addr;
right_addr = internal->node_ptrs[idx+1].addr;
+ /* Lock left & right B-tree child nodes */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(internal->node_ptrs[idx].node_nrec);
cache_leaf_udata.bt2_shared = internal->shared;
-
- /* Lock left & right B-tree child nodes */
if(NULL == (left_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, left_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
cache_leaf_udata.nrec = &(internal->node_ptrs[idx+1].node_nrec);
-
if(NULL == (right_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, right_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
@@ -1450,7 +1441,7 @@ H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth,
HDassert(internal_flags_ptr);
/* Get the pointer to the shared B-tree info */
- shared=(H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
+ shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
HDassert(shared);
/* Check for the kind of B-tree node to split */
@@ -1466,11 +1457,11 @@ H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth,
right_addr = internal->node_ptrs[idx+1].addr;
/* Lock B-tree child nodes */
- if (NULL == (left_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, left_addr, internal->node_ptrs[idx-1].node_nrec, (depth - 1), H5AC_WRITE)))
+ if(NULL == (left_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, left_addr, internal->node_ptrs[idx-1].node_nrec, (depth - 1), H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
- if (NULL == (middle_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, middle_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE)))
+ if(NULL == (middle_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, middle_addr, internal->node_ptrs[idx].node_nrec, (depth - 1), H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
- if (NULL == (right_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, right_addr, internal->node_ptrs[idx+1].node_nrec, (depth - 1), H5AC_WRITE)))
+ if(NULL == (right_internal = H5B2_protect_internal(f, dxpl_id, internal->shared, right_addr, internal->node_ptrs[idx+1].node_nrec, (depth - 1), H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
/* More setup for accessing child node information */
@@ -1498,22 +1489,19 @@ H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth,
middle_addr = internal->node_ptrs[idx].addr;
right_addr = internal->node_ptrs[idx+1].addr;
+ /* Lock B-tree child nodes */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(internal->node_ptrs[idx-1].node_nrec);
cache_leaf_udata.bt2_shared = internal->shared;
-
- /* Lock B-tree child nodes */
- if (NULL == (left_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, left_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (left_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, left_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
cache_leaf_udata.nrec = &(internal->node_ptrs[idx].node_nrec);
-
- if (NULL == (middle_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, middle_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (middle_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, middle_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
cache_leaf_udata.nrec = &(internal->node_ptrs[idx+1].node_nrec);
-
- if (NULL == (right_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, right_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (right_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, right_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
/* More setup for accessing child node information */
@@ -1624,15 +1612,15 @@ H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth,
#endif /* H5B2_DEBUG */
/* Unlock left & middle nodes (marked as dirty) */
- if (H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0)
+ if(H5AC_unprotect(f, dxpl_id, child_class, left_addr, (size_t)0, left_child, H5AC__DIRTIED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
- if (H5AC_unprotect(f, dxpl_id, child_class, middle_addr, (size_t)0, middle_child, H5AC__DIRTIED_FLAG) < 0)
+ if(H5AC_unprotect(f, dxpl_id, child_class, middle_addr, (size_t)0, middle_child, H5AC__DIRTIED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
/* Delete right node & remove from cache (marked as dirty) */
- if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, right_addr, (hsize_t)shared->node_size) < 0)
+ if(H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, right_addr, (hsize_t)shared->node_size) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree leaf node")
- if (H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0)
+ if(H5AC_unprotect(f, dxpl_id, child_class, right_addr, (size_t)0, right_child, H5AC__DIRTIED_FLAG|H5AC__DELETED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
done:
@@ -1676,7 +1664,7 @@ H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth,
HDassert(idx <= internal->nrec);
/* Get the pointer to the shared B-tree info */
- shared=(H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
+ shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared);
HDassert(shared);
/* Check for the kind of B-tree node to swap */
@@ -1702,12 +1690,11 @@ H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth,
child_class = H5AC_BT2_LEAF;
child_addr = internal->node_ptrs[idx].addr;
+ /* Lock B-tree child node */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(internal->node_ptrs[idx].node_nrec);
cache_leaf_udata.bt2_shared = internal->shared;
-
- /* Lock B-tree child node */
- if (NULL == (child_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, child_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (child_leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, child_class, child_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
/* More setup for accessing child node information */
@@ -1732,7 +1719,7 @@ H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth,
#endif /* H5B2_DEBUG */
/* Unlock child node */
- if (H5AC_unprotect(f, dxpl_id, child_class, child_addr, (size_t)0, child, H5AC__DIRTIED_FLAG) < 0)
+ if(H5AC_unprotect(f, dxpl_id, child_class, child_addr, (size_t)0, child, H5AC__DIRTIED_FLAG) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")
done:
@@ -1772,16 +1759,15 @@ H5B2_insert_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared,
HDassert(curr_node_ptr);
HDassert(H5F_addr_defined(curr_node_ptr->addr));
- cache_leaf_udata.f = f;
- cache_leaf_udata.nrec = &(curr_node_ptr->node_nrec);
- cache_leaf_udata.bt2_shared = bt2_shared;
-
/* Get the pointer to the shared B-tree info */
- shared=(H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
+ shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
HDassert(shared);
/* Lock current B-tree node */
- if (NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ cache_leaf_udata.f = f;
+ cache_leaf_udata.nrec = &(curr_node_ptr->node_nrec);
+ cache_leaf_udata.bt2_shared = bt2_shared;
+ if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
/* Must have a leaf node with enough space to insert a record now */
@@ -1865,7 +1851,7 @@ H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared,
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
/* Get the pointer to the shared B-tree info */
- shared=(H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
+ shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
HDassert(shared);
/* Split or redistribute child node pointers, if necessary */
@@ -1959,7 +1945,7 @@ H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared,
done:
/* Release the B-tree internal node */
- if (internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, (size_t)0, internal, internal_flags) < 0)
+ if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, (size_t)0, internal, internal_flags) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node")
FUNC_LEAVE_NOAPI(ret_value)
@@ -2234,12 +2220,11 @@ H5B2_iterate_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth,
else {
H5B2_leaf_t *leaf; /* Pointer to leaf node */
+ /* Lock the current B-tree node */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(curr_node->node_nrec);
cache_leaf_udata.bt2_shared = bt2_shared;
-
- /* Lock the current B-tree node */
- if (NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node->addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_READ)))
+ if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node->addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
/* Set up information about current node */
@@ -2326,16 +2311,15 @@ H5B2_remove_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared,
HDassert(curr_node_ptr);
HDassert(H5F_addr_defined(curr_node_ptr->addr));
- cache_leaf_udata.f = f;
- cache_leaf_udata.nrec = &(curr_node_ptr->node_nrec);
- cache_leaf_udata.bt2_shared = bt2_shared;
-
/* Get the pointer to the shared B-tree info */
shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
HDassert(shared);
/* Lock current B-tree node */
leaf_addr = curr_node_ptr->addr;
+ cache_leaf_udata.f = f;
+ cache_leaf_udata.nrec = &(curr_node_ptr->node_nrec);
+ cache_leaf_udata.bt2_shared = bt2_shared;
if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
@@ -2634,16 +2618,15 @@ H5B2_remove_leaf_by_idx(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared,
HDassert(curr_node_ptr);
HDassert(H5F_addr_defined(curr_node_ptr->addr));
- cache_leaf_udata.f = f;
- cache_leaf_udata.nrec = &(curr_node_ptr->node_nrec);
- cache_leaf_udata.bt2_shared = bt2_shared;
-
/* Get the pointer to the shared B-tree info */
shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
HDassert(shared);
/* Lock B-tree leaf node */
leaf_addr = curr_node_ptr->addr;
+ cache_leaf_udata.f = f;
+ cache_leaf_udata.nrec = &(curr_node_ptr->node_nrec);
+ cache_leaf_udata.bt2_shared = bt2_shared;
if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
@@ -3008,16 +2991,15 @@ H5B2_neighbor_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared,
HDassert(H5F_addr_defined(curr_node_ptr->addr));
HDassert(op);
- cache_leaf_udata.f = f;
- cache_leaf_udata.nrec = &(curr_node_ptr->node_nrec);
- cache_leaf_udata.bt2_shared = bt2_shared;
-
/* Get the pointer to the shared B-tree info */
- shared=(H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
+ shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
HDassert(shared);
/* Lock current B-tree node */
- if (NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_READ)))
+ cache_leaf_udata.f = f;
+ cache_leaf_udata.nrec = &(curr_node_ptr->node_nrec);
+ cache_leaf_udata.bt2_shared = bt2_shared;
+ if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
/* Locate node pointer for child */
@@ -3043,7 +3025,7 @@ H5B2_neighbor_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared,
/* Make callback if neighbor record has been found */
if(neighbor_loc) {
/* Make callback for current record */
- if ((op)(neighbor_loc, op_data) < 0)
+ if((op)(neighbor_loc, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree neighbor operation")
} /* end if */
else
@@ -3051,7 +3033,7 @@ H5B2_neighbor_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared,
done:
/* Release the B-tree internal node */
- if (leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0)
+ if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, (size_t)0, leaf, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node")
FUNC_LEAVE_NOAPI(ret_value)
@@ -3142,7 +3124,7 @@ H5B2_neighbor_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared,
done:
/* Release the B-tree internal node */
- if (internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0)
+ if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, (size_t)0, internal, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node")
FUNC_LEAVE_NOAPI(ret_value)
@@ -3182,7 +3164,7 @@ H5B2_delete_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth,
HDassert(curr_node);
/* Get the pointer to the shared B-tree info */
- shared=(H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
+ shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
HDassert(shared);
if(depth>0) {
@@ -3190,7 +3172,7 @@ H5B2_delete_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth,
unsigned u; /* Local index */
/* Lock the current B-tree node */
- if (NULL == (internal = H5B2_protect_internal(f, dxpl_id, bt2_shared, curr_node->addr, curr_node->node_nrec, depth, H5AC_WRITE)))
+ if(NULL == (internal = H5B2_protect_internal(f, dxpl_id, bt2_shared, curr_node->addr, curr_node->node_nrec, depth, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
/* Set up information about current node */
@@ -3199,19 +3181,18 @@ H5B2_delete_node(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth,
native = internal->int_native;
/* Descend into children */
- for(u=0; u<internal->nrec+1; u++)
- if(H5B2_delete_node(f, dxpl_id, bt2_shared, depth-1, &(internal->node_ptrs[u]), op, op_data) < 0)
+ for(u = 0; u < internal->nrec + 1; u++)
+ if(H5B2_delete_node(f, dxpl_id, bt2_shared, (depth - 1), &(internal->node_ptrs[u]), op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node descent failed")
} /* end if */
else {
H5B2_leaf_t *leaf; /* Pointer to leaf node */
+ /* Lock the current B-tree node */
cache_leaf_udata.f = f;
cache_leaf_udata.nrec = &(curr_node->node_nrec);
cache_leaf_udata.bt2_shared = bt2_shared;
-
- /* Lock the current B-tree node */
- if (NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node->addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
+ if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node->addr, (size_t)shared->node_size, &cache_leaf_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree leaf node")
/* Set up information about current node */
diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h
index 5ffa062..21b6eee 100644
--- a/src/H5B2pkg.h
+++ b/src/H5B2pkg.h
@@ -215,13 +215,6 @@ typedef struct H5B2_internal_t {
unsigned depth; /* Depth of this node in the B-tree */
} H5B2_internal_t;
-/* User data for metadata cache 'load' callback */
-typedef struct {
- H5RC_t *bt2_shared; /* Ref counter for shared B-tree info */
- unsigned nrec; /* Number of records in node to load */
- unsigned depth; /* Depth of node to load */
-} H5B2_int_load_ud1_t;
-
#ifdef H5B2_TESTING
/* Node information for testing */
typedef struct {
diff --git a/src/H5B2stat.c b/src/H5B2stat.c
index ee9d784..8bf69ac 100644
--- a/src/H5B2stat.c
+++ b/src/H5B2stat.c
@@ -99,10 +99,9 @@ H5B2_stat_info(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type,
HDassert(H5F_addr_defined(addr));
HDassert(info);
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
diff --git a/src/H5B2test.c b/src/H5B2test.c
index f697d30..2d1144e 100644
--- a/src/H5B2test.c
+++ b/src/H5B2test.c
@@ -269,10 +269,9 @@ H5B2_get_root_addr_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type,
HDassert(H5F_addr_defined(addr));
HDassert(root_addr);
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
@@ -323,17 +322,16 @@ H5B2_get_node_info_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr
HDassert(type);
HDassert(H5F_addr_defined(addr));
+ /* Look up the B-tree header */
cache_udata.f = f;
cache_udata.type = type;
-
- /* Look up the B-tree header */
- if (NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
+ if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, (size_t)H5B2_HEADER_SIZE(f), &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header")
/* Safely grab pointer to reference counted shared B-tree info, so we can release the B-tree header if necessary */
- bt2_shared=bt2->shared;
+ bt2_shared = bt2->shared;
H5RC_INC(bt2_shared);
- incr_rc=TRUE;
+ incr_rc = TRUE;
/* Get the pointer to the shared B-tree info */
shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2_shared);
@@ -399,8 +397,12 @@ H5B2_get_node_info_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr
{
H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */
+ H5B2_leaf_cache_ud_t cache_leaf_udata; /* User-data for callback */
/* Lock B-tree leaf node */
+ cache_leaf_udata.f = f;
+ cache_leaf_udata.nrec = &(curr_node_ptr.node_nrec);
+ cache_leaf_udata.bt2_shared = bt2_shared;
if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, (size_t)shared->node_size, &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
diff --git a/src/H5C.c b/src/H5C.c
index 2203878..dd5f976 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -169,7 +169,7 @@ static void * H5C_load_entry(H5F_t * f,
const H5C_class_t * type,
haddr_t addr,
size_t len,
- void * udata_ptr);
+ void * udata);
static herr_t H5C_make_space_in_cache(H5F_t * f,
hid_t dxpl_id,
@@ -203,7 +203,7 @@ static herr_t H5C_verify_not_in_index(H5C_t * cache_ptr,
static void * H5C_epoch_marker_deserialize(haddr_t addr,
size_t len,
const void * image_ptr,
- void * udata_ptr,
+ void * udata,
hbool_t * dirty_ptr);
static herr_t H5C_epoch_marker_image_len(const void * thing,
size_t *image_len_ptr);
@@ -250,7 +250,7 @@ static void *
H5C_epoch_marker_deserialize(haddr_t UNUSED addr,
size_t UNUSED len,
const void UNUSED * image_ptr,
- void UNUSED * udata_ptr,
+ void UNUSED * udata,
hbool_t UNUSED * dirty_ptr)
{
void * ret_value = NULL; /* Return value */
@@ -8586,7 +8586,7 @@ H5C_load_entry(H5F_t * f,
const H5C_class_t * type,
haddr_t addr,
size_t len,
- void * udata_ptr)
+ void * udata)
{
hbool_t dirty = FALSE;
void * image_ptr = NULL;
@@ -8652,7 +8652,7 @@ H5C_load_entry(H5F_t * f,
HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "Can't read image*")
}
- thing = type->deserialize(addr, len, image_ptr, udata_ptr, &dirty);
+ thing = type->deserialize(addr, len, image_ptr, udata, &dirty);
if ( thing == NULL ) {
@@ -8701,7 +8701,7 @@ H5C_load_entry(H5F_t * f,
}
thing = type->deserialize(addr, new_len, image_ptr,
- udata_ptr, &dirty);
+ udata, &dirty);
if ( thing == NULL ) {
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 7755c75..e824c26 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -60,11 +60,7 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
#include "H5MFprivate.h" /* File space management */
-#include "H5MMprivate.h" /* Memory management */
#include "H5Oprivate.h" /* Object headers */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5Sprivate.h" /* Dataspaces */
-#include "H5SLprivate.h" /* Skip lists */
#include "H5Vprivate.h" /* Vector and array functions */
/****************/
diff --git a/src/H5F.c b/src/H5F.c
index 8194c25..99a4bb3 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1728,8 +1728,8 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags)
{
unsigned nerrors = 0; /* Errors from nested flushes */
unsigned i; /* Index variable */
- unsigned int H5AC1_flags; /* translated flags for H5AC1_flush() */
- unsigned int H5AC_flags; /* translated flags for H5AC_flush() */
+ unsigned int H5AC1_flags; /* translated flags for H5AC1_flush() */
+ unsigned int H5AC_flags; /* translated flags for H5AC_flush() */
herr_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5F_flush)
diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c
index 5aa1a12..6c30065 100644
--- a/src/H5FDmpiposix.c
+++ b/src/H5FDmpiposix.c
@@ -38,7 +38,7 @@
#include "H5private.h" /* Generic Functions */
-#include "H5AC1private.h" /* Metadata cache */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index 9930223..cbc7efa 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -234,11 +234,10 @@ HDfprintf(stderr, "%s: New section info, addr = %a, size = %Hu\n", FUNC, fspace-
HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %a\n", FUNC, fspace->sect_addr);
#endif /* QAK */
+ /* Protect the free space sections */
cache_udata.fspace = fspace;
cache_udata.f = f;
cache_udata.dxpl_id = dxpl_id;
-
- /* Protect the free space sections */
if(NULL == (sinfo = H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, (size_t)fspace->alloc_sect_size, &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, NULL, "unable to load free space sections")
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 134aedd..ca14ec1 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -31,7 +31,6 @@
#include "H5Fpkg.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
#include "H5SMprivate.h" /* Shared Object Header Messages */
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 1b47959..fb6ddd2 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -743,7 +743,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key
/*
* Load the symbol table node for exclusive access.
*/
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), (void *)f, H5AC_READ)))
+ if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), f, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node")
/* Get base address of heap */
@@ -849,7 +849,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr,
/*
* Load the symbol node.
*/
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), (void *)f, H5AC_WRITE)))
+ if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), f, H5AC_WRITE)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node")
/* Get base address of heap */
@@ -892,7 +892,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr,
if(H5G_node_create(f, dxpl_id, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node")
- if(NULL == (snrt = H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, H5G_node_size_real(f), (void *)f, H5AC_WRITE)))
+ if(NULL == (snrt = H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, H5G_node_size_real(f), f, H5AC_WRITE)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node")
HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f),
@@ -1006,7 +1006,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/,
HDassert(udata && udata->common.heap);
/* Load the symbol table */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), (void *)f, H5AC_WRITE)))
+ if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), f, H5AC_WRITE)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node")
/* "Normal" removal of a single entry from the symbol table node */
@@ -1216,7 +1216,7 @@ H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t ad
HDassert(udata && udata->heap);
/* Protect the symbol table node & local heap while we iterate over entries */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), (void *)f, H5AC_READ)))
+ if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), f, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node")
/*
@@ -1293,7 +1293,7 @@ H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr
HDassert(num_objs);
/* Find the object node and add the number of symbol entries. */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), (void *)f, H5AC_READ)))
+ if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), f, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node")
*num_objs += sn->nsyms;
@@ -1338,7 +1338,7 @@ H5G_node_by_idx(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t add
HDassert(udata);
/* Get a pointer to the symbol table node */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), (void *)f, H5AC_READ)))
+ if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), f, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node");
/* Find the node, locate the object symbol table entry and retrieve the name */
@@ -1476,7 +1476,7 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
HDassert(udata);
/* load the symbol table into memory from the source file */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), (void *)f, H5AC_READ)))
+ if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), f, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node")
/* get the base address of the heap */
@@ -1611,7 +1611,7 @@ H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_
* Save information about the symbol table node since we can't lock it
* because we're about to call an application function.
*/
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), (void *)f, H5AC_READ)))
+ if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), f, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node")
/* Check if the link table needs to be extended */
@@ -1725,7 +1725,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent,
* If we couldn't load the symbol table node, then try loading the
* B-tree node.
*/
- if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), (void *)f, H5AC_READ))) {
+ if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, H5G_node_size_real(f), f, H5AC_READ))) {
H5G_bt_common_t udata; /*data to pass through B-tree */
H5E_clear_stack(NULL); /* discard that error */
diff --git a/src/H5HF.c b/src/H5HF.c
index 26f935b..b72ddd3 100644
--- a/src/H5HF.c
+++ b/src/H5HF.c
@@ -187,6 +187,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
fh->hdr = hdr;
if(H5HF_hdr_incr(fh->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header")
+
/* Increment # of files using this heap header */
if(H5HF_hdr_fuse_incr(fh->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header")
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index 990c44c..8fc5d14 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -978,12 +978,12 @@ H5HF_cache_dblock_deserialize(haddr_t addr, size_t len, const void *image,
void *_udata, hbool_t *dirty)
{
H5HF_dblock_cache_ud_t *udata = (H5HF_dblock_cache_ud_t *)_udata; /* pointer to user data */
- H5HF_hdr_t *hdr; /* Shared fractal heap information */
- H5HF_parent_t *par_info; /* Pointer to parent information */
- H5HF_direct_t *dblock = NULL; /* Direct block info */
- const uint8_t *p; /* Pointer into raw data buffer */
- haddr_t heap_addr; /* Address of heap header in the file */
- H5HF_direct_t *ret_value; /* Return value */
+ H5HF_hdr_t *hdr; /* Shared fractal heap information */
+ H5HF_parent_t *par_info; /* Pointer to parent information */
+ H5HF_direct_t *dblock = NULL; /* Direct block info */
+ const uint8_t *p; /* Pointer into raw data buffer */
+ haddr_t heap_addr; /* Address of heap header in the file */
+ H5HF_direct_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_deserialize)
@@ -1000,10 +1000,8 @@ H5HF_cache_dblock_deserialize(haddr_t addr, size_t len, const void *image,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HDmemset(&dblock->cache_info, 0, sizeof(H5AC_info_t));
-
- par_info = (H5HF_parent_t *)(&(udata->par_info));
-
/* Get the pointer to the shared heap header */
+ par_info = (H5HF_parent_t *)(&(udata->par_info));
hdr = par_info->hdr;
/* Set the shared heap header's file context for this operation */
diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c
index a751231..893ced8 100644
--- a/src/H5HFdblock.c
+++ b/src/H5HFdblock.c
@@ -475,11 +475,13 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr,
udata.filter_mask = par_iblock->filt_ents[par_entry].filter_mask;
} /* end else */
} /* end if */
- else
+ else {
odi_size = dblock_size;
+ udata.filter_mask = 0;
+ } /* end else */
/* Protect the direct block */
- if(NULL == (dblock = H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, odi_size, (void *)&udata, rw)))
+ if(NULL == (dblock = H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, odi_size, &udata, rw)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap direct block")
/* Set the return value */
diff --git a/src/H5HFman.c b/src/H5HFman.c
index add8efd..2bc9778 100644
--- a/src/H5HFman.c
+++ b/src/H5HFman.c
@@ -213,7 +213,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id,
H5HF_operator_t op, void *op_data, unsigned op_flags)
{
H5HF_direct_t *dblock = NULL; /* Pointer to direct block to query */
- H5AC_protect_t dblock_access; /* Access method for direct block */
+ H5AC_protect_t dblock_access; /* Access method for direct block */
haddr_t dblock_addr; /* Direct block address */
size_t dblock_size; /* Direct block size */
unsigned dblock_cache_flags; /* Flags for unprotecting direct block */
diff --git a/test/cache.c b/test/cache.c
index cff73dc..1743021 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -9809,7 +9809,6 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
( cache_ptr->index_size != init_expected_index_size ) ) {
pass = FALSE;
- pass = FALSE;
HDsnprintf(msg, (size_t)128,
"Unexpected cache len/size before flush in flush op test #%d.",
test_num);