diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2012-05-30 21:44:06 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2012-05-30 21:44:06 (GMT) |
commit | 1f6cb6f84a0fdeec79938624ef874d4147d52d87 (patch) | |
tree | c261f3f4c5925730b59b98604ceaa6549b52b62c /src | |
parent | edebad0e78f322580c17647e57f6e74a1d0f5dcf (diff) | |
download | hdf5-1f6cb6f84a0fdeec79938624ef874d4147d52d87.zip hdf5-1f6cb6f84a0fdeec79938624ef874d4147d52d87.tar.gz hdf5-1f6cb6f84a0fdeec79938624ef874d4147d52d87.tar.bz2 |
[svn-r22421] Misc enhancements for revise_chunks branch noticed while working on v2 b-trees,
but not related to v2 b-trees.
Tested: durandal
Diffstat (limited to 'src')
-rw-r--r-- | src/H5B.c | 14 | ||||
-rw-r--r-- | src/H5B2hdr.c | 2 | ||||
-rw-r--r-- | src/H5Dbtree.c | 2 |
3 files changed, 8 insertions, 10 deletions
@@ -625,7 +625,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, unsigned i; /* - * We must clone the old btree so readers with an out-of-date version + * We must clone the old btree so readers with an out-of-date version * of the parent can still see all its children, via the shadowed * non-split bt. Remove it from cache but do not mark it free on disk. */ @@ -639,16 +639,14 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, HGOTO_ERROR(H5E_BTREE, H5E_CANTPIN, FAIL, "unable to pin old b-tree node") bt_pinned = TRUE; - /* Unprotect bt so we can move it. Also, note that it will be marked - * dirty so it will be written to the new location. */ - HDassert(bt_ud->cache_flags & H5AC__DIRTIED_FLAG); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud->addr, bt_ud->bt, bt_ud->cache_flags) < 0) + /* Unprotect bt so we can move it. Do not mark it dirty yet so it is + * not flushed to the old location (however unlikely). */ + if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud->addr, bt_ud->bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release old b-tree") - bt_ud->cache_flags = H5AC__NO_FLAGS_SET; /* Move the location of the old child on the disk */ if(H5AC_move_entry(f, H5AC_BT, bt_ud->addr, new_bt_addr) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node") + HGOTO_ERROR(H5E_BTREE, H5E_CANTMOVE, FAIL, "unable to move B-tree node") bt_ud->addr = new_bt_addr; /* Re-protect bt at new address */ @@ -729,7 +727,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, } /* end if */ bt_ud->bt->right = split_bt_ud->addr; - bt_ud->cache_flags |= H5AC__DIRTIED_FLAG; + HDassert(bt_ud->cache_flags & H5AC__DIRTIED_FLAG); done: if(ret_value < 0) { diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index c90b296..b73c29a 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -601,6 +601,6 @@ done: if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_HDR, hdr->addr, hdr, cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header") - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5B2_hdr_delete() */ diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index eb6b2ac..57fdd8d 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -1619,7 +1619,7 @@ H5D_btree_idx_support(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, { H5O_loc_t oloc; /* Temporary object header location for dataset */ H5O_t *oh = NULL; /* Dataset's object header */ - herr_t ret_value; /* Return value */ + htri_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT |