From 6d5d4ed1d10498bf776b5a4d41cf2384b4d8fe28 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 14 Nov 2009 22:38:58 -0500 Subject: [svn-r17893] Descrption: Remove old shim H5B2 routines from refactoring, rename new routines to old routine names and switch all users of the H5B2 interface back to the old routine names now that the switch to using the more current open -> -> pattern is used for all the H5B2 code. This is the final change before adding a context to the H5B2 client encode/decode callbacks. 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.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode --- src/H5Adense.c | 28 +- src/H5Aint.c | 4 +- src/H5B2.c | 641 +++------------------------------------------- src/H5B2cache.c | 18 +- src/H5B2dbg.c | 2 +- src/H5B2hdr.c | 10 +- src/H5B2int.c | 60 ++--- src/H5B2pkg.h | 69 +++-- src/H5B2private.h | 59 ++--- src/H5B2stat.c | 64 ++--- src/H5B2test.c | 228 +---------------- src/H5Gdense.c | 24 +- src/H5Gobj.c | 2 +- src/H5Goh.c | 4 +- src/H5Gtest.c | 4 +- src/H5HFhuge.c | 26 +- src/H5HFstat.c | 2 +- src/H5Oattribute.c | 4 +- src/H5Otest.c | 8 +- src/H5SM.c | 18 +- test/btree2.c | 734 ++++++++++++++++++++++++++--------------------------- 21 files changed, 599 insertions(+), 1410 deletions(-) diff --git a/src/H5Adense.c b/src/H5Adense.c index 7ff8a97..c9da207 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -246,7 +246,7 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); H5O_FHEAP_ID_LEN; /* Fractal heap ID */ bt2_cparam.split_percent = H5A_NAME_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5A_NAME_BT2_MERGE_PERC; - if(NULL == (bt2_name = H5B2_create_2(f, dxpl_id, &bt2_cparam))) + if(NULL == (bt2_name = H5B2_create(f, dxpl_id, &bt2_cparam))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for name index") /* Retrieve the v2 B-tree's address in the file */ @@ -267,7 +267,7 @@ HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr) H5O_FHEAP_ID_LEN; /* Fractal heap ID */ bt2_cparam.split_percent = H5A_CORDER_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5A_CORDER_BT2_MERGE_PERC; - if(NULL == (bt2_corder = H5B2_create_2(f, dxpl_id, &bt2_cparam))) + if(NULL == (bt2_corder = H5B2_create(f, dxpl_id, &bt2_cparam))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for creation order index") /* Retrieve the v2 B-tree's address in the file */ @@ -399,7 +399,7 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na udata.found_op_data = &ret_value; /* Find & copy the attribute in the 'name' index */ - if((attr_exists = H5B2_find_2(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((attr_exists = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't search for attribute in name index") else if(attr_exists == FALSE) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute in name index") @@ -545,7 +545,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) /* udata.id already set */ /* Insert attribute into 'name' tracking v2 B-tree */ - if(H5B2_insert_2(bt2_name, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_name, dxpl_id, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") /* Check if we should create a creation order index v2 B-tree record */ @@ -556,7 +556,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Insert the record into the creation order index v2 B-tree */ - if(H5B2_insert_2(bt2_corder, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_corder, dxpl_id, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") } /* end if */ @@ -676,7 +676,7 @@ H5A_dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) udata.found_op_data = NULL; /* Modify record for creation order index */ - if(H5B2_modify_2(bt2_corder, op_data->dxpl_id, &udata, H5A_dense_write_bt2_cb2, &op_data->attr->sh_loc.u.heap_id) < 0) + if(H5B2_modify(bt2_corder, op_data->dxpl_id, &udata, H5A_dense_write_bt2_cb2, &op_data->attr->sh_loc.u.heap_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to modify record in v2 B-tree") } /* end if */ @@ -814,7 +814,7 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) op_data.corder_bt2_addr = ainfo->corder_bt2_addr; /* Modify attribute through 'name' tracking v2 B-tree */ - if(H5B2_modify_2(bt2_name, dxpl_id, &udata, H5A_dense_write_bt2_cb, &op_data) < 0) + if(H5B2_modify(bt2_name, dxpl_id, &udata, H5A_dense_write_bt2_cb, &op_data) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to modify record in v2 B-tree") done: @@ -952,7 +952,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * udata.found_op_data = &attr_copy; /* Get copy of attribute through 'name' tracking v2 B-tree */ - if((attr_exists = H5B2_find_2(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((attr_exists = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") else if(attr_exists == FALSE) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute in name index") @@ -1231,7 +1231,7 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf /* Iterate over the records in the v2 B-tree's "native" order */ /* (by hash of name) */ - if((ret_value = H5B2_iterate_2(bt2, dxpl_id, H5A_dense_iterate_bt2_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, dxpl_id, H5A_dense_iterate_bt2_cb, &udata)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "attribute iteration failed"); /* Update the last attribute examined, if requested */ @@ -1298,7 +1298,7 @@ H5A_dense_remove_bt2_cb(const void *_record, void *_udata) udata->common.corder = attr->shared->crt_idx; /* Remove the record from the creation order index v2 B-tree */ - if(H5B2_remove_2(bt2_corder, udata->common.dxpl_id, udata, NULL, NULL) < 0) + if(H5B2_remove(bt2_corder, udata->common.dxpl_id, udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from creation order index v2 B-tree") } /* end if */ @@ -1401,7 +1401,7 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * udata.corder_bt2_addr = ainfo->corder_bt2_addr; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_2(bt2_name, dxpl_id, &udata, H5A_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_remove(bt2_name, dxpl_id, &udata, H5A_dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from name index v2 B-tree") done: @@ -1506,7 +1506,7 @@ H5A_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set the common information for the v2 B-tree remove operation */ /* Remove the record from the "other" index v2 B-tree */ - if(H5B2_remove_2(bt2, bt2_udata->dxpl_id, &other_bt2_udata, NULL, NULL) < 0) + if(H5B2_remove(bt2, bt2_udata->dxpl_id, &other_bt2_udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove record from 'other' index v2 B-tree") } /* end if */ @@ -1644,7 +1644,7 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, udata.other_bt2_addr = idx_type == H5_INDEX_NAME ? ainfo->corder_bt2_addr : ainfo->name_bt2_addr; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_by_idx_2(bt2, dxpl_id, order, n, H5A_dense_remove_by_idx_bt2_cb, &udata) < 0) + if(H5B2_remove_by_idx(bt2, dxpl_id, order, n, H5A_dense_remove_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from v2 B-tree index") } /* end if */ else { @@ -1751,7 +1751,7 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * udata.found_op_data = NULL; /* Find the attribute in the 'name' index */ - if((ret_value = H5B2_find_2(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((ret_value = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") done: diff --git a/src/H5Aint.c b/src/H5Aint.c index 7115b52..ab1d32c 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -333,7 +333,7 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, /* Retrieve # of records in "name" B-tree */ /* (should be same # of records in all indices) */ - if(H5B2_get_nrec_2(bt2_name, &nrec) < 0) + if(H5B2_get_nrec(bt2_name, &nrec) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve # of records in index") /* Set size of table */ @@ -729,7 +729,7 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) /* Retrieve # of records in "name" B-tree */ /* (should be same # of records in all indices) */ - if(H5B2_get_nrec_2(bt2_name, &ainfo->nattrs) < 0) + if(H5B2_get_nrec(bt2_name, &ainfo->nattrs) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve # of records in index") } /* end if */ else diff --git a/src/H5B2.c b/src/H5B2.c index 7c613bf..b6e8392 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -112,7 +112,7 @@ H5FL_DEFINE_STATIC(H5B2_t); /*------------------------------------------------------------------------- - * Function: H5B2_create_2 + * Function: H5B2_create * * Purpose: Creates a new empty B-tree in the file. * @@ -126,14 +126,14 @@ H5FL_DEFINE_STATIC(H5B2_t); *------------------------------------------------------------------------- */ H5B2_t * -H5B2_create_2(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam) +H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam) { H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ haddr_t hdr_addr; /* B-tree header address */ H5B2_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_create_2, NULL) + FUNC_ENTER_NOAPI(H5B2_create, NULL) /* * Check arguments. @@ -179,48 +179,6 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, NULL, "unable to close v2 B-tree") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_create_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_create - * - * Purpose: Creates a new empty B-tree in the file. - * - * Return: Non-negative on success (with address of new B-tree - * filled in), negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 31 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, - haddr_t *addr_p) -{ - haddr_t hdr_addr; /* The new v2 B-tree header address */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_create, FAIL) - - /* - * Check arguments. - */ - HDassert(f); - HDassert(cparam); - HDassert(addr_p); - - /* Create shared v2 B-tree header */ - if(HADDR_UNDEF == (hdr_addr = H5B2_hdr_create(f, dxpl_id, cparam))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't create v2 B-tree header") - - /* Set the B-tree's address to return */ - *addr_p = hdr_addr; - -done: - FUNC_LEAVE_NOAPI(ret_value) } /* end H5B2_create() */ @@ -290,7 +248,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B2_insert_2 + * Function: H5B2_insert * * Purpose: Adds a new record to the B-tree. * @@ -303,12 +261,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_insert_2(H5B2_t *bt2, hid_t dxpl_id, void *udata) +H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_insert_2, FAIL) + FUNC_ENTER_NOAPI(H5B2_insert, FAIL) /* Check arguments. */ HDassert(bt2); @@ -349,50 +307,6 @@ H5B2_insert_2(H5B2_t *bt2, hid_t dxpl_id, void *udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_insert_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_insert - * - * Purpose: Adds a new record to the B-tree. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_insert(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr_t addr, - void *udata) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_insert, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Insert the new record */ - if(H5B2_insert_2(bt2, dxpl_id, udata) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree") - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_insert() */ @@ -428,7 +342,7 @@ H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr_p) /*------------------------------------------------------------------------- - * Function: H5B2_iterate_2 + * Function: H5B2_iterate * * Purpose: Iterate over all the records in the B-tree, in "in-order" * order, making a callback for each record. @@ -445,12 +359,12 @@ H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr_p) *------------------------------------------------------------------------- */ herr_t -H5B2_iterate_2(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) +H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOERR(H5B2_iterate_2, -) + FUNC_ENTER_NOAPI_NOERR(H5B2_iterate, -) /* Check arguments. */ HDassert(bt2); @@ -470,60 +384,11 @@ H5B2_iterate_2(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_iterate_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_iterate - * - * Purpose: Iterate over all the records in the B-tree, in "in-order" - * order, making a callback for each record. - * - * If the callback returns non-zero, the iteration breaks out - * without finishing all the records. - * - * Return: Value from callback: non-negative on success, negative on error - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 11 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_iterate(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr_t addr, - H5B2_operator_t op, void *op_data) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_iterate, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - HDassert(op); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Iterate through records */ - if((ret_value = H5B2_iterate_2(bt2, dxpl_id, op, op_data)) < 0) - HERROR(H5E_BTREE, H5E_CANTLIST, "B-tree iteration failed"); - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_iterate() */ /*------------------------------------------------------------------------- - * Function: H5B2_find_2 + * Function: H5B2_find * * Purpose: Locate the specified information in a B-tree and return * that information by calling the provided 'OP' routine with an @@ -546,7 +411,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5B2_find_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, +H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ @@ -556,7 +421,7 @@ H5B2_find_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, unsigned idx; /* Location of record which matches key */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_find_2, FAIL) + FUNC_ENTER_NOAPI(H5B2_find, FAIL) /* Check arguments. */ HDassert(bt2); @@ -661,65 +526,11 @@ H5B2_find_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_find_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_find - * - * Purpose: Locate the specified information in a B-tree and return - * that information by calling the provided 'OP' routine with an - * OP_DATA pointer. The UDATA parameter points to data passed - * to the key comparison function. - * - * The 'OP' routine is called with the record found and the - * OP_DATA pointer, to allow caller to return information about - * the record. - * - * If 'OP' is NULL, then this routine just returns "TRUE" when - * a record is present in the B-tree. - * - * Return: Non-negative (TRUE/FALSE) on success, negative on failure. - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 23 2005 - * - *------------------------------------------------------------------------- - */ -htri_t -H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr_t addr, - void *udata, H5B2_found_t op, void *op_data) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - htri_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_find, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Operate on record */ - if((ret_value = H5B2_find_2(bt2, dxpl_id, udata, op, op_data)) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "B-tree find operation failed") - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_find() */ /*------------------------------------------------------------------------- - * Function: H5B2_index_2 + * Function: H5B2_index * * Purpose: Locate the IDX'th record in a B-tree according to the * ordering used by the B-tree. The IDX values are 0-based. @@ -737,7 +548,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_index_2(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, +H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ @@ -745,7 +556,7 @@ H5B2_index_2(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, unsigned depth; /* Current depth of the tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_index_2, FAIL) + FUNC_ENTER_NOAPI(H5B2_index, FAIL) /* Check arguments. */ HDassert(bt2); @@ -876,61 +687,11 @@ H5B2_index_2(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_index_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_index - * - * Purpose: Locate the IDX'th record in a B-tree according to the - * ordering used by the B-tree. The IDX values are 0-based. - * - * The 'OP' routine is called with the record found and the - * OP_DATA pointer, to allow caller to return information about - * the record. - * - * Return: Non-negative on success, negative on failure. - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 23 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr_t addr, - H5_iter_order_t order, hsize_t idx, H5B2_found_t op, void *op_data) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_index, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - HDassert(op); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Locate and operate on record */ - if(H5B2_index_2(bt2, dxpl_id, order, idx, op, op_data) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "B-tree index operation failed") - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_index() */ /*------------------------------------------------------------------------- - * Function: H5B2_remove_2 + * Function: H5B2_remove * * Purpose: Removes a record from a B-tree. * @@ -943,13 +704,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, +H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_remove_2, FAIL) + FUNC_ENTER_NOAPI(H5B2_remove, FAIL) /* Check arguments. */ HDassert(bt2); @@ -982,7 +743,7 @@ H5B2_remove_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, if(H5FL_fac_term(hdr->node_info[hdr->depth].node_ptr_fac) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy node's node pointer block factory") - hdr->depth -= depth_decreased; + hdr->depth -= (uint16_t)depth_decreased; } /* end for */ } /* end if */ else { @@ -999,55 +760,11 @@ H5B2_remove_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_remove_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_remove - * - * Purpose: Removes a record from a B-tree. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 25 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_remove(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr_t addr, - void *udata, H5B2_remove_t op, void *op_data) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_remove, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Attempt to remove record from B-tree */ - if(H5B2_remove_2(bt2, dxpl_id, udata, op, op_data) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree") - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_remove() */ /*------------------------------------------------------------------------- - * Function: H5B2_remove_by_idx_2 + * Function: H5B2_remove_by_idx * * Purpose: Removes the n'th record from a B-tree. * @@ -1060,13 +777,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove_by_idx_2(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, +H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, H5B2_remove_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_remove_by_idx_2, FAIL) + FUNC_ENTER_NOAPI(H5B2_remove_by_idx, FAIL) /* Check arguments. */ HDassert(bt2); @@ -1107,7 +824,7 @@ H5B2_remove_by_idx_2(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, if(H5FL_fac_term(hdr->node_info[hdr->depth].node_ptr_fac) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy node's node pointer block factory") - hdr->depth -= depth_decreased; + hdr->depth -= (uint16_t)depth_decreased; } /* end for */ } /* end if */ else { @@ -1124,56 +841,11 @@ H5B2_remove_by_idx_2(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_remove_by_idx_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_remove_by_idx - * - * Purpose: Removes the n'th record from a B-tree. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 14 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, - haddr_t addr, H5_iter_order_t order, hsize_t idx, H5B2_remove_t op, - void *op_data) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_remove_by_idx, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Attempt to remove record from B-tree */ - if(H5B2_remove_by_idx_2(bt2, dxpl_id, order, idx, op, op_data) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree") - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_remove_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5B2_get_nrec_2 + * Function: H5B2_get_nrec * * Purpose: Retrieves the number of records in a B-tree * @@ -1186,9 +858,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_get_nrec_2(const H5B2_t *bt2, hsize_t *nrec) +H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_get_nrec_2) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_get_nrec) /* Check arguments. */ HDassert(bt2); @@ -1198,56 +870,11 @@ H5B2_get_nrec_2(const H5B2_t *bt2, hsize_t *nrec) *nrec = bt2->hdr->root.all_nrec; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_get_nrec_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_get_nrec - * - * Purpose: Retrieves the number of records in a B-tree - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 25 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_get_nrec(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr_t addr, - hsize_t *nrec) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_get_nrec, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - HDassert(nrec); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Get the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, nrec) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "unable to get # of records in B-tree") - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_get_nrec() */ /*------------------------------------------------------------------------- - * Function: H5B2_neighbor_2 + * Function: H5B2_neighbor * * Purpose: Locate a record relative to the specified information in a * B-tree and return that information by filling in fields of the @@ -1272,13 +899,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_neighbor_2(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, +H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, H5B2_found_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_neighbor_2, FAIL) + FUNC_ENTER_NOAPI(H5B2_neighbor, FAIL) /* Check arguments. */ HDassert(bt2); @@ -1306,68 +933,11 @@ H5B2_neighbor_2(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_neighbor_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_neighbor - * - * Purpose: Locate a record relative to the specified information in a - * B-tree and return that information by filling in fields of the - * caller-supplied UDATA pointer depending on the type of leaf node - * requested. The UDATA can point to additional data passed - * to the key comparison function. - * - * The 'OP' routine is called with the record found and the - * OP_DATA pointer, to allow caller to return information about - * the record. - * - * The RANGE indicates whether to search for records less than or - * equal to, or greater than or equal to the information passed - * in with UDATA. - * - * Return: Non-negative on success, negative on failure. - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 8 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_neighbor(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr_t addr, - H5B2_compare_t range, void *udata, H5B2_found_t op, void *op_data) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_neighbor, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - HDassert(op); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Attempt to find neighbor record in B-tree */ - if(H5B2_neighbor_2(bt2, dxpl_id, range, udata, op, op_data) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree") - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_neighbor() */ /*------------------------------------------------------------------------- - * Function: H5B2_modify_2 + * Function: H5B2_modify * * Purpose: Locate the specified information in a B-tree and modify it. * The UDATA points to additional data passed @@ -1387,7 +957,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_modify_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, +H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ @@ -1397,7 +967,7 @@ H5B2_modify_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_modify_2, FAIL) + FUNC_ENTER_NOAPI(H5B2_modify, FAIL) /* Check arguments. */ HDassert(bt2); @@ -1526,157 +1096,10 @@ H5B2_modify_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_modify_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_modify - * - * Purpose: Locate the specified information in a B-tree and modify it. - * The UDATA points to additional data passed - * to the key comparison function for locating the record to - * modify. - * - * The 'OP' routine is called with the record found and the - * OP_DATA pointer, to allow caller to modify information about - * the record. - * - * Return: Non-negative on success, negative on failure. - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 10 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr_t addr, - void *udata, H5B2_modify_t op, void *op_data) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_modify, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - HDassert(op); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Locate & modify record */ - if(H5B2_modify_2(bt2, dxpl_id, udata, op, op_data) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree") - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_modify() */ /*------------------------------------------------------------------------- - * Function: H5B2_iterate_size_2 - * - * Purpose: Iterate over all the records in the B-tree, collecting - * storage info. - * - * Return: non-negative on success, negative on error - * - * Programmer: Vailin Choi - * June 19 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_iterate_size_2(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size) -{ - H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_iterate_size_2, FAIL) - - /* Check arguments. */ - HDassert(bt2); - HDassert(btree_size); - - /* Set the shared v2 B-tree header's file context for this operation */ - bt2->hdr->f = bt2->f; - - /* Get the v2 B-tree header */ - hdr = bt2->hdr; - - /* Add size of header to B-tree metadata total */ - *btree_size += H5B2_HEADER_SIZE(hdr->f); - - /* Iterate through records */ - if(hdr->root.node_nrec > 0) { - /* Check for root node being a leaf */ - if(hdr->depth == 0) - *btree_size += hdr->node_size; - else - /* Iterate through nodes */ - if(H5B2_iterate_size_node(hdr, dxpl_id, hdr->depth, &hdr->root, btree_size) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_iterate_size_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_iterate_size - * - * Purpose: Iterate over all the records in the B-tree, collecting - * storage info. - * - * Return: non-negative on success, negative on error - * - * Programmer: Vailin Choi - * June 19 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_iterate_size(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, - haddr_t addr, hsize_t *btree_size) -{ - H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_iterate_size, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - HDassert(btree_size); - - /* Open the B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTOPENOBJ, FAIL, "unable to open B-tree") - - /* Iterate through B-tree, collective size info */ - if(H5B2_iterate_size_2(bt2, dxpl_id, btree_size) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't get size information for B-tree") - -done: - /* Close the B-tree */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, FAIL, "unable to close B-tree") - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_iterate_size() */ - - -/*------------------------------------------------------------------------- * Function: H5B2_close * * Purpose: Close a v2 B-tree diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 31c28af..6737076 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -151,7 +151,7 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *ud { H5B2_create_t cparam; /* B-tree creation parameters */ H5B2_subid_t id; /* ID of B-tree class, as found in file */ - unsigned depth; /* Depth of B-tree */ + uint16_t depth; /* Depth of B-tree */ H5B2_hdr_t *hdr = NULL; /* B-tree header */ size_t size; /* Header size */ uint32_t stored_chksum; /* Stored metadata checksum value */ @@ -177,7 +177,7 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *ud HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't wrap buffer") /* Compute the size of the serialized B-tree header on disk */ - size = H5B2_HEADER_SIZE(f); + size = H5B2_HEADER_SIZE(hdr); /* Get a pointer to a buffer that's large enough for header */ if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) @@ -300,7 +300,7 @@ H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't wrap buffer") /* Compute the size of the serialized B-tree header on disk */ - size = H5B2_HEADER_SIZE(f); + size = H5B2_HEADER_SIZE(hdr); /* Get a pointer to a buffer that's large enough for header */ if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) @@ -399,7 +399,7 @@ H5B2_cache_hdr_dest(H5F_t *f, H5B2_hdr_t *hdr) if(hdr->cache_info.free_file_space_on_destroy) { /* Release the space on disk */ /* (XXX: Nasty usage of internal DXPL value! -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_BTREE, H5AC_dxpl_id, hdr->cache_info.addr, (hsize_t)H5B2_HEADER_SIZE(f)) < 0) + if(H5MF_xfree(f, H5FD_MEM_BTREE, H5AC_dxpl_id, hdr->cache_info.addr, (hsize_t)H5B2_HEADER_SIZE(hdr)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free v2 B-tree header") } /* end if */ @@ -465,7 +465,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_cache_hdr_size(const H5F_t *f, const H5B2_hdr_t UNUSED *hdr, size_t *size_ptr) +H5B2_cache_hdr_size(const H5F_t UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_hdr_size) @@ -474,7 +474,7 @@ H5B2_cache_hdr_size(const H5F_t *f, const H5B2_hdr_t UNUSED *hdr, size_t *size_p HDassert(size_ptr); /* Set size value */ - *size_ptr = H5B2_HEADER_SIZE(f); + *size_ptr = H5B2_HEADER_SIZE(hdr); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5B2_cache_hdr_size() */ @@ -574,7 +574,7 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_uda /* Deserialize node pointers for internal node */ int_node_ptr = internal->node_ptrs; - for(u = 0; u < internal->nrec + 1; u++) { + for(u = 0; u < (unsigned)(internal->nrec + 1); u++) { /* Decode node pointer */ H5F_addr_decode(f, (const uint8_t **)&p, &(int_node_ptr->addr)); UINT64DECODE_VAR(p, int_node_ptr->node_nrec, udata->hdr->max_nrec_size); @@ -673,7 +673,7 @@ H5B2_cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr /* Serialize node pointers for internal node */ int_node_ptr = internal->node_ptrs; - for(u = 0; u < internal->nrec + 1; u++) { + for(u = 0; u < (unsigned)(internal->nrec + 1); u++) { /* Encode node pointer */ H5F_addr_encode(f, &p, int_node_ptr->addr); UINT64ENCODE_VAR(p, int_node_ptr->node_nrec, internal->hdr->max_nrec_size); @@ -854,7 +854,7 @@ H5B2_cache_internal_size(const H5F_t UNUSED *f, const H5B2_internal_t *internal, static H5B2_leaf_t * H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_nrec, void *_hdr) { - const unsigned *nrec = (const unsigned *)_nrec; + const uint16_t *nrec = (const uint16_t *)_nrec; H5B2_hdr_t *hdr = (H5B2_hdr_t *)_hdr; /* B-tree header information */ H5B2_leaf_t *leaf = NULL; /* Pointer to lead node loaded */ uint8_t *p; /* Pointer into raw data buffer */ diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index db469f2..17a64cd 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -154,7 +154,7 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, /* Print relevant node info */ HDfprintf(stream, "%*sNode Info: (max_nrec/split_nrec/merge_nrec)\n", indent, ""); - for(u = 0; u < (hdr->depth + 1); u++) { + for(u = 0; u < (unsigned)(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, diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 31e1674..ec46729 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -108,7 +108,7 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t); */ herr_t H5B2_hdr_init(H5F_t *f, H5B2_hdr_t *hdr, const H5B2_create_t *cparam, - unsigned depth) + uint16_t depth) { size_t sz_max_nrec; /* Temporary variable for range checking */ unsigned u_max_nrec_size; /* Temporary variable for range checking */ @@ -187,7 +187,7 @@ HDmemset(hdr->page, 0, hdr->node_size); /* Initialize internal node info */ if(depth > 0) { - for(u = 1; u < (depth + 1); u++) { + for(u = 1; u < (unsigned)(depth + 1); u++) { sz_max_nrec = H5B2_NUM_INT_REC(hdr, u); H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].max_nrec, /* From: */ sz_max_nrec, /* From: */ size_t, /* To: */ unsigned) HDassert(hdr->node_info[u].max_nrec <= hdr->node_info[u - 1].max_nrec); @@ -296,11 +296,11 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed for B-tree header") /* Initialize shared B-tree info */ - if(H5B2_hdr_init(f, hdr, cparam, 0) < 0) + if(H5B2_hdr_init(f, hdr, cparam, (uint16_t)0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, HADDR_UNDEF, "can't create shared B-tree info") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)H5B2_HEADER_SIZE(f)))) + if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)H5B2_HEADER_SIZE(hdr)))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "file allocation failed for B-tree header") /* Cache the new B-tree node */ @@ -520,7 +520,7 @@ H5B2_hdr_free(H5B2_hdr_t *hdr) unsigned u; /* Local index variable */ /* Destroy free list factories */ - for(u = 0; u < (hdr->depth + 1); u++) { + for(u = 0; u < (unsigned)(hdr->depth + 1); u++) { if(hdr->node_info[u].nat_rec_fac) if(H5FL_fac_term(hdr->node_info[u].nat_rec_fac) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTRELEASE, FAIL, "can't destroy node's native record block factory") diff --git a/src/H5B2int.c b/src/H5B2int.c index 3d37949..f7312a5 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -179,11 +179,11 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *cur const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ void *left_child, *right_child; /* Pointers to child nodes */ - unsigned *left_nrec, *right_nrec; /* Pointers to child # of records */ + uint16_t *left_nrec, *right_nrec; /* Pointers to child # of records */ uint8_t *left_native, *right_native;/* Pointers to childs' native records */ H5B2_node_ptr_t *left_node_ptrs = NULL, *right_node_ptrs = NULL;/* Pointers to childs' node pointer info */ - unsigned mid_record; /* Index of "middle" record in current node */ - unsigned old_node_nrec; /* Number of records in internal node split */ + uint16_t mid_record; /* Index of "middle" record in current node */ + uint16_t old_node_nrec; /* Number of records in internal node split */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5B2_split1) @@ -265,12 +265,12 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *cur /* Copy "upper half" of records to new child */ HDmemcpy(H5B2_NAT_NREC(right_native, hdr, 0), - H5B2_NAT_NREC(left_native, hdr, mid_record + 1), - hdr->cls->nrec_size * (old_node_nrec - (mid_record + 1))); + H5B2_NAT_NREC(left_native, hdr, mid_record + (unsigned)1), + hdr->cls->nrec_size * (old_node_nrec - (mid_record + (unsigned)1))); /* Copy "upper half" of node pointers, if the node is an internal node */ if(depth > 1) - HDmemcpy(&(right_node_ptrs[0]), &(left_node_ptrs[mid_record + 1]), + HDmemcpy(&(right_node_ptrs[0]), &(left_node_ptrs[mid_record + (unsigned)1]), sizeof(H5B2_node_ptr_t) * (old_node_nrec - mid_record)); /* Copy "middle" record to internal node */ @@ -278,7 +278,7 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *cur /* Update record counts in child nodes */ internal->node_ptrs[idx].node_nrec = *left_nrec = mid_record; - internal->node_ptrs[idx + 1].node_nrec = *right_nrec = old_node_nrec - (mid_record + 1); + internal->node_ptrs[idx + 1].node_nrec = *right_nrec = old_node_nrec - (mid_record + (unsigned)1); /* Determine total number of records in new child nodes */ if(depth > 1) { @@ -288,11 +288,11 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *cur /* Compute total of all records in each child node */ new_left_all_nrec = internal->node_ptrs[idx].node_nrec; - for(u = 0; u < (*left_nrec + 1); u++) + for(u = 0; u < (*left_nrec + (unsigned)1); u++) new_left_all_nrec += left_node_ptrs[u].all_nrec; new_right_all_nrec = internal->node_ptrs[idx + 1].node_nrec; - for(u = 0; u < (*right_nrec + 1); u++) + for(u = 0; u < (*right_nrec + (unsigned)1); u++) new_right_all_nrec += right_node_ptrs[u].all_nrec; internal->node_ptrs[idx].all_nrec = new_left_all_nrec; @@ -438,7 +438,7 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ void *left_child, *right_child; /* Pointers to child nodes */ - unsigned *left_nrec, *right_nrec; /* Pointers to child # of records */ + uint16_t *left_nrec, *right_nrec; /* Pointers to child # of records */ uint8_t *left_native, *right_native; /* Pointers to childs' native records */ H5B2_node_ptr_t *left_node_ptrs = NULL, *right_node_ptrs = NULL;/* Pointers to childs' node pointer info */ hssize_t left_moved_nrec = 0, right_moved_nrec = 0; /* Number of records moved, for internal redistrib */ @@ -516,8 +516,8 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, if(*left_nrec < *right_nrec) { /* Moving record from right node to left */ - unsigned new_right_nrec = (*left_nrec + *right_nrec) / 2; /* New number of records for right child */ - unsigned move_nrec = *right_nrec - new_right_nrec; /* Number of records to move from right node to left */ + uint16_t new_right_nrec = (*left_nrec + *right_nrec) / 2; /* New number of records for right child */ + uint16_t move_nrec = *right_nrec - new_right_nrec; /* Number of records to move from right node to left */ /* Copy record from parent node down into left child */ HDmemcpy(H5B2_NAT_NREC(left_native, hdr, *left_nrec), H5B2_INT_NREC(internal, hdr, idx), hdr->cls->nrec_size); @@ -547,7 +547,7 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, HDmemcpy(&(left_node_ptrs[*left_nrec + 1]), &(right_node_ptrs[0]), sizeof(H5B2_node_ptr_t) * move_nrec); /* Slide node pointers in right node down */ - HDmemmove(&(right_node_ptrs[0]), &(right_node_ptrs[move_nrec]), sizeof(H5B2_node_ptr_t) * (new_right_nrec + 1)); + HDmemmove(&(right_node_ptrs[0]), &(right_node_ptrs[move_nrec]), sizeof(H5B2_node_ptr_t) * (new_right_nrec + (unsigned)1)); } /* end if */ /* Update number of records in child nodes */ @@ -557,8 +557,8 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, else { /* Moving record from left node to right */ - unsigned new_left_nrec = (*left_nrec + *right_nrec) / 2; /* New number of records for left child */ - unsigned move_nrec = *left_nrec - new_left_nrec; /* Number of records to move from left node to right */ + uint16_t new_left_nrec = (*left_nrec + *right_nrec) / 2; /* New number of records for left child */ + uint16_t move_nrec = *left_nrec - new_left_nrec; /* Number of records to move from left node to right */ /* Slide records in right node up */ HDmemmove(H5B2_NAT_NREC(right_native, hdr, move_nrec), @@ -658,8 +658,8 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, haddr_t middle_addr; /* Address of middle child node */ void *left_child, *right_child; /* Pointers to child nodes */ void *middle_child; /* Pointers to middle child node */ - unsigned *left_nrec, *right_nrec; /* Pointers to child # of records */ - unsigned *middle_nrec; /* Pointers to middle child # of records */ + uint16_t *left_nrec, *right_nrec; /* Pointers to child # of records */ + uint16_t *middle_nrec; /* Pointers to middle child # of records */ uint8_t *left_native, *right_native; /* Pointers to childs' native records */ uint8_t *middle_native; /* Pointers to middle child's native records */ H5B2_node_ptr_t *left_node_ptrs = NULL, *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ @@ -744,10 +744,10 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, { /* Compute new # of records in each node */ unsigned total_nrec = *left_nrec + *middle_nrec + *right_nrec + 2; - unsigned new_middle_nrec = (total_nrec - 2) / 3; - unsigned new_left_nrec = ((total_nrec - 2) - new_middle_nrec) / 2; - unsigned new_right_nrec = (total_nrec - 2) - (new_left_nrec + new_middle_nrec); - unsigned curr_middle_nrec = *middle_nrec; + uint16_t new_middle_nrec = (total_nrec - 2) / 3; + uint16_t new_left_nrec = ((total_nrec - 2) - new_middle_nrec) / 2; + uint16_t new_right_nrec = (total_nrec - 2) - (new_left_nrec + new_middle_nrec); + uint16_t curr_middle_nrec = *middle_nrec; /* Sanity check rounding */ HDassert(new_middle_nrec <= new_left_nrec); @@ -755,7 +755,7 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Move records into left node */ if(new_left_nrec > *left_nrec) { - unsigned moved_middle_nrec = 0; /* Number of records moved into left node */ + uint16_t moved_middle_nrec = 0; /* Number of records moved into left node */ /* Move left parent record down to left node */ HDmemcpy(H5B2_NAT_NREC(left_native, hdr, *left_nrec), H5B2_INT_NREC(internal, hdr, idx - 1), hdr->cls->nrec_size); @@ -1027,7 +1027,7 @@ H5B2_merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ void *left_child, *right_child; /* Pointers to left & right child nodes */ - unsigned *left_nrec, *right_nrec; /* Pointers to left & right child # of records */ + uint16_t *left_nrec, *right_nrec; /* Pointers to left & right child # of records */ uint8_t *left_native, *right_native; /* Pointers to left & right children's native records */ H5B2_node_ptr_t *left_node_ptrs = NULL, *right_node_ptrs = NULL;/* Pointers to childs' node pointer info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1177,8 +1177,8 @@ H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, haddr_t middle_addr; /* Address of middle child node */ void *left_child, *right_child; /* Pointers to left & right child nodes */ void *middle_child; /* Pointer to middle child node */ - unsigned *left_nrec, *right_nrec; /* Pointers to left & right child # of records */ - unsigned *middle_nrec; /* Pointer to middle child # of records */ + uint16_t *left_nrec, *right_nrec; /* Pointers to left & right child # of records */ + uint16_t *middle_nrec; /* Pointer to middle child # of records */ uint8_t *left_native, *right_native; /* Pointers to left & right children's native records */ uint8_t *middle_native; /* Pointer to middle child's native records */ H5B2_node_ptr_t *left_node_ptrs = NULL, *right_node_ptrs = NULL;/* Pointers to childs' node pointer info */ @@ -2837,7 +2837,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5B2_iterate_size_node + * Function: H5B2_node_size * * Purpose: Iterate over all the records from a B-tree node, collecting * btree storage info. @@ -2850,13 +2850,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_iterate_size_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2_node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, const H5B2_node_ptr_t *curr_node, hsize_t *btree_size) { H5B2_internal_t *internal = NULL; /* Pointer to internal node */ herr_t ret_value = SUCCEED; /* Iterator return value */ - FUNC_ENTER_NOAPI(H5B2_iterate_size_node, FAIL) + FUNC_ENTER_NOAPI(H5B2_node_size, FAIL) /* Check arguments. */ HDassert(hdr); @@ -2874,7 +2874,7 @@ H5B2_iterate_size_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Descend into children */ for(u = 0; u < internal->nrec + 1; u++) - if(H5B2_iterate_size_node(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[u]), btree_size) < 0) + if(H5B2_node_size(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[u]), btree_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") } /* end if */ else /* depth is 1: count all the leaf nodes from this node */ @@ -2888,7 +2888,7 @@ done: HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_iterate_size_node() */ +} /* H5B2_node_size() */ #ifdef H5B2_DEBUG diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 71e3ac5..8b68d1e 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -41,11 +41,15 @@ /**************************/ /* Size of storage for number of records per node (on disk) */ -#define H5B2_SIZEOF_RECORDS_PER_NODE 2 +#define H5B2_SIZEOF_RECORDS_PER_NODE (unsigned)2 /* Size of a "tree pointer" (on disk) */ /* (essentially, the largest internal pointer allowed) */ -#define H5B2_TREE_POINTER_SIZE(f) (H5F_SIZEOF_ADDR(f)+H5B2_SIZEOF_RECORDS_PER_NODE+H5F_SIZEOF_SIZE(f)) +#define H5B2_TREE_POINTER_SIZE(h) ( \ + (h)->sizeof_addr + \ + H5B2_SIZEOF_RECORDS_PER_NODE + \ + (h)->sizeof_size \ + ) /* Size of a internal node pointer (on disk) */ #define H5B2_INT_POINTER_SIZE(h, d) ( \ @@ -59,24 +63,24 @@ /* Format overhead for all v2 B-tree metadata in the file */ #define H5B2_METADATA_PREFIX_SIZE ( \ - H5_SIZEOF_MAGIC /* Signature */ \ - + 1 /* Version */ \ - + 1 /* Tree type */ \ - + H5B2_SIZEOF_CHKSUM /* Metadata checksum */ \ + (unsigned)H5_SIZEOF_MAGIC /* Signature */ \ + + (unsigned)1 /* Version */ \ + + (unsigned)1 /* Tree type */ \ + + (unsigned)H5B2_SIZEOF_CHKSUM /* Metadata checksum */ \ ) /* Size of the v2 B-tree header on disk */ -#define H5B2_HEADER_SIZE(f) ( \ +#define H5B2_HEADER_SIZE(h) ( \ /* General metadata fields */ \ H5B2_METADATA_PREFIX_SIZE \ \ /* Header specific fields */ \ - + 4 /* Node size, in bytes */ \ - + 2 /* Record size, in bytes */ \ - + 2 /* Depth of tree */ \ - + 1 /* Split % of full (as integer, ie. "98" means 98%) */ \ - + 1 /* Merge % of full (as integer, ie. "98" means 98%) */ \ - + H5B2_TREE_POINTER_SIZE(f) /* Node pointer to root node in tree */ \ + + (unsigned)4 /* Node size, in bytes */ \ + + (unsigned)2 /* Record size, in bytes */ \ + + (unsigned)2 /* Depth of tree */ \ + + (unsigned)1 /* Split % of full (as integer, ie. "98" means 98%) */ \ + + (unsigned)1 /* Merge % of full (as integer, ie. "98" means 98%) */ \ + + H5B2_TREE_POINTER_SIZE(h) /* Node pointer to root node in tree */ \ ) /* Size of the v2 B-tree internal node prefix */ @@ -119,7 +123,7 @@ /* A "node pointer" to another B-tree node */ typedef struct { haddr_t addr; /* Address of other node */ - unsigned node_nrec; /* Number of records used in node pointed to */ + uint16_t node_nrec; /* Number of records used in node pointed to */ hsize_t all_nrec; /* Number of records in node pointed to and all it's children */ } H5B2_node_ptr_t; @@ -143,13 +147,13 @@ typedef struct H5B2_hdr_t { H5B2_node_ptr_t root; /* Node pointer to root node in B-tree */ /* Information set by user (stored) */ - unsigned split_percent; /* Percent full at which to split the node, when inserting */ - unsigned merge_percent; /* Percent full at which to merge the node, when deleting */ - size_t node_size; /* Size of B-tree nodes, in bytes */ - size_t rrec_size; /* Size of "raw" (on disk) record, in bytes */ + uint8_t split_percent; /* Percent full at which to split the node, when inserting */ + uint8_t merge_percent; /* Percent full at which to merge the node, when deleting */ + uint32_t node_size; /* Size of B-tree nodes, in bytes */ + uint32_t rrec_size; /* Size of "raw" (on disk) record, in bytes */ /* Dynamic information (stored) */ - unsigned depth; /* B-tree's overall depth */ + uint16_t depth; /* B-tree's overall depth */ /* Derived information from user's information (not stored) */ uint8_t max_nrec_size; /* Size to store max. # of records in any node (in bytes) */ @@ -178,7 +182,7 @@ typedef struct H5B2_leaf_t { /* Internal B-tree information */ H5B2_hdr_t *hdr; /* Pointer to the [pinned] v2 B-tree header */ uint8_t *leaf_native; /* Pointer to native records */ - unsigned nrec; /* Number of records in node */ + uint16_t nrec; /* Number of records in node */ } H5B2_leaf_t; /* B-tree internal node information */ @@ -190,8 +194,8 @@ typedef struct H5B2_internal_t { H5B2_hdr_t *hdr; /* Pointer to the [pinned] v2 B-tree header */ uint8_t *int_native; /* Pointer to native records */ H5B2_node_ptr_t *node_ptrs; /* Pointer to node pointers */ - unsigned nrec; /* Number of records in node */ - unsigned depth; /* Depth of this node in the B-tree */ + uint16_t nrec; /* Number of records in node */ + uint16_t depth; /* Depth of this node in the B-tree */ } H5B2_internal_t; /* v2 B-tree */ @@ -203,8 +207,8 @@ struct H5B2_t { /* User data for metadata cache 'load' callback */ typedef struct { H5B2_hdr_t *hdr; /* Pointer to the [pinned] v2 B-tree header */ - unsigned nrec; /* Number of records in node to load */ - unsigned depth; /* Depth of node to load */ + uint16_t nrec; /* Number of records in node to load */ + uint16_t depth; /* Depth of node to load */ } H5B2_int_load_ud1_t; #ifdef H5B2_TESTING @@ -253,7 +257,7 @@ H5_DLL H5B2_hdr_t *H5B2_hdr_alloc(H5F_t *f); H5_DLL haddr_t H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam); H5_DLL herr_t H5B2_hdr_init(H5F_t *f, H5B2_hdr_t *hdr, - const H5B2_create_t *cparam, unsigned depth); + const H5B2_create_t *cparam, uint16_t depth); H5_DLL herr_t H5B2_hdr_incr(H5B2_hdr_t *hdr); H5_DLL herr_t H5B2_hdr_decr(H5B2_hdr_t *hdr); H5_DLL herr_t H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr); @@ -281,7 +285,7 @@ H5_DLL herr_t H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Routines for iterating over nodes/records */ H5_DLL herr_t H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, const H5B2_node_ptr_t *curr_node, H5B2_operator_t op, void *op_data); -H5_DLL herr_t H5B2_iterate_size_node(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2_node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, const H5B2_node_ptr_t *curr_node, hsize_t *op_data); /* Routines for locating records */ @@ -331,16 +335,9 @@ H5_DLL herr_t H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, /* Testing routines */ #ifdef H5B2_TESTING -H5_DLL herr_t H5B2_get_root_addr_test(H5F_t *f, hid_t dxpl_id, - const H5B2_class_t *type, haddr_t addr, haddr_t *root_addr); -H5_DLL herr_t H5B2_get_root_addr_test_2(H5B2_t *bt2, haddr_t *root_addr); -H5_DLL int H5B2_get_node_depth_test(H5F_t *f, hid_t dxpl_id, - const H5B2_class_t *type, haddr_t addr, void *udata); -H5_DLL int H5B2_get_node_depth_test_2(H5B2_t *bt2, hid_t dxpl_id, void *udata); -H5_DLL herr_t H5B2_get_node_info_test(H5F_t *f, hid_t dxpl_id, - const H5B2_class_t *type, haddr_t addr, void *udata, - H5B2_node_info_test_t *ninfo); -H5_DLL herr_t H5B2_get_node_info_test_2(H5B2_t *bt2, hid_t dxpl_id, +H5_DLL herr_t H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr); +H5_DLL int H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata); +H5_DLL herr_t H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_node_info_test_t *ninfo); #endif /* H5B2_TESTING */ diff --git a/src/H5B2private.h b/src/H5B2private.h index ed3447b..cfdf868 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -104,10 +104,10 @@ struct H5B2_class_t { /* v2 B-tree creation parameters */ typedef struct H5B2_create_t { const H5B2_class_t *cls; /* v2 B-tree client class */ - size_t node_size; /* Size of each node (in bytes) */ - size_t rrec_size; /* Size of raw record (in bytes) */ - unsigned split_percent; /* % full to split nodes */ - unsigned merge_percent; /* % full to merge nodes */ + uint32_t node_size; /* Size of each node (in bytes) */ + uint32_t rrec_size; /* Size of raw record (in bytes) */ + uint8_t split_percent; /* % full to split nodes */ + uint8_t merge_percent; /* % full to merge nodes */ } H5B2_create_t; /* v2 B-tree metadata statistics info */ @@ -128,60 +128,33 @@ typedef struct H5B2_t H5B2_t; /***************************************/ /* Library-private Function Prototypes */ /***************************************/ -H5_DLL herr_t H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, - haddr_t *addr_p); -H5_DLL H5B2_t *H5B2_create_2(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam); +H5_DLL H5B2_t *H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam); H5_DLL H5B2_t *H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr); H5_DLL herr_t H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr/*out*/); -H5_DLL herr_t H5B2_insert(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, void *udata); -H5_DLL herr_t H5B2_insert_2(H5B2_t *bt2, hid_t dxpl_id, void *udata); -H5_DLL herr_t H5B2_iterate(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, H5B2_operator_t op, void *op_data); -H5_DLL herr_t H5B2_iterate_2(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, +H5_DLL herr_t H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata); +H5_DLL herr_t H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data); -H5_DLL htri_t H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, void *udata, H5B2_found_t op, void *op_data); -H5_DLL htri_t H5B2_find_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, +H5_DLL htri_t H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, - void *op_data); -H5_DLL herr_t H5B2_index_2(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, +H5_DLL herr_t H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_neighbor(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, H5B2_compare_t comp, void *udata, H5B2_found_t op, - void *op_data); -H5_DLL herr_t H5B2_neighbor_2(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, +H5_DLL herr_t H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, void *udata, H5B2_modify_t op, void *op_data); -H5_DLL herr_t H5B2_modify_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, +H5_DLL herr_t H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, void *op_data); -H5_DLL herr_t H5B2_remove(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, void *udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_remove_2(H5B2_t *b2, hid_t dxpl_id, void *udata, +H5_DLL herr_t H5B2_remove(H5B2_t *b2, hid_t dxpl_id, void *udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, H5_iter_order_t order, hsize_t idx, H5B2_remove_t op, - void *op_data); -H5_DLL herr_t H5B2_remove_by_idx_2(H5B2_t *bt2, hid_t dxpl_id, +H5_DLL herr_t H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_get_nrec(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, hsize_t *nrec); -H5_DLL herr_t H5B2_get_nrec_2(const H5B2_t *bt2, hsize_t *nrec); -H5_DLL herr_t H5B2_iterate_size(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, - haddr_t addr, hsize_t *op_data); -H5_DLL herr_t H5B2_iterate_size_2(H5B2_t *bt2, hid_t dxpl_id, +H5_DLL herr_t H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec); +H5_DLL herr_t H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size); H5_DLL herr_t H5B2_close(H5B2_t *bt2, hid_t dxpl_id); H5_DLL herr_t H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5B2_remove_t op, void *op_data); /* Statistics routines */ -H5_DLL herr_t H5B2_stat_info(H5F_t *f, hid_t dxpl_id, haddr_t addr, - H5B2_stat_t *info); -H5_DLL herr_t H5B2_stat_info_2(H5B2_t *bt2, hid_t dxpl_id, H5B2_stat_t *info); +H5_DLL herr_t H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info); #endif /* _H5B2private_H */ diff --git a/src/H5B2stat.c b/src/H5B2stat.c index 391d96d..0ee404e 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -71,7 +71,7 @@ /*------------------------------------------------------------------------- - * Function: H5B2_stat_info_2 + * Function: H5B2_stat_info * * Purpose: Retrieve metadata statistics for a v2 B-tree * @@ -84,11 +84,11 @@ *------------------------------------------------------------------------- */ herr_t -H5B2_stat_info_2(H5B2_t *bt2, hid_t dxpl_id, H5B2_stat_t *info) +H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_stat_info_2) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_stat_info) /* Check arguments. */ HDassert(info); @@ -104,49 +104,55 @@ H5B2_stat_info_2(H5B2_t *bt2, hid_t dxpl_id, H5B2_stat_t *info) info->nrecords = hdr->root.all_nrec; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_stat_info_2() */ +} /* H5B2_stat_info() */ /*------------------------------------------------------------------------- - * Function: H5B2_stat_info + * Function: H5B2_size * - * Purpose: Retrieve metadata statistics for a v2 B-tree + * Purpose: Iterate over all the records in the B-tree, collecting + * storage info. * - * Return: Success: non-negative + * Return: non-negative on success, negative on error * - * Failure: negative - * - * Programmer: Quincey Koziol - * Monday, March 6, 2006 + * Programmer: Vailin Choi + * June 19 2007 * *------------------------------------------------------------------------- */ herr_t -H5B2_stat_info(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5B2_stat_t *info) +H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size) { - H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ - herr_t ret_value = SUCCEED; /* Return value */ + H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_stat_info) + FUNC_ENTER_NOAPI(H5B2_size, FAIL) /* Check arguments. */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(info); + HDassert(bt2); + HDassert(btree_size); - /* Look up the B-tree header */ - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, NULL, NULL, H5AC_READ))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header") + /* Set the shared v2 B-tree header's file context for this operation */ + bt2->hdr->f = bt2->f; - /* Get information about the B-tree */ - info->depth = hdr->depth; - info->nrecords = hdr->root.all_nrec; + /* Get the v2 B-tree header */ + hdr = bt2->hdr; -done: - /* Release B-tree header node */ - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") + /* Add size of header to B-tree metadata total */ + *btree_size += H5B2_HEADER_SIZE(hdr); + + /* Iterate through records */ + if(hdr->root.node_nrec > 0) { + /* Check for root node being a leaf */ + if(hdr->depth == 0) + *btree_size += hdr->node_size; + else + /* Iterate through nodes */ + if(H5B2_node_size(hdr, dxpl_id, hdr->depth, &hdr->root, btree_size) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") + } /* end if */ +done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_stat_info() */ +} /* H5B2_size() */ diff --git a/src/H5B2test.c b/src/H5B2test.c index 28f6dc2..863c886 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -222,7 +222,7 @@ H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, /*------------------------------------------------------------------------- - * Function: H5B2_get_root_addr_test_2 + * Function: H5B2_get_root_addr_test * * Purpose: Retrieve the root node's address * @@ -235,9 +235,9 @@ H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, *------------------------------------------------------------------------- */ herr_t -H5B2_get_root_addr_test_2(H5B2_t *bt2, haddr_t *root_addr) +H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_get_root_addr_test_2) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_get_root_addr_test) /* Check arguments. */ HDassert(bt2); @@ -247,56 +247,11 @@ H5B2_get_root_addr_test_2(H5B2_t *bt2, haddr_t *root_addr) *root_addr = bt2->hdr->root.addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_get_root_addr_test_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_get_root_addr_test - * - * Purpose: Retrieve the root node's address - * - * Return: Success: non-negative - * - * Failure: negative - * - * Programmer: Quincey Koziol - * Saturday, February 26, 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_get_root_addr_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, - haddr_t addr, haddr_t *root_addr) -{ - H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5B2_get_root_addr_test) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - HDassert(root_addr); - - /* Look up the B-tree header */ - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, cls, NULL, H5AC_READ))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header") - - /* Get B-tree root addr */ - *root_addr = hdr->root.addr; - -done: - /* Release B-tree header node */ - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_get_root_addr_test() */ /*------------------------------------------------------------------------- - * Function: H5B2_get_node_info_test_2 + * Function: H5B2_get_node_info_test * * Purpose: Determine information about a node holding a record in the B-tree * @@ -309,7 +264,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_get_node_info_test_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, +H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_node_info_test_t *ninfo) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ @@ -319,7 +274,7 @@ H5B2_get_node_info_test_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_get_node_info_test_2, FAIL) + FUNC_ENTER_NOAPI(H5B2_get_node_info_test, FAIL) /* Check arguments. */ HDassert(bt2); @@ -408,172 +363,10 @@ H5B2_get_node_info_test_2(H5B2_t *bt2, hid_t dxpl_id, void *udata, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_get_node_info_test_2() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_get_node_info_test - * - * Purpose: Determine information about a node holding a record in the B-tree - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Quincey Koziol - * Thursday, August 31, 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5B2_get_node_info_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, - haddr_t addr, void *udata, H5B2_node_info_test_t *ninfo) -{ - H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ - H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ - unsigned depth; /* Current depth of the tree */ - int cmp; /* Comparison value of records */ - unsigned idx; /* Location of record which matches key */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5B2_get_node_info_test, FAIL) - - /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); - - /* Look up the B-tree header */ - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, cls, NULL, H5AC_READ))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree header") - - /* Set file pointer for this B-tree operation */ - hdr->f = f; - - /* Make copy of the root node pointer to start search with */ - curr_node_ptr = hdr->root; - - /* Current depth of the tree */ - depth = hdr->depth; - - /* Check for empty tree */ - if(0 == curr_node_ptr.node_nrec) - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "B-tree has no records") - - /* Walk down B-tree to find record or leaf node where record is located */ - cmp = -1; - while(depth > 0 && cmp != 0) { - H5B2_internal_t *internal; /* Pointer to internal node in B-tree */ - H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ - - /* Lock B-tree current node */ - if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") - - /* Locate node pointer for child */ - cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx); - if(cmp > 0) - idx++; - - if(cmp != 0) { - /* Get node pointer for next node to search */ - next_node_ptr = internal->node_ptrs[idx]; - - /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, 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 */ - curr_node_ptr = next_node_ptr; - } /* end if */ - else { - /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") - - /* Fill in information about the node */ - ninfo->depth = depth; - ninfo->nrec = curr_node_ptr.node_nrec; - - /* Indicate success */ - HGOTO_DONE(SUCCEED) - } /* end else */ - - /* Decrement depth we're at in B-tree */ - depth--; - } /* end while */ - - { - H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ - - /* Lock B-tree leaf node */ - if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, &(curr_node_ptr.node_nrec), hdr, H5AC_READ))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") - - /* Locate record */ - cmp = H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx); - - /* Unlock current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") - - /* Indicate the depth that the record was found */ - if(cmp != 0) - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "record not in B-tree") - } /* end block */ - - /* Fill in information about the leaf node */ - ninfo->depth = depth; - ninfo->nrec = curr_node_ptr.node_nrec; - -done: - /* Release header */ - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header info") - - FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_get_node_info_test() */ /*------------------------------------------------------------------------- - * Function: H5B2_get_node_depth_test_2 - * - * Purpose: Determine the depth of a node holding a record in the B-tree - * - * Note: Just a simple wrapper around the H5B2_get_node_info_test() routine - * - * Return: Success: non-negative depth of the node where the record - * was found - * Failure: negative - * - * Programmer: Quincey Koziol - * Saturday, August 26, 2006 - * - *------------------------------------------------------------------------- - */ -int -H5B2_get_node_depth_test_2(H5B2_t *bt2, hid_t dxpl_id, void *udata) -{ - H5B2_node_info_test_t ninfo; /* Node information */ - int ret_value; /* Return information */ - - FUNC_ENTER_NOAPI(H5B2_get_node_depth_test_2, FAIL) - - /* Check arguments. */ - HDassert(bt2); - - /* Get information abou the node */ - if(H5B2_get_node_info_test_2(bt2, dxpl_id, udata, &ninfo) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "error looking up node info") - - /* Set return value */ - ret_value = (int)ninfo.depth; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_get_node_depth_test_2() */ - - -/*------------------------------------------------------------------------- * Function: H5B2_get_node_depth_test * * Purpose: Determine the depth of a node holding a record in the B-tree @@ -590,8 +383,7 @@ done: *------------------------------------------------------------------------- */ int -H5B2_get_node_depth_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr_t addr, - void *udata) +H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata) { H5B2_node_info_test_t ninfo; /* Node information */ int ret_value; /* Return information */ @@ -599,12 +391,10 @@ H5B2_get_node_depth_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls, haddr FUNC_ENTER_NOAPI(H5B2_get_node_depth_test, FAIL) /* Check arguments. */ - HDassert(f); - HDassert(cls); - HDassert(H5F_addr_defined(addr)); + HDassert(bt2); /* Get information abou the node */ - if(H5B2_get_node_info_test(f, dxpl_id, cls, addr, udata, &ninfo) < 0) + if(H5B2_get_node_info_test(bt2, dxpl_id, udata, &ninfo) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "error looking up node info") /* Set return value */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 7dea804..f935a74 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -326,7 +326,7 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); fheap_id_len; /* Fractal heap ID */ bt2_cparam.split_percent = H5G_NAME_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5G_NAME_BT2_MERGE_PERC; - if(NULL == (bt2_name = H5B2_create_2(f, dxpl_id, &bt2_cparam))) + if(NULL == (bt2_name = H5B2_create(f, dxpl_id, &bt2_cparam))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for name index") /* Retrieve the v2 B-tree's address in the file */ @@ -346,7 +346,7 @@ HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr) fheap_id_len; /* Fractal heap ID */ bt2_cparam.split_percent = H5G_CORDER_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5G_CORDER_BT2_MERGE_PERC; - if(NULL == (bt2_corder = H5B2_create_2(f, dxpl_id, &bt2_cparam))) + if(NULL == (bt2_corder = H5B2_create(f, dxpl_id, &bt2_cparam))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for creation order index") /* Retrieve the v2 B-tree's address in the file */ @@ -453,7 +453,7 @@ HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDst /* udata.id already set in H5HF_insert() call */ /* Insert link into 'name' tracking v2 B-tree */ - if(H5B2_insert_2(bt2_name, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_name, dxpl_id, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") /* Check if we should create a creation order index v2 B-tree record */ @@ -464,7 +464,7 @@ HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDst HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Insert the record into the creation order index v2 B-tree */ - if(H5B2_insert_2(bt2_corder, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_corder, dxpl_id, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") } /* end if */ @@ -570,7 +570,7 @@ H5G_dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.found_op_data = lnk; /* Find & copy the named link in the 'name' index */ - if((ret_value = H5B2_find_2(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((ret_value = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in name index") done: @@ -743,7 +743,7 @@ H5G_dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.lnk = lnk; /* Find & copy the link in the appropriate index */ - if(H5B2_index_2(bt2, dxpl_id, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, dxpl_id, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in index") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ @@ -1056,7 +1056,7 @@ H5G_dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, /* Iterate over the records in the v2 B-tree's "native" order */ /* (by hash of name) */ - if((ret_value = H5B2_iterate_2(bt2, dxpl_id, H5G_dense_iterate_bt2_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, dxpl_id, H5G_dense_iterate_bt2_cb, &udata)) < 0) HERROR(H5E_SYM, H5E_BADITER, "link iteration failed"); /* Update the last link examined, if requested */ @@ -1255,7 +1255,7 @@ H5G_dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, udata.name_size = size; /* Retrieve the name according to the v2 B-tree's index order */ - if(H5B2_index_2(bt2, dxpl_id, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, dxpl_id, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLIST, FAIL, "can't locate object in v2 B-tree") /* Set return value */ @@ -1334,7 +1334,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) bt2_udata.corder = lnk->corder; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_2(bt2, udata->dxpl_id, &bt2_udata, NULL, NULL) < 0) + if(H5B2_remove(bt2, udata->dxpl_id, &bt2_udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from creation order index v2 B-tree") } /* end if */ @@ -1457,7 +1457,7 @@ H5G_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.replace_names = TRUE; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_2(bt2, dxpl_id, &udata, H5G_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_remove(bt2, dxpl_id, &udata, H5G_dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from name index v2 B-tree") done: @@ -1583,7 +1583,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set the common information for the v2 B-tree remove operation */ /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_2(bt2, bt2_udata->dxpl_id, &other_bt2_udata, NULL, NULL) < 0) + if(H5B2_remove(bt2, bt2_udata->dxpl_id, &other_bt2_udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, H5_ITER_ERROR, "unable to remove link from 'other' index v2 B-tree") } /* end if */ @@ -1694,7 +1694,7 @@ H5G_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.grp_full_path_r = grp_full_path_r; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_by_idx_2(bt2, dxpl_id, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0) + if(H5B2_remove_by_idx(bt2, dxpl_id, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from indexed v2 B-tree") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index fe85d18..4281ac0 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -336,7 +336,7 @@ H5G_obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) /* Retrieve # of records in "name" B-tree */ /* (should be same # of records in all indices) */ - if(H5B2_get_nrec_2(bt2_name, &linfo->nlinks) < 0) + if(H5B2_get_nrec(bt2_name, &linfo->nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve # of records in index") } /* end if */ else { diff --git a/src/H5Goh.c b/src/H5Goh.c index fcba5bf..2494838 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -364,7 +364,7 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Get name index B-tree size */ - if(H5B2_iterate_size_2(bt2_name, dxpl_id, &bh_info->index_size) < 0) + if(H5B2_size(bt2_name, dxpl_id, &bh_info->index_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info for name index") } /* end if */ @@ -375,7 +375,7 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Get creation order index B-tree size */ - if(H5B2_iterate_size_2(bt2_corder, dxpl_id, &bh_info->index_size) < 0) + if(H5B2_size(bt2_corder, dxpl_id, &bh_info->index_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info for creation order index") } /* end if */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 1cfcdb6..791c13a 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -409,7 +409,7 @@ H5G_new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ - if(H5B2_get_nrec_2(bt2_name, name_count) < 0) + if(H5B2_get_nrec(bt2_name, name_count) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from name index") /* Check if there is a creation order index */ @@ -419,7 +419,7 @@ H5G_new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Retrieve # of records in creation order index */ - if(H5B2_get_nrec_2(bt2_corder, corder_count) < 0) + if(H5B2_get_nrec(bt2_corder, corder_count) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from creation order index") } /* end if */ else diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index b8d0057..353ceb3 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -157,7 +157,7 @@ H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) bt2_cparam.merge_percent = H5HF_HUGE_BT2_MERGE_PERC; /* Create v2 B-tree for tracking 'huge' objects */ - if(NULL == (hdr->huge_bt2 = H5B2_create_2(hdr->f, dxpl_id, &bt2_cparam))) + if(NULL == (hdr->huge_bt2 = H5B2_create(hdr->f, dxpl_id, &bt2_cparam))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create v2 B-tree for tracking 'huge' heap objects") /* Retrieve the v2 B-tree's address in the file */ @@ -403,7 +403,7 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu, %x, %Hu}\n", FUNC, obj_rec.addr, obj_ #endif /* QAK */ /* Insert record for object in v2 B-tree */ - if(H5B2_insert_2(hdr->huge_bt2, dxpl_id, &obj_rec) < 0) + if(H5B2_insert(hdr->huge_bt2, dxpl_id, &obj_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "couldn't insert object tracking record in v2 B-tree") /* Encode ID for user */ @@ -424,7 +424,7 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len); #endif /* QAK */ /* Insert record for object in v2 B-tree */ - if(H5B2_insert_2(hdr->huge_bt2, dxpl_id, &obj_rec) < 0) + if(H5B2_insert(hdr->huge_bt2, dxpl_id, &obj_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "couldn't insert object tracking record in v2 B-tree") /* Encode ID for user */ @@ -471,7 +471,7 @@ HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indi } /* end else */ /* Insert record for tracking object in v2 B-tree */ - if(H5B2_insert_2(hdr->huge_bt2, dxpl_id, ins_rec) < 0) + if(H5B2_insert(hdr->huge_bt2, dxpl_id, ins_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "couldn't insert object tracking record in v2 B-tree") /* Encode ID for user */ @@ -557,7 +557,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find_2(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's length */ @@ -571,7 +571,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find_2(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's length */ @@ -648,7 +648,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find_2(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -664,7 +664,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find_2(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -792,7 +792,7 @@ H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find_2(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -937,7 +937,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove_2(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_dir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_dir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end if */ else { @@ -950,7 +950,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove_2(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_dir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_dir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end else */ } /* end if */ @@ -963,7 +963,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove_2(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_indir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_indir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end if */ else { @@ -974,7 +974,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove_2(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end else */ } /* end else */ diff --git a/src/H5HFstat.c b/src/H5HFstat.c index 5b07e05..fb535b9 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -159,7 +159,7 @@ H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' objects") /* Get the B-tree storage */ - if(H5B2_iterate_size_2(bt2, dxpl_id, heap_size) < 0) + if(H5B2_size(bt2, dxpl_id, heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 88b15b3..c624ee1 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -1885,7 +1885,7 @@ H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Get name index B-tree size */ - if(H5B2_iterate_size_2(bt2_name, dxpl_id, &(bh_info->index_size)) < 0) + if(H5B2_size(bt2_name, dxpl_id, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ @@ -1896,7 +1896,7 @@ H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Get creation order index B-tree size */ - if(H5B2_iterate_size_2(bt2_corder, dxpl_id, &(bh_info->index_size)) < 0) + if(H5B2_size(bt2_corder, dxpl_id, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ diff --git a/src/H5Otest.c b/src/H5Otest.c index 31bcc86..45ade3a 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -198,7 +198,7 @@ H5O_is_attr_empty_test(hid_t oid) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ - if(H5B2_get_nrec_2(bt2_name, &nattrs) < 0) + if(H5B2_get_nrec(bt2_name, &nattrs) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from name index") } /* end if */ @@ -285,7 +285,7 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ - if(H5B2_get_nrec_2(bt2_name, &obj_nattrs) < 0) + if(H5B2_get_nrec(bt2_name, &obj_nattrs) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from name index") } /* end if */ @@ -367,7 +367,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ - if(H5B2_get_nrec_2(bt2_name, name_count) < 0) + if(H5B2_get_nrec(bt2_name, name_count) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from name index") /* Check if there is a creation order index */ @@ -377,7 +377,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Retrieve # of records in creation order index */ - if(H5B2_get_nrec_2(bt2_corder, corder_count) < 0) + if(H5B2_get_nrec(bt2_corder, corder_count) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOUNT, FAIL, "unable to retrieve # of records from creation order index") } /* end if */ else diff --git a/src/H5SM.c b/src/H5SM.c index a2e46d5..7a678cb 100755 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -475,7 +475,7 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) bt2_cparam.rrec_size = (size_t)H5SM_SOHM_ENTRY_SIZE(f); bt2_cparam.split_percent = H5SM_B2_SPLIT_PERCENT; bt2_cparam.merge_percent = H5SM_B2_MERGE_PERCENT; - if(NULL == (bt2 = H5B2_create_2(f, dxpl_id, &bt2_cparam))) + if(NULL == (bt2 = H5B2_create(f, dxpl_id, &bt2_cparam))) HGOTO_ERROR(H5E_SOHM, H5E_CANTCREATE, FAIL, "B-tree creation failed for SOHM index") /* Retrieve the v2 B-tree's address in the file */ @@ -721,7 +721,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, bt2_cparam.rrec_size = (size_t)H5SM_SOHM_ENTRY_SIZE(f); bt2_cparam.split_percent = H5SM_B2_SPLIT_PERCENT; bt2_cparam.merge_percent = H5SM_B2_MERGE_PERCENT; - if(NULL == (bt2 = H5B2_create_2(f, dxpl_id, &bt2_cparam))) + if(NULL == (bt2 = H5B2_create(f, dxpl_id, &bt2_cparam))) HGOTO_ERROR(H5E_SOHM, H5E_CANTCREATE, FAIL, "B-tree creation failed for SOHM index") /* Retrieve the v2 B-tree's address in the file */ @@ -750,7 +750,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, key.encoding = encoding_buf; /* Insert the message into the B-tree */ - if(H5B2_insert_2(bt2, dxpl_id, &key) < 0) + if(H5B2_insert(bt2, dxpl_id, &key) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "couldn't add SOHM to B-tree") /* Free buffer from H5SM_read_mesg */ @@ -1262,7 +1262,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, * return a heap ID, since a message with a reference count greater * than 1 is always shared in the heap. */ - if(H5B2_modify_2(bt2, dxpl_id, &key, H5SM_incr_ref, &op_data) >= 0) { + if(H5B2_modify(bt2, dxpl_id, &key, H5SM_incr_ref, &op_data) >= 0) { shared.u.heap_id = op_data.fheap_id; found = TRUE; } /* end if */ @@ -1348,7 +1348,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") } /* end if */ - if(H5B2_insert_2(bt2, dxpl_id, &key) < 0) + if(H5B2_insert(bt2, dxpl_id, &key) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "couldn't add SOHM to B-tree") } /* end else */ @@ -1709,7 +1709,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* If this returns failure, it means that the message wasn't found. * If it succeeds, a copy of the modified message will be returned. */ - if(H5B2_modify_2(bt2, dxpl_id, &key, H5SM_decr_ref, &message) <0) + if(H5B2_modify(bt2, dxpl_id, &key, H5SM_decr_ref, &message) <0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index") /* Point to the message */ @@ -1737,7 +1737,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") } /* end if */ - if(H5B2_remove_2(bt2, dxpl_id, &key, NULL, NULL) < 0) + if(H5B2_remove(bt2, dxpl_id, &key, NULL, NULL) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTREMOVE, FAIL, "unable to delete message from index") } /* end else */ @@ -2144,7 +2144,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") /* Look up the message in the v2 B-tree */ - if((msg_exists = H5B2_find_2(bt2, dxpl_id, &key, H5SM_get_refcount_bt2_cb, &message)) < 0) + if((msg_exists = H5B2_find(bt2, dxpl_id, &key, H5SM_get_refcount_bt2_cb, &message)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "error finding message in index") if(!msg_exists) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index") @@ -2589,7 +2589,7 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) if(NULL == (bt2 = H5B2_open(f, dxpl_id, table->indexes[u].index_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") - if(H5B2_iterate_size_2(bt2, dxpl_id, &(ih_info->index_size)) < 0) + if(H5B2_size(bt2, dxpl_id, &(ih_info->index_size)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") /* Close the v2 B-tree */ diff --git a/test/btree2.c b/test/btree2.c index e6e6058..6006dc8 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -133,7 +133,7 @@ create_btree(H5F_t *f, hid_t dxpl, const H5B2_create_t *cparam, H5B2_t **bt2, haddr_t *bt2_addr) { /* Create the v2 B-tree & get its address */ - if(NULL == (*bt2 = H5B2_create_2(f, dxpl, cparam))) + if(NULL == (*bt2 = H5B2_create(f, dxpl, cparam))) FAIL_STACK_ERROR if(H5B2_get_addr(*bt2, bt2_addr/*out*/) < 0) FAIL_STACK_ERROR @@ -198,12 +198,12 @@ error: *------------------------------------------------------------------------- */ static int -check_stats(H5B2_t *bt2, hid_t dxpl, const H5B2_stat_t *expected) +check_stats(H5B2_t *bt2, const H5B2_stat_t *expected) { H5B2_stat_t actual; /* Actual stats retrieved about v2 B-tree */ /* Get current stats */ - if(H5B2_stat_info_2(bt2, dxpl, &actual) < 0) + if(H5B2_stat_info(bt2, &actual) < 0) FAIL_STACK_ERROR if(actual.depth != expected->depth) TEST_ERROR @@ -236,7 +236,7 @@ check_node_depth(H5B2_t *bt2, hid_t dxpl, hsize_t record, unsigned depth) { int rec_depth; /* Depth of record in B-tree */ - if((rec_depth = H5B2_get_node_depth_test_2(bt2, dxpl, &record)) < 0) + if((rec_depth = H5B2_get_node_depth_test(bt2, dxpl, &record)) < 0) FAIL_STACK_ERROR if((unsigned)rec_depth != depth) TEST_ERROR @@ -268,7 +268,7 @@ check_node_info(H5B2_t *bt2, hid_t dxpl, hsize_t record, { H5B2_node_info_test_t rec_ninfo; /* Node info for record in B-tree */ - if(H5B2_get_node_info_test_2(bt2, dxpl, &record, &rec_ninfo) < 0) + if(H5B2_get_node_info_test(bt2, dxpl, &record, &rec_ninfo) < 0) FAIL_STACK_ERROR if(rec_ninfo.depth != ninfo->depth) TEST_ERROR @@ -497,7 +497,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to iterate over a B-tree with no records */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index hasn't changed */ if(idx != 0) @@ -505,13 +505,13 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find record in B-tree with no records */ idx = 0; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, NULL) != FALSE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, NULL) != FALSE) TEST_ERROR /* Attempt to index record in B-tree with no records */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, NULL); + ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -529,33 +529,33 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR record = 42; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in B-tree with 1 record */ /* (Should not be found, but not fail) */ idx = 41; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Try again with NULL 'op' */ /* (Should not be found, but not fail) */ - if(H5B2_find_2(bt2, dxpl, &idx, NULL, NULL) != FALSE) + if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != FALSE) TEST_ERROR /* Attempt to find existant record in B-tree with 1 record */ idx = 42; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) TEST_ERROR /* Try again with NULL 'op' */ - if(H5B2_find_2(bt2, dxpl, &idx, NULL, NULL) != TRUE) + if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != TRUE) TEST_ERROR /* Attempt to index non-existant record in B-tree with 1 record */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, NULL); + ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -563,7 +563,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with 1 record */ idx = 42; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) TEST_ERROR PASSED(); @@ -581,38 +581,38 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, * Test inserting second record into v2 B-tree, before all other records */ record = 34; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* * Test inserting third record into v2 B-tree, after all other records */ record = 56; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* * Test inserting fourth record into v2 B-tree, in the middle of other records */ record = 38; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in level-0 B-tree with several records */ /* (Should not be found, but not fail) */ idx = 41; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in level-0 B-tree with several record */ idx = 56; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) TEST_ERROR /* Attempt to index non-existant record in B-tree with several records */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)4, find_cb, NULL); + ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -620,16 +620,16 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with several records */ idx = 34; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) TEST_ERROR idx = 38; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0) TEST_ERROR idx = 42; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0) TEST_ERROR idx = 56; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0) TEST_ERROR /* Close the v2 B-tree */ @@ -703,14 +703,14 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Insert records to fill root leaf node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC - 1); u++) { record = u + 2; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 0; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC - 1); - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)33, (unsigned)0) < 0) TEST_ERROR @@ -721,13 +721,13 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Insert record to split root leaf node */ record = INSERT_SPLIT_ROOT_NREC + 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)33, (unsigned)1) < 0) TEST_ERROR @@ -739,16 +739,16 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Insert a couple more records, on the left side of the B-tree */ record = 0; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR record = 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC + 2); - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)33, (unsigned)1) < 0) TEST_ERROR @@ -760,7 +760,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -770,23 +770,23 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find non-existant record in level-1 B-tree */ /* (Should not be found, but not fail) */ idx = INSERT_SPLIT_ROOT_NREC + 10; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in root of level-1 B-tree */ idx = 33; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Attempt to find existant record in leaf of level-1 B-tree */ idx = 56; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Attempt to index non-existant record in level-1 B-tree */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL); + ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -794,17 +794,17 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-1 B-tree */ idx = 33; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in left leaf of level-1 B-tree */ idx = 0; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in right leaf of level-1 B-tree */ idx = 50; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Close the v2 B-tree */ @@ -875,14 +875,14 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + (INSERT_SPLIT_ROOT_NREC/2) + 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)INSERT_SPLIT_ROOT_NREC, (unsigned)1) < 0) TEST_ERROR @@ -895,14 +895,14 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Force redistribution from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1); - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1), (unsigned)1) < 0) TEST_ERROR @@ -926,14 +926,14 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)(INSERT_SPLIT_ROOT_NREC / 2), (unsigned)1) < 0) TEST_ERROR @@ -945,14 +945,14 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Force redistribution from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1), (unsigned)1) < 0) TEST_ERROR @@ -1026,14 +1026,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2); if(check_node_depth(bt2, dxpl, record, (unsigned)1) < 0) @@ -1046,14 +1046,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = 2 * INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 31; if(check_node_depth(bt2, dxpl, record, (unsigned)1) < 0) @@ -1081,14 +1081,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC / 2); if(check_node_depth(bt2, dxpl, record, (unsigned)1) < 0) @@ -1101,14 +1101,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, /* Force right node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = 2 * INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)62, (unsigned)1) < 0) TEST_ERROR @@ -1187,14 +1187,14 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1); - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (2 * INSERT_SPLIT_ROOT_NREC); if(check_node_depth(bt2, dxpl, record, (unsigned)1) < 0) @@ -1207,14 +1207,14 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = 2 * INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC / 2); if(check_node_depth(bt2, dxpl, record, (unsigned)1) < 0) @@ -1230,14 +1230,14 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Insert records to force middle node to redistribute */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = (2 * INSERT_SPLIT_ROOT_NREC) + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)52, (unsigned)1) < 0) TEST_ERROR @@ -1250,7 +1250,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1328,14 +1328,14 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 2); - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (2 * INSERT_SPLIT_ROOT_NREC) + (INSERT_SPLIT_ROOT_NREC / 2); if(check_node_depth(bt2, dxpl, record, (unsigned)1) < 0) @@ -1348,14 +1348,14 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, /* Force split from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 1; bt2_stat.nrecords = 3 * INSERT_SPLIT_ROOT_NREC; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)62, (unsigned)1) < 0) TEST_ERROR @@ -1370,7 +1370,7 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1445,19 +1445,19 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 9); u++) { record = u + 2; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + 1); u++) { record = u + 4; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)948, (unsigned)2) < 0) TEST_ERROR @@ -1468,18 +1468,18 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Add some extra records to left-most leaf */ record = 0; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR record = 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Add some extra records to middle leaf */ record = (INSERT_SPLIT_ROOT_NREC * 9) + 2; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR record = (INSERT_SPLIT_ROOT_NREC * 9) + 3; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the B-tree */ @@ -1489,7 +1489,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1499,12 +1499,12 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find non-existant record in level-2 B-tree */ /* (Should not be found, but not fail) */ idx = INSERT_SPLIT_ROOT_NREC * 30; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in root of level-2 B-tree */ idx = 948; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ @@ -1513,7 +1513,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in internal node of level-2 B-tree */ idx = 505; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ @@ -1522,7 +1522,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in leaf of level-2 B-tree */ idx = 555; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ @@ -1532,7 +1532,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in level-2 B-tree */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL); + ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -1540,17 +1540,17 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-2 B-tree */ idx = 948; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in internal node of level-2 B-tree */ idx = 505; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in leaf of level-2 B-tree */ idx = 555; - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Close the v2 B-tree */ @@ -1623,19 +1623,19 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* And fill rightmost leaf */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) { record = u + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) { record = u + INSERT_SPLIT_ROOT_NREC + 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2); - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)1008, (unsigned)2) < 0) TEST_ERROR @@ -1650,13 +1650,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Insert record to force redistribution of rightmost leaf */ record = u + INSERT_SPLIT_ROOT_NREC + 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)1008, (unsigned)2) < 0) TEST_ERROR @@ -1676,7 +1676,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)1008, (unsigned)2) < 0) TEST_ERROR @@ -1690,14 +1690,14 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)1008, (unsigned)2) < 0) TEST_ERROR @@ -1717,7 +1717,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)1008, (unsigned)2) < 0) /* Record in root node */ TEST_ERROR @@ -1731,14 +1731,14 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Add more records to middle leaf, to force a split and a 3 node redistribution on middle leaf */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 8) + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + (INSERT_SPLIT_ROOT_NREC / 2) + 2; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR if(check_node_depth(bt2, dxpl, (hsize_t)1008, (unsigned)2) < 0) /* Record in root node */ TEST_ERROR @@ -1755,7 +1755,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1831,19 +1831,19 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) { record = u + 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) { record = u + 2; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2); - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -1862,14 +1862,14 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force right-most leaf to split */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 2; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 30; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -1895,7 +1895,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 30; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -1909,13 +1909,13 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, /* Add another record to left-most leaf, to force a 1->2 node split on left leaf */ record = 0; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -1941,7 +1941,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -1958,13 +1958,13 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, /* Add another record to middle leaf, to force a node split on middle leaf */ record = (INSERT_SPLIT_ROOT_NREC * 8) + 1; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 30) + 2; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -1988,7 +1988,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2066,14 +2066,14 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* And fill up right internal node, to just before to redistribute it */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 44); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 44; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1318; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2091,13 +2091,13 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Insert record to redistribute right-most internal node */ record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 44 + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1822; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2120,7 +2120,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 44 + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1822; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2135,14 +2135,14 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Force left-most internal node to redistribute */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 6) - 4); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 50) - 3; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1570; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2160,7 +2160,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2238,14 +2238,14 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, /* (And fill up two child internal nodes) */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 59); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 59; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 2759; /* Record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2263,13 +2263,13 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, /* Insert record to split right-most internal node */ record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 59) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 2759; /* Left record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2295,7 +2295,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 59) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 2759; /* Left record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2310,14 +2310,14 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, /* Force left-most internal node to split */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 73) - (INSERT_SPLIT_ROOT_NREC / 4) + 4; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 870; /* Left record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2338,7 +2338,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2416,19 +2416,19 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Insert enough records to force root to split into 3 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 36); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 59) + 1; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2453,14 +2453,14 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Insert records to fill up middle internal node */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 36); - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 72) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2484,13 +2484,13 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Insert another record, forcing the middle internal node to redistribute */ record = u + (INSERT_SPLIT_ROOT_NREC * 36); - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 72) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 4; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1574; /* Left record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2516,7 +2516,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2595,12 +2595,12 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, /* (and fill right internal node) */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 31); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < (INSERT_SPLIT_ROOT_NREC * 74); u++) { record = u + ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3); - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2611,7 +2611,7 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = INSERT_SPLIT_ROOT_NREC * 74; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2632,14 +2632,14 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, /* Insert records to fill up middle internal node */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 31); - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 87) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2663,13 +2663,13 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, /* Insert record to split middle internal node */ record = u + (INSERT_SPLIT_ROOT_NREC * 31); - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ bt2_stat.depth = 2; bt2_stat.nrecords = (INSERT_SPLIT_ROOT_NREC * 87) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ if(check_node_depth(bt2, dxpl, record, (unsigned)2) < 0) @@ -2698,7 +2698,7 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2811,14 +2811,14 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Insert random records */ for(u = 0; u < INSERT_MANY; u++) { record = records[u]; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ bt2_stat.depth = 4; bt2_stat.nrecords = INSERT_MANY; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR /* Close the v2 B-tree */ @@ -2845,12 +2845,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Check up on B-tree after re-open */ bt2_stat.depth = 4; bt2_stat.nrecords = INSERT_MANY; - if(check_stats(bt2, dxpl, &bt2_stat) < 0) + if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate_2(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2860,7 +2860,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Attempt to find non-existant record in level-4 B-tree */ /* (Should not be found, but not fail) */ idx = INSERT_MANY * 2; - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Find random records */ @@ -2869,19 +2869,19 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); idx = (hsize_t)(HDrandom()%INSERT_MANY); /* Attempt to find existant record in root of level-4 B-tree */ - if(H5B2_find_2(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR } /* end for */ /* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */ H5E_BEGIN_TRY { - ret = H5B2_index_2(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); + ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR H5E_BEGIN_TRY { - ret = H5B2_index_2(bt2, dxpl, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); + ret = H5B2_index(bt2, dxpl, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -2894,12 +2894,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Attempt to find existant record in root of level-4 B-tree */ /* (in increasing order) */ - if(H5B2_index_2(bt2, dxpl, H5_ITER_INC, idx, find_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_INC, idx, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to find existant record in root of level-4 B-tree */ /* (in decreasing order) */ - if(H5B2_index_2(bt2, dxpl, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0) + if(H5B2_index(bt2, dxpl, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2913,14 +2913,14 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); record = INSERT_MANY / 2; H5E_BEGIN_TRY { - ret = H5B2_insert_2(bt2, dxpl, &record); + ret = H5B2_insert(bt2, dxpl, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -2993,7 +2993,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3003,7 +3003,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a record from a B-tree with no records */ record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove_2(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3019,11 +3019,11 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, /* Insert one record into B-tree */ record = 42; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3031,7 +3031,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -3041,7 +3041,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a non-existant record from a B-tree with 1 record */ record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove_2(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3058,7 +3058,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 42; rrecord = 0; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3066,7 +3066,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3074,7 +3074,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the root node has been freed */ @@ -3092,20 +3092,20 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, /* Insert several records into B-tree again */ record = 42; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR record = 34; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR record = 56; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR record = 38; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3123,7 +3123,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove_2(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3140,7 +3140,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 42; rrecord = 0; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3148,7 +3148,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3156,7 +3156,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the root node has not been freed */ @@ -3165,7 +3165,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 34; rrecord = 0; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3173,7 +3173,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3181,7 +3181,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the root node has not been freed */ @@ -3190,7 +3190,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 56; rrecord = 0; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3198,7 +3198,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3206,7 +3206,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the root node has not been freed */ @@ -3215,7 +3215,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 38; rrecord = 0; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3223,7 +3223,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3231,7 +3231,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the root node has been freed */ @@ -3304,12 +3304,12 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3317,7 +3317,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -3327,14 +3327,14 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a non-existant record from a B-tree with 1 record */ record = (INSERT_SPLIT_ROOT_NREC * 2) + 1; H5E_BEGIN_TRY { - ret = H5B2_remove_2(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3362,7 +3362,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR rrecord = 0; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3378,7 +3378,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3400,7 +3400,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR rrecord = 1; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3416,7 +3416,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3438,7 +3438,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR rrecord = 0; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3454,7 +3454,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3526,7 +3526,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3539,7 +3539,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3547,7 +3547,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -3562,7 +3562,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 8; u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3570,7 +3570,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3598,7 +3598,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 39; u++) { record = u; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3606,7 +3606,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3634,7 +3634,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 2; u++) { record = INSERT_SPLIT_ROOT_NREC + 2 + u; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3642,7 +3642,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3723,7 +3723,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3738,7 +3738,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3746,7 +3746,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -3761,7 +3761,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3769,7 +3769,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3796,7 +3796,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, /* Fill B-tree back up */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3814,7 +3814,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < ((3 * INSERT_SPLIT_ROOT_NREC) / 4) - 1; u++) { record = u; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3822,7 +3822,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3902,7 +3902,7 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3917,7 +3917,7 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -3925,7 +3925,7 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -3940,7 +3940,7 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < ((5 * INSERT_SPLIT_ROOT_NREC) / 6) - 1; u++) { record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -3948,7 +3948,7 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4028,7 +4028,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, /* Create level-1 B-tree with 5 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 4); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4049,7 +4049,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4057,7 +4057,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -4071,7 +4071,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ record = 220; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4095,7 +4095,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4117,7 +4117,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, record = 62; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4141,7 +4141,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4159,7 +4159,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, record = 125; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4183,7 +4183,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4255,7 +4255,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4270,7 +4270,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4278,7 +4278,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -4295,7 +4295,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar for(u = 0; u < 7; u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4303,7 +4303,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4313,7 +4313,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar record = 94; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4331,7 +4331,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4403,7 +4403,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4418,7 +4418,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4426,7 +4426,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -4443,7 +4443,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar for(u = 0; u < 7; u++) { record = 63 + u; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4451,7 +4451,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4461,7 +4461,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar record = 62; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4479,7 +4479,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4551,7 +4551,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4566,7 +4566,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4574,7 +4574,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -4591,7 +4591,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 14; u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4599,7 +4599,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4609,7 +4609,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, record = 87; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4624,7 +4624,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4696,7 +4696,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, /* Create level-2 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4711,7 +4711,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4719,7 +4719,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -4736,7 +4736,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 50; u++) { record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4744,7 +4744,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4754,7 +4754,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, record = 25; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4769,7 +4769,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4841,7 +4841,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, /* Create level-1 B-tree with 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4853,7 +4853,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4861,7 +4861,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -4876,7 +4876,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 14; u++) { record = INSERT_SPLIT_ROOT_NREC - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -4884,7 +4884,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4900,7 +4900,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -4908,7 +4908,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -4980,7 +4980,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4995,7 +4995,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5003,7 +5003,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -5024,7 +5024,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion */ record = 2960; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5039,7 +5039,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5064,7 +5064,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, record = 1133; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5079,7 +5079,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5104,7 +5104,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, record = 2267; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5119,7 +5119,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5144,7 +5144,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, record = 1889; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5159,7 +5159,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5179,7 +5179,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, record = 2834; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5194,7 +5194,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5266,7 +5266,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -5281,7 +5281,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5289,7 +5289,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -5311,7 +5311,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * for(u = 0; u < 8; u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5319,7 +5319,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5329,7 +5329,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * record = 3685; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5344,7 +5344,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5416,7 +5416,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -5431,7 +5431,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5439,7 +5439,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -5461,7 +5461,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * for(u = 0; u < 38; u++) { record = 63 + u; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5469,7 +5469,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5479,7 +5479,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * record = 62; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5494,7 +5494,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5566,7 +5566,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -5581,7 +5581,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5589,7 +5589,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -5611,7 +5611,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar for(u = 0; u < 15; u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5619,7 +5619,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5630,7 +5630,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar /* Force merge by promoting current right-most record */ record = 3678; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5645,7 +5645,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5717,7 +5717,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -5732,7 +5732,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5740,7 +5740,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -5762,7 +5762,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar for(u = 0; u < 112; u++) { record = 48 + u; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5770,7 +5770,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5781,7 +5781,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar /* Force merge of left-most internal nodes by promotion */ record = 25; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5796,7 +5796,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5868,7 +5868,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -5883,7 +5883,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5891,7 +5891,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -5906,7 +5906,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 21) + 15); u++) { record = u; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5914,7 +5914,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -5994,7 +5994,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -6009,7 +6009,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6017,7 +6017,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -6032,7 +6032,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 5) + 17); u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6040,7 +6040,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6120,7 +6120,7 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -6135,7 +6135,7 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6143,7 +6143,7 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -6158,7 +6158,7 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 23) + 15); u++) { record = (INSERT_SPLIT_ROOT_NREC * 20) + u; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6166,7 +6166,7 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6247,7 +6247,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -6262,7 +6262,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6270,7 +6270,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -6285,7 +6285,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 34) + 17; u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6293,7 +6293,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6302,7 +6302,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, } /* end for */ /* Check up on B-tree */ - if(H5B2_stat_info_2(bt2, dxpl, &bt2_stat) < 0) + if(H5B2_stat_info(bt2, &bt2_stat) < 0) FAIL_STACK_ERROR if(bt2_stat.depth != 1) TEST_ERROR @@ -6370,12 +6370,12 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, /* Insert random records */ for(u = 0; u < INSERT_MANY; u++) { record = records[u]; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ - if(H5B2_stat_info_2(bt2, dxpl, &bt2_stat) < 0) + if(H5B2_stat_info(bt2, &bt2_stat) < 0) FAIL_STACK_ERROR if(bt2_stat.depth != 4) TEST_ERROR @@ -6533,7 +6533,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); for(u = 0; u < INSERT_MANY; u++) { record = records[u]; rrecord = HSIZET_MAX; - if(H5B2_remove_2(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6541,7 +6541,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6550,7 +6550,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); } /* end for */ /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -6616,7 +6616,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); rrecord = HSIZET_MAX; /* Remove random record */ - if(H5B2_remove_by_idx_2(bt2, dxpl, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0) + if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6624,7 +6624,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6633,7 +6633,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); } /* end for */ /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -6697,7 +6697,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); for(u = 0; u < INSERT_MANY; u++) { /* Remove first record */ rrecord = HSIZET_MAX; - if(H5B2_remove_by_idx_2(bt2, dxpl, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0) + if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6705,7 +6705,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6714,7 +6714,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); } /* end for */ /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -6778,7 +6778,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); for(u = 0; u < INSERT_MANY; u++) { /* Remove last record */ rrecord = HSIZET_MAX; - if(H5B2_remove_by_idx_2(bt2, dxpl, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0) + if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6786,7 +6786,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Query the number of records in the B-tree */ - if(H5B2_get_nrec_2(bt2, &nrec) < 0) + if(H5B2_get_nrec(bt2, &nrec) < 0) FAIL_STACK_ERROR /* Make certain that the # of records is correct */ @@ -6795,7 +6795,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); } /* end for */ /* Query the address of the root node in the B-tree */ - if(H5B2_get_root_addr_test_2(bt2, &root_addr) < 0) + if(H5B2_get_root_addr_test(bt2, &root_addr) < 0) FAIL_STACK_ERROR /* Make certain that the address of the root node is defined */ @@ -6892,39 +6892,39 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, /* Insert records */ for(u = 0; u < FIND_NEIGHBOR; u++) { record = records[u]; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Attempt to find record B-tree less than a value */ search = 0; H5E_BEGIN_TRY { - ret = H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); + ret = H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR search = 1; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 0) TEST_ERROR search = 2; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 0) TEST_ERROR search = 3; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR search = 4; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR @@ -6938,7 +6938,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, /* Neighbor is in internal node */ search = 251; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 250) TEST_ERROR @@ -6952,13 +6952,13 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, /* Neighbor is in root node */ search = 1889; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 1888) TEST_ERROR search = (FIND_NEIGHBOR * 2) + 1; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != ((FIND_NEIGHBOR - 1) * 2)) TEST_ERROR @@ -6977,32 +6977,32 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find record B-tree less than a value */ search = (FIND_NEIGHBOR * 2) + 1; H5E_BEGIN_TRY { - ret = H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); + ret = H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR search = 0; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR search = 1; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR search = 2; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 4) TEST_ERROR search = 3; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 4) TEST_ERROR @@ -7016,20 +7016,20 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, /* Neighbor is in internal node */ search = 2895; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2896) TEST_ERROR /* Neighbor is in root node */ search = 1887; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 1888) TEST_ERROR search = ((FIND_NEIGHBOR - 1) * 2) - 1; - if(H5B2_neighbor_2(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != ((FIND_NEIGHBOR - 1) * 2)) TEST_ERROR @@ -7163,12 +7163,12 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) /* Insert records */ for(u = 0; u < DELETE_SMALL; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ - if(H5B2_stat_info_2(bt2, dxpl, &bt2_stat) < 0) + if(H5B2_stat_info(bt2, &bt2_stat) < 0) FAIL_STACK_ERROR if(bt2_stat.depth != 0) TEST_ERROR @@ -7216,12 +7216,12 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) /* Insert records */ for(u = 0; u < DELETE_MEDIUM; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ - if(H5B2_stat_info_2(bt2, dxpl, &bt2_stat) < 0) + if(H5B2_stat_info(bt2, &bt2_stat) < 0) FAIL_STACK_ERROR if(bt2_stat.depth != 1) TEST_ERROR @@ -7269,12 +7269,12 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) /* Insert records */ for(u = 0; u < DELETE_LARGE; u++) { record = u; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ - if(H5B2_stat_info_2(bt2, dxpl, &bt2_stat) < 0) + if(H5B2_stat_info(bt2, &bt2_stat) < 0) FAIL_STACK_ERROR if(bt2_stat.depth != 2) TEST_ERROR @@ -7363,12 +7363,12 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u * 5; - if(H5B2_insert_2(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, dxpl, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check up on B-tree */ - if(H5B2_stat_info_2(bt2, dxpl, &bt2_stat) < 0) + if(H5B2_stat_info(bt2, &bt2_stat) < 0) FAIL_STACK_ERROR if(bt2_stat.depth != 2) TEST_ERROR @@ -7377,7 +7377,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 3; modify = 4; H5E_BEGIN_TRY { - ret = H5B2_modify_2(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -7401,7 +7401,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to modify a record in a leaf node */ record = 4330; modify = 4331; - if(H5B2_modify_2(bt2, dxpl, &record, modify_cb, &modify) < 0) + if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0) FAIL_STACK_ERROR /* Check status of B-tree */ @@ -7414,7 +7414,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find modified record */ record = 4331; found = 4331; - if(H5B2_find_2(bt2, dxpl, &record, find_cb, &found) != TRUE) + if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE) FAIL_STACK_ERROR if(found != 4331) TEST_ERROR @@ -7423,7 +7423,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 4330; found = HSIZET_MAX; H5E_BEGIN_TRY { - ret = H5B2_modify_2(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -7447,7 +7447,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to modify a record in an internal node */ record = 5350; modify = 5352; - if(H5B2_modify_2(bt2, dxpl, &record, modify_cb, &modify) < 0) + if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0) FAIL_STACK_ERROR /* Check status of B-tree */ @@ -7460,7 +7460,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find modified record */ record = 5352; found = 5352; - if(H5B2_find_2(bt2, dxpl, &record, find_cb, &found) != TRUE) + if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE) STACK_ERROR if(found != 5352) TEST_ERROR @@ -7469,7 +7469,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 5350; found = 5350; H5E_BEGIN_TRY { - ret = H5B2_modify_2(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -7493,7 +7493,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to modify a record in a root node */ record = 9445; modify = 9448; - if(H5B2_modify_2(bt2, dxpl, &record, modify_cb, &modify) < 0) + if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0) FAIL_STACK_ERROR /* Check status of B-tree */ @@ -7506,7 +7506,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find modified record */ record = 9448; found = 9448; - if(H5B2_find_2(bt2, dxpl, &record, find_cb, &found) != TRUE) + if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE) STACK_ERROR if(found != 9448) TEST_ERROR @@ -7515,7 +7515,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 9445; found = 9445; H5E_BEGIN_TRY { - ret = H5B2_modify_2(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) -- cgit v0.12