diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2012-10-11 19:10:26 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2012-10-11 19:10:26 (GMT) |
commit | d2f3c1b991b1990fe70afa64b3ca1941165a94c4 (patch) | |
tree | c7ffa957a3d8f415f7faab9b7b2e65f9e5d0b759 /src/H5B2int.c | |
parent | d179489d46c95e068ed6fc7f4c413c88cd9da28d (diff) | |
download | hdf5-d2f3c1b991b1990fe70afa64b3ca1941165a94c4.zip hdf5-d2f3c1b991b1990fe70afa64b3ca1941165a94c4.tar.gz hdf5-d2f3c1b991b1990fe70afa64b3ca1941165a94c4.tar.bz2 |
[svn-r22885] Purpose:
Adds some additional flush dependency plumbing and fixes some minor
issues with the v2 B-tree code.
Tested on:
local Ubuntu VM
Diffstat (limited to 'src/H5B2int.c')
-rw-r--r-- | src/H5B2int.c | 112 |
1 files changed, 88 insertions, 24 deletions
diff --git a/src/H5B2int.c b/src/H5B2int.c index 3d6ac14..7f56352 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -403,9 +403,9 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(left_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)left_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(right_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)right_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -746,9 +746,9 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(right_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)right_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(left_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)left_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -868,9 +868,9 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(left_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)left_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(right_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)right_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -1189,9 +1189,9 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(middle_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)middle_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(left_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)left_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -1305,9 +1305,9 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(middle_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)middle_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(right_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)right_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -1421,9 +1421,9 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(left_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)left_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(middle_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)middle_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end else */ @@ -1536,9 +1536,9 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(right_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)right_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(middle_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)middle_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -1830,9 +1830,9 @@ H5B2_merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(right_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)right_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(left_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)left_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -2135,9 +2135,9 @@ H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(middle_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)middle_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(left_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)left_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -2227,9 +2227,9 @@ H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Update flush dependencies if necessary */ if(update_deps) { - if(H5AC_destroy_flush_dependency(right_child, grandchild) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)right_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(middle_child, grandchild) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)middle_child, (H5AC_info_t *)grandchild) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -3196,9 +3196,9 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Update flush dependency if necessary */ if(update_dep) { - if(H5AC_destroy_flush_dependency(internal, new_root) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)internal, (H5AC_info_t *)new_root) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(hdr, new_root) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)hdr, (H5AC_info_t *)new_root) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -3565,9 +3565,9 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Update flush dependency if necessary */ if(update_dep) { - if(H5AC_destroy_flush_dependency(internal, new_root) < 0) + if(H5B2__destroy_flush_depend((H5AC_info_t *)internal, (H5AC_info_t *)new_root) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - if(H5AC_create_flush_dependency(hdr, new_root) < 0) + if(H5B2__create_flush_depend((H5AC_info_t *)hdr, (H5AC_info_t *)new_root) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") } /* end if */ @@ -4505,3 +4505,67 @@ H5B2_assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2 } /* end H5B2_assert_internal2() */ #endif /* H5B2_DEBUG */ + +/*------------------------------------------------------------------------- + * Function: H5B2__create_flush_depend + * + * Purpose: Create a flush dependency between two data structure components + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Fall 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5B2__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(parent_entry); + HDassert(child_entry); + + /* Create a flush dependency between parent and child entry */ + if(H5AC_create_flush_dependency(parent_entry, child_entry) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5B2__create_flush_depend() */ + + +/*------------------------------------------------------------------------- + * Function: H5B2__destroy_flush_depend + * + * Purpose: Destroy a flush dependency between two data structure components + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Fall 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5B2__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(parent_entry); + HDassert(child_entry); + + /* Destroy a flush dependency between parent and child entry */ + if(H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5B2__destroy_flush_depend() */ + |