summaryrefslogtreecommitdiffstats
path: root/src/H5B2dbg.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-10-23 20:11:11 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-10-23 20:11:11 (GMT)
commit663919aa50f3c1d270239e06794c3fc6fff1ad9f (patch)
treee216367ffb327004461dd832c46b10044979cd21 /src/H5B2dbg.c
parent7fcd1375d81540e10f96c39d2ded53e34a3fe474 (diff)
downloadhdf5-663919aa50f3c1d270239e06794c3fc6fff1ad9f.zip
hdf5-663919aa50f3c1d270239e06794c3fc6fff1ad9f.tar.gz
hdf5-663919aa50f3c1d270239e06794c3fc6fff1ad9f.tar.bz2
[svn-r17738] Description:
Bring revisions 17649, 17657 and 17658 from trunk to 1.8 branch: 17649: Refactor v2 B-trees to pin the B-tree header in the cache instead of using separate reference counted data structure. 17657: Refactor the v2 B-tree code to use an open & close call internally, in preparation for making those part of the library private APIs for dealing with v2 B-trees. 17658: Rename 'H5B2_t' -> 'H5B2_hdr_t' and 'bt2' -> 'hdr' in preparation for make v2 B-tree open/close routines library private (instead of static). 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.1 (amazon) in debug mode Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5B2dbg.c')
-rw-r--r--src/H5B2dbg.c177
1 files changed, 87 insertions, 90 deletions
diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c
index 836486e..4bc5421 100644
--- a/src/H5B2dbg.c
+++ b/src/H5B2dbg.c
@@ -90,10 +90,9 @@ herr_t
H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth,
const H5B2_class_t *type)
{
- H5B2_t *bt2 = NULL; /* B-tree header info */
- H5B2_shared_t *shared; /* Shared B-tree information */
+ H5B2_hdr_t *hdr = NULL; /* B-tree header info */
unsigned u; /* Local index variable */
- char temp_str[128]; /* Temporary string, for formatting */
+ char temp_str[128]; /* Temporary string, for formatting */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5B2_hdr_debug, FAIL)
@@ -111,12 +110,11 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
/*
* Load the B-tree header.
*/
- if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, type, NULL, H5AC_READ)))
+ if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, type, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header")
- /* Get the pointer to the shared B-tree info */
- shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2->shared);
- HDassert(shared);
+ /* Set file pointer for this B-tree operation */
+ hdr->f = f;
/* Print opening message */
HDfprintf(stream, "%*sv2 B-tree Header...\n", indent, "");
@@ -126,57 +124,60 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
*/
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Tree type ID:",
- (shared->type->id == H5B2_TEST_ID ? "H5B2_TEST_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_INDIR_ID ? "H5B2_FHEAP_HUGE_INDIR_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_FILT_INDIR_ID ? "H5B2_FHEAP_HUGE_FILT_INDIR_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_DIR_ID ? "H5B2_FHEAP_HUGE_DIR_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_FILT_DIR_ID ? "H5B2_FHEAP_HUGE_FILT_DIR_ID" :
- (shared->type->id == H5B2_GRP_DENSE_NAME_ID ? "H5B2_GRP_DENSE_NAME_ID" :
- (shared->type->id == H5B2_GRP_DENSE_CORDER_ID ? "H5B2_GRP_DENSE_CORDER_ID" :
- (shared->type->id == H5B2_SOHM_INDEX_ID ? "H5B2_SOHM_INDEX_ID" :
- (shared->type->id == H5B2_ATTR_DENSE_NAME_ID ? "H5B2_ATTR_DENSE_NAME_ID" :
- (shared->type->id == H5B2_ATTR_DENSE_CORDER_ID ? "H5B2_ATTR_DENSE_CORDER_ID" :
+ (hdr->type->id == H5B2_TEST_ID ? "H5B2_TEST_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_INDIR_ID ? "H5B2_FHEAP_HUGE_INDIR_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_FILT_INDIR_ID ? "H5B2_FHEAP_HUGE_FILT_INDIR_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_DIR_ID ? "H5B2_FHEAP_HUGE_DIR_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_FILT_DIR_ID ? "H5B2_FHEAP_HUGE_FILT_DIR_ID" :
+ (hdr->type->id == H5B2_GRP_DENSE_NAME_ID ? "H5B2_GRP_DENSE_NAME_ID" :
+ (hdr->type->id == H5B2_GRP_DENSE_CORDER_ID ? "H5B2_GRP_DENSE_CORDER_ID" :
+ (hdr->type->id == H5B2_SOHM_INDEX_ID ? "H5B2_SOHM_INDEX_ID" :
+ (hdr->type->id == H5B2_ATTR_DENSE_NAME_ID ? "H5B2_ATTR_DENSE_NAME_ID" :
+ (hdr->type->id == H5B2_ATTR_DENSE_CORDER_ID ? "H5B2_ATTR_DENSE_CORDER_ID" :
"Unknown!")))))))))));
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
"Size of node:",
- shared->node_size);
+ hdr->node_size);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
"Size of raw (disk) record:",
- shared->rrec_size);
+ hdr->rrec_size);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Dirty flag:",
- bt2->cache_info.is_dirty ? "True" : "False");
+ hdr->cache_info.is_dirty ? "True" : "False");
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Depth:",
- shared->depth);
+ hdr->depth);
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
"Number of records in tree:",
- bt2->root.all_nrec);
+ hdr->root.all_nrec);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Number of records in root node:",
- bt2->root.node_nrec);
+ hdr->root.node_nrec);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
"Address of root node:",
- bt2->root.addr);
+ hdr->root.addr);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Split percent:",
- shared->split_percent);
+ hdr->split_percent);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Merge percent:",
- shared->merge_percent);
+ hdr->merge_percent);
/* Print relevant node info */
HDfprintf(stream, "%*sNode Info: (max_nrec/split_nrec/merge_nrec)\n", indent, "");
- for(u = 0; u < (shared->depth + 1); u++) {
+ for(u = 0; u < (hdr->depth + 1); u++) {
sprintf(temp_str, "Depth %u:", u);
HDfprintf(stream, "%*s%-*s (%u/%u/%u)\n", indent + 3, "", MAX(0, fwidth - 3),
temp_str,
- shared->node_info[u].max_nrec, shared->node_info[u].split_nrec, shared->node_info[u].merge_nrec);
+ hdr->node_info[u].max_nrec, hdr->node_info[u].split_nrec, hdr->node_info[u].merge_nrec);
} /* end for */
done:
- if(bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0)
- HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header")
+ if(hdr) {
+ hdr->f = NULL;
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0)
+ HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header")
+ } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_debug() */
@@ -199,11 +200,10 @@ herr_t
H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth,
const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth)
{
- H5B2_t *bt2 = NULL;
- H5B2_internal_t *internal = NULL;
- H5B2_shared_t *shared; /* Shared B-tree information */
- unsigned u; /* Local index variable */
- char temp_str[128]; /* Temporary string, for formatting */
+ H5B2_hdr_t *hdr = NULL; /* B-tree header */
+ H5B2_internal_t *internal = NULL; /* B-tree internal node */
+ unsigned u; /* Local index variable */
+ char temp_str[128]; /* Temporary string, for formatting */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5B2_int_debug, FAIL)
@@ -223,24 +223,18 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
/*
* Load the B-tree header.
*/
- if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, type, NULL, H5AC_READ)))
+ if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, type, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header")
- /* Get the pointer to the shared B-tree info */
- shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2->shared);
- HDassert(shared);
+ /* Set file pointer for this B-tree operation */
+ hdr->f = f;
/*
* Load the B-tree internal node
*/
- if(NULL == (internal = H5B2_protect_internal(f, dxpl_id, bt2->shared, addr, nrec, depth, H5AC_READ)))
+ if(NULL == (internal = H5B2_protect_internal(f, dxpl_id, hdr, addr, nrec, depth, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node")
- /* Release the B-tree header */
- if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, bt2, H5AC__NO_FLAGS_SET) < 0)
- HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header")
- bt2 = NULL;
-
/* Print opening message */
if(internal->depth == 1)
HDfprintf(stream, "%*sv2 B-tree Internal 'Leaf' Node...\n", indent, "");
@@ -252,23 +246,23 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
*/
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Tree type ID:",
- (shared->type->id == H5B2_TEST_ID ? "H5B2_TEST_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_INDIR_ID ? "H5B2_FHEAP_HUGE_INDIR_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_FILT_INDIR_ID ? "H5B2_FHEAP_HUGE_FILT_INDIR_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_DIR_ID ? "H5B2_FHEAP_HUGE_DIR_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_FILT_DIR_ID ? "H5B2_FHEAP_HUGE_FILT_DIR_ID" :
- (shared->type->id == H5B2_GRP_DENSE_NAME_ID ? "H5B2_GRP_DENSE_NAME_ID" :
- (shared->type->id == H5B2_GRP_DENSE_CORDER_ID ? "H5B2_GRP_DENSE_CORDER_ID" :
- (shared->type->id == H5B2_SOHM_INDEX_ID ? "H5B2_SOHM_INDEX_ID" :
- (shared->type->id == H5B2_ATTR_DENSE_NAME_ID ? "H5B2_ATTR_DENSE_NAME_ID" :
- (shared->type->id == H5B2_ATTR_DENSE_CORDER_ID ? "H5B2_ATTR_DENSE_CORDER_ID" :
+ (hdr->type->id == H5B2_TEST_ID ? "H5B2_TEST_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_INDIR_ID ? "H5B2_FHEAP_HUGE_INDIR_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_FILT_INDIR_ID ? "H5B2_FHEAP_HUGE_FILT_INDIR_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_DIR_ID ? "H5B2_FHEAP_HUGE_DIR_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_FILT_DIR_ID ? "H5B2_FHEAP_HUGE_FILT_DIR_ID" :
+ (hdr->type->id == H5B2_GRP_DENSE_NAME_ID ? "H5B2_GRP_DENSE_NAME_ID" :
+ (hdr->type->id == H5B2_GRP_DENSE_CORDER_ID ? "H5B2_GRP_DENSE_CORDER_ID" :
+ (hdr->type->id == H5B2_SOHM_INDEX_ID ? "H5B2_SOHM_INDEX_ID" :
+ (hdr->type->id == H5B2_ATTR_DENSE_NAME_ID ? "H5B2_ATTR_DENSE_NAME_ID" :
+ (hdr->type->id == H5B2_ATTR_DENSE_CORDER_ID ? "H5B2_ATTR_DENSE_CORDER_ID" :
"Unknown!")))))))))));
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
"Size of node:",
- shared->node_size);
+ hdr->node_size);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
"Size of raw (disk) record:",
- shared->rrec_size);
+ hdr->rrec_size);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Dirty flag:",
internal->cache_info.is_dirty ? "True" : "False");
@@ -290,9 +284,9 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
sprintf(temp_str, "Record #%u:", u);
HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3),
temp_str);
- HDassert(H5B2_INT_NREC(internal, shared, u));
+ HDassert(H5B2_INT_NREC(internal, hdr, u));
(void)(type->debug)(stream, f, dxpl_id, indent + 6, MAX (0, fwidth-6),
- H5B2_INT_NREC(internal,shared,u), NULL);
+ H5B2_INT_NREC(internal, hdr, u), NULL);
} /* end for */
/* Print final node pointer */
@@ -304,6 +298,11 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
internal->node_ptrs[u].addr);
done:
+ if(hdr) {
+ hdr->f = NULL;
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
+ HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header")
+ } /* end if */
if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, addr, internal, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree internal node")
@@ -328,12 +327,11 @@ herr_t
H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth,
const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec)
{
- H5B2_t *bt2 = NULL;
- H5B2_leaf_t *leaf = NULL;
- H5B2_shared_t *shared; /* Shared B-tree information */
- unsigned u; /* Local index variable */
- char temp_str[128]; /* Temporary string, for formatting */
- herr_t ret_value=SUCCEED; /* Return value */
+ H5B2_hdr_t *hdr = NULL; /* B-tree header */
+ H5B2_leaf_t *leaf = NULL; /* B-tree leaf node */
+ unsigned u; /* Local index variable */
+ char temp_str[128]; /* Temporary string, for formatting */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5B2_leaf_debug, FAIL)
@@ -352,24 +350,18 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
/*
* Load the B-tree header.
*/
- if(NULL == (bt2 = (H5B2_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, type, NULL, H5AC_READ)))
+ if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, type, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header")
- /* Get the pointer to the shared B-tree info */
- shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2->shared);
- HDassert(shared);
+ /* Set file pointer for this B-tree operation */
+ hdr->f = f;
/*
* Load the B-tree leaf node
*/
- if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, addr, &nrec, bt2->shared, H5AC_READ)))
+ if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, addr, &nrec, hdr, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree leaf node")
- /* Release the B-tree header */
- if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, bt2, H5AC__NO_FLAGS_SET) < 0)
- HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header")
- bt2 = NULL;
-
/* Print opening message */
HDfprintf(stream, "%*sv2 B-tree Leaf Node...\n", indent, "");
@@ -378,23 +370,23 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
*/
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Tree type ID:",
- (shared->type->id == H5B2_TEST_ID ? "H5B2_TEST_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_INDIR_ID ? "H5B2_FHEAP_HUGE_INDIR_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_FILT_INDIR_ID ? "H5B2_FHEAP_HUGE_FILT_INDIR_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_DIR_ID ? "H5B2_FHEAP_HUGE_DIR_ID" :
- (shared->type->id == H5B2_FHEAP_HUGE_FILT_DIR_ID ? "H5B2_FHEAP_HUGE_FILT_DIR_ID" :
- (shared->type->id == H5B2_GRP_DENSE_NAME_ID ? "H5B2_GRP_DENSE_NAME_ID" :
- (shared->type->id == H5B2_GRP_DENSE_CORDER_ID ? "H5B2_GRP_DENSE_CORDER_ID" :
- (shared->type->id == H5B2_SOHM_INDEX_ID ? "H5B2_SOHM_INDEX_ID" :
- (shared->type->id == H5B2_ATTR_DENSE_NAME_ID ? "H5B2_ATTR_DENSE_NAME_ID" :
- (shared->type->id == H5B2_ATTR_DENSE_CORDER_ID ? "H5B2_ATTR_DENSE_CORDER_ID" :
+ (hdr->type->id == H5B2_TEST_ID ? "H5B2_TEST_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_INDIR_ID ? "H5B2_FHEAP_HUGE_INDIR_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_FILT_INDIR_ID ? "H5B2_FHEAP_HUGE_FILT_INDIR_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_DIR_ID ? "H5B2_FHEAP_HUGE_DIR_ID" :
+ (hdr->type->id == H5B2_FHEAP_HUGE_FILT_DIR_ID ? "H5B2_FHEAP_HUGE_FILT_DIR_ID" :
+ (hdr->type->id == H5B2_GRP_DENSE_NAME_ID ? "H5B2_GRP_DENSE_NAME_ID" :
+ (hdr->type->id == H5B2_GRP_DENSE_CORDER_ID ? "H5B2_GRP_DENSE_CORDER_ID" :
+ (hdr->type->id == H5B2_SOHM_INDEX_ID ? "H5B2_SOHM_INDEX_ID" :
+ (hdr->type->id == H5B2_ATTR_DENSE_NAME_ID ? "H5B2_ATTR_DENSE_NAME_ID" :
+ (hdr->type->id == H5B2_ATTR_DENSE_CORDER_ID ? "H5B2_ATTR_DENSE_CORDER_ID" :
"Unknown!")))))))))));
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
"Size of node:",
- shared->node_size);
+ hdr->node_size);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
"Size of raw (disk) record:",
- shared->rrec_size);
+ hdr->rrec_size);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Dirty flag:",
leaf->cache_info.is_dirty ? "True" : "False");
@@ -408,12 +400,17 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
sprintf(temp_str, "Record #%u:", u);
HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3),
temp_str);
- HDassert(H5B2_LEAF_NREC(leaf, shared, u));
- (void)(type->debug)(stream, f, dxpl_id, indent+6, MAX (0, fwidth-6),
- H5B2_LEAF_NREC(leaf,shared,u), NULL);
+ HDassert(H5B2_LEAF_NREC(leaf, hdr, u));
+ (void)(type->debug)(stream, f, dxpl_id, indent + 6, MAX (0, fwidth-6),
+ H5B2_LEAF_NREC(leaf, hdr, u), NULL);
} /* end for */
done:
+ if(hdr) {
+ hdr->f = NULL;
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
+ HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header")
+ } /* end if */
if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, addr, leaf, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree leaf node")