diff options
Diffstat (limited to 'src/H5B.c')
-rw-r--r-- | src/H5B.c | 110 |
1 files changed, 55 insertions, 55 deletions
@@ -134,7 +134,7 @@ typedef struct H5B_iter_ud_t { } H5B_info_ud_t; /* Convenience struct for the arguments needed to unprotect a b-tree after a - * call to H5B_iterate_helper() or H5B_split() */ + * call to H5B__iterate_helper() or H5B__split() */ typedef struct H5B_ins_ud_t { H5B_t *bt; /* B-tree */ haddr_t addr; /* B-tree address */ @@ -145,7 +145,7 @@ typedef struct H5B_ins_ud_t { /********************/ /* Local Prototypes */ /********************/ -static H5B_ins_t H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, +static H5B_ins_t H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8_t *lt_key, hbool_t *lt_key_changed, @@ -153,13 +153,13 @@ static H5B_ins_t H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, uint8_t *rt_key, hbool_t *rt_key_changed, H5B_ins_ud_t *split_bt_ud/*out*/); -static herr_t H5B_insert_child(H5B_t *bt, unsigned *bt_flags, +static herr_t H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key); -static herr_t H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, +static herr_t H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_t *split_bt_ud/*out*/); -static H5B_t * H5B_copy(const H5B_t *old_bt); +static H5B_t * H5B__copy(const H5B_t *old_bt); /*********************/ @@ -258,7 +258,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, if(H5AC_insert_entry(f, dxpl_id, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache") #ifdef H5B_DEBUG - H5B_assert(f, dxpl_id, *addr_p, shared->type, udata); + H5B__assert(f, dxpl_id, *addr_p, shared->type, udata); #endif done: @@ -269,7 +269,7 @@ done: } /* end if */ if(bt) /* Destroy B-tree node */ - if(H5B_node_dest(bt) < 0) + if(H5B__node_dest(bt) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") } /* end if */ @@ -375,7 +375,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B_split + * Function: H5B__split * * Purpose: Split a single node into two nodes. The old node will * contain the left children and the new node will contain the @@ -397,7 +397,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, +H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_t *split_bt_ud/*out*/) { H5P_genplist_t *dx_plist; /* Data transfer property list */ @@ -407,7 +407,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, double split_ratios[3]; /* B-tree split ratios */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -446,7 +446,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, side = "LEFT"; else side = "MIDDLE"; - fprintf(H5DEBUG(B), "H5B_split: %3u {%5.3f,%5.3f,%5.3f} %6s", + fprintf(H5DEBUG(B), "H5B__split: %3u {%5.3f,%5.3f,%5.3f} %6s", shared->two_k, split_ratios[0], split_ratios[1], split_ratios[2], side); } #endif @@ -539,7 +539,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_split() */ +} /* end H5B__split() */ /*------------------------------------------------------------------------- @@ -601,7 +601,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to locate root of B-tree") /* Insert the object */ - if((int)(my_ins = H5B_insert_helper(f, dxpl_id, &bt_ud, type, lt_key, + if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &bt_ud, type, lt_key, <_key_changed, md_key, udata, rt_key, &rt_key_changed, &split_bt_ud/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key") @@ -638,7 +638,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void */ /* Make a copy of the old root information */ - if(NULL == (new_root_bt = H5B_copy(bt_ud.bt))) + if(NULL == (new_root_bt = H5B__copy(bt_ud.bt))) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to copy old root") /* Unprotect the old root so we can move it. Also force it to be marked @@ -677,7 +677,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void done: if(ret_value < 0) - if(new_root_bt && H5B_node_dest(new_root_bt) < 0) + if(new_root_bt && H5B__node_dest(new_root_bt) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, FAIL, "unable to free B-tree root node"); if(bt_ud.bt) @@ -690,7 +690,7 @@ done: #ifdef H5B_DEBUG if(ret_value >= 0) - H5B_assert(f, dxpl_id, addr, type, udata); + H5B__assert(f, dxpl_id, addr, type, udata); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -698,7 +698,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B_insert_child + * Function: H5B__insert_child * * Purpose: Insert a child to the left or right of child[IDX] depending * on whether ANCHOR is H5B_INS_LEFT or H5B_INS_RIGHT. The BT @@ -713,13 +713,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, +H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key) { H5B_shared_t *shared; /* Pointer to shared B-tree info */ uint8_t *base; /* Base offset for move */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(bt); HDassert(bt_flags); @@ -771,7 +771,7 @@ H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, /*------------------------------------------------------------------------- - * Function: H5B_insert_helper + * Function: H5B__insert_helper * * Purpose: Inserts the item UDATA into the tree rooted at ADDR and having * the specified type. @@ -802,7 +802,7 @@ H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, *------------------------------------------------------------------------- */ static H5B_ins_t -H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, +H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8_t *lt_key, hbool_t *lt_key_changed, uint8_t *md_key, void *udata, @@ -820,7 +820,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, H5B_ins_t my_ins = H5B_INS_ERROR; H5B_ins_t ret_value = H5B_INS_ERROR; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments @@ -904,7 +904,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B_insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, H5B_NKEY(bt,shared,idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) @@ -950,7 +950,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B_insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) @@ -1005,7 +1005,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B_insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert subtree") @@ -1064,7 +1064,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * If this node is full then split it before inserting the new child. */ if(bt->nchildren == shared->two_k) { - if(H5B_split(f, dxpl_id, bt_ud, idx, udata, split_bt_ud/*out*/) < 0) + if(H5B__split(f, dxpl_id, bt_ud, idx, udata, split_bt_ud/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, H5B_INS_ERROR, "unable to split node") if(idx < bt->nchildren) { tmp_bt = bt; @@ -1081,7 +1081,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, } /* end else */ /* Insert the child */ - if(H5B_insert_child(tmp_bt, tmp_bt_flags_ptr, idx, new_child_bt_ud.addr, my_ins, md_key) < 0) + if(H5B__insert_child(tmp_bt, tmp_bt_flags_ptr, idx, new_child_bt_ud.addr, my_ins, md_key) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert child") } /* end else-if */ @@ -1119,7 +1119,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B_iterate_helper + * Function: H5B__iterate_helper * * Purpose: Calls the list callback for each leaf node of the * B-tree, passing it the caller's UDATA structure. @@ -1133,7 +1133,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B__iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ @@ -1143,7 +1143,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add unsigned u; /* Local index variable */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -1170,7 +1170,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add /* Iterate over node's children */ for(u = 0; u < bt->nchildren && ret_value == H5_ITER_CONT; u++) { if(bt->level > 0) - ret_value = H5B_iterate_helper(f, dxpl_id, type, bt->child[u], op, udata); + ret_value = H5B__iterate_helper(f, dxpl_id, type, bt->child[u], op, udata); else ret_value = (*op)(f, dxpl_id, H5B_NKEY(bt, shared, u), bt->child[u], H5B_NKEY(bt, shared, u + 1), udata); if(ret_value < 0) @@ -1182,7 +1182,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_iterate_helper() */ +} /* end H5B__iterate_helper() */ /*------------------------------------------------------------------------- @@ -1217,7 +1217,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HDassert(udata); /* Iterate over the B-tree records */ - if((ret_value = H5B_iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) + if((ret_value = H5B__iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); FUNC_LEAVE_NOAPI(ret_value) @@ -1225,7 +1225,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, /*------------------------------------------------------------------------- - * Function: H5B_remove_helper + * Function: H5B__remove_helper * * Purpose: The recursive part of removing an item from a B-tree. The * sub B-tree that is being considered is located at ADDR and @@ -1249,7 +1249,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, *------------------------------------------------------------------------- */ static H5B_ins_t -H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, +H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, int level, uint8_t *lt_key/*out*/, hbool_t *lt_key_changed/*out*/, void *udata, uint8_t *rt_key/*out*/, hbool_t *rt_key_changed/*out*/) @@ -1263,7 +1263,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type int cmp = 1; /* Key comparison value */ H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI(H5B_INS_ERROR) + FUNC_ENTER_STATIC HDassert(f); HDassert(H5F_addr_defined(addr)); @@ -1308,7 +1308,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDassert(idx < bt->nchildren); if(bt->level > 0) { /* We're at an internal node -- call recursively */ - if((int)(ret_value = H5B_remove_helper(f, dxpl_id, + if((int)(ret_value = H5B__remove_helper(f, dxpl_id, bt->child[idx], type, level + 1, H5B_NKEY(bt, shared, idx)/*out*/, lt_key_changed/*out*/, udata, H5B_NKEY(bt, shared, idx + 1)/*out*/, rt_key_changed/*out*/)) < 0) @@ -1555,7 +1555,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_remove_helper() */ +} /* end H5B__remove_helper() */ /*------------------------------------------------------------------------- @@ -1594,12 +1594,12 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HDassert(H5F_addr_defined(addr)); /* The actual removal */ - if(H5B_remove_helper(f, dxpl_id, addr, type, 0, lt_key, <_key_changed, + if(H5B__remove_helper(f, dxpl_id, addr, type, 0, lt_key, <_key_changed, udata, rt_key, &rt_key_changed) == H5B_INS_ERROR) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree") #ifdef H5B_DEBUG - H5B_assert(f, dxpl_id, addr, type, udata); + H5B__assert(f, dxpl_id, addr, type, udata); #endif done: FUNC_LEAVE_NOAPI(ret_value) @@ -1789,7 +1789,7 @@ H5B_shared_free(void *_shared) /*------------------------------------------------------------------------- - * Function: H5B_copy + * Function: H5B__copy * * Purpose: Deep copies an existing H5B_t node. * @@ -1804,13 +1804,13 @@ H5B_shared_free(void *_shared) *------------------------------------------------------------------------- */ static H5B_t * -H5B_copy(const H5B_t *old_bt) +H5B__copy(const H5B_t *old_bt) { H5B_t *new_node = NULL; H5B_shared_t *shared; /* Pointer to shared B-tree info */ H5B_t *ret_value; - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC /* * Check arguments. @@ -1853,11 +1853,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_copy() */ +} /* end H5B__copy() */ /*------------------------------------------------------------------------- - * Function: H5B_get_info_helper + * Function: H5B__get_info_helper * * Purpose: Walks the B-tree nodes, getting information for all of them. * @@ -1870,7 +1870,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, const H5B_info_ud_t *info_udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ @@ -1883,7 +1883,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad haddr_t left_child; /* Address of left-most child in node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -1951,7 +1951,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad /* Check for another "row" of B-tree nodes to iterate over */ if(level > 0) { /* Keep following the left-most child until we reach a leaf node. */ - if(H5B_get_info_helper(f, dxpl_id, type, left_child, info_udata) < 0) + if(H5B__get_info_helper(f, dxpl_id, type, left_child, info_udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "unable to list B-tree node") } /* end if */ @@ -1960,7 +1960,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_get_info_helper() */ +} /* end H5B__get_info_helper() */ /*------------------------------------------------------------------------- @@ -2001,13 +2001,13 @@ H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, info_udata.udata = udata; /* Iterate over the B-tree nodes */ - if(H5B_get_info_helper(f, dxpl_id, type, addr, &info_udata) < 0) + if(H5B__get_info_helper(f, dxpl_id, type, addr, &info_udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_BADITER, FAIL, "B-tree iteration failed") /* Iterate over the B-tree records, making any "leaf" callbacks */ /* (Only if operator defined) */ if(op) - if((ret_value = H5B_iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) + if((ret_value = H5B__iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); done: @@ -2072,7 +2072,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B_node_dest + * Function: H5B__node_dest * * Purpose: Destroy/release a B-tree node * @@ -2086,9 +2086,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_node_dest(H5B_t *bt) +H5B__node_dest(H5B_t *bt) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* check arguments */ HDassert(bt); @@ -2100,5 +2100,5 @@ H5B_node_dest(H5B_t *bt) bt = H5FL_FREE(H5B_t, bt); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5B_node_dest() */ +} /* end H5B__node_dest() */ |