diff options
-rw-r--r-- | src/H5B.c | 32 | ||||
-rw-r--r-- | src/H5Distore.c | 10 |
2 files changed, 38 insertions, 4 deletions
@@ -624,10 +624,10 @@ H5B_clear(H5F_t *f, H5B_t *bt, hbool_t destroy) if (destroy) if (H5B_dest(f, bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node"); + HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5B_clear() */ @@ -659,7 +659,7 @@ H5B_size(H5F_t *f, H5B_t *bt) assert(bt->type); ret_value = H5B_nodesize(f, bt->type, NULL, bt->sizeof_rkey); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -733,7 +733,15 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u } } if (cmp) + /* Note: don't push error on stack, leave that to next higher level, + * since many times the B-tree is searched in order to determine + * if an object exists in the B-tree or not. -QAK + */ +#ifdef OLD_WAY HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "B-tree key not found") +#else /* OLD_WAY */ + HGOTO_DONE(FAIL) +#endif /* OLD_WAY */ /* * Follow the link to the subtree or to the data node. @@ -753,10 +761,26 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u if (level > 0) { if (H5B_find(f, dxpl_id, type, child, udata) < 0) + /* Note: don't push error on stack, leave that to next higher level, + * since many times the B-tree is searched in order to determine + * if an object exists in the B-tree or not. -QAK + */ +#ifdef OLD_WAY HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "key not found in subtree") +#else /* OLD_WAY */ + HGOTO_DONE(FAIL) +#endif /* OLD_WAY */ } else { if ((type->found) (f, dxpl_id, child, nkey1, udata, nkey2) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "key not found in leaf node") + /* Note: don't push error on stack, leave that to next higher level, + * since many times the B-tree is searched in order to determine + * if an object exists in the B-tree or not. -QAK + */ +#ifdef OLD_WAY + HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "key not found in leaf node") +#else /* OLD_WAY */ + HGOTO_DONE(FAIL) +#endif /* OLD_WAY */ } done: diff --git a/src/H5Distore.c b/src/H5Distore.c index 032a776..94a9242 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -1440,8 +1440,10 @@ H5D_istore_lock(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, } else { H5D_fill_value_t fill_status; +#ifdef OLD_WAY /* Clear the error stack from not finding the chunk on disk */ H5E_clear(NULL); +#endif /* OLD_WAY */ /* Chunk size on disk isn't [likely] the same size as the final chunk * size in memory, so allocate memory big enough. */ @@ -2031,9 +2033,17 @@ H5D_istore_get_addr(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, /* Go get the chunk information */ if (H5B_find (f, dxpl_id, H5B_ISTORE, layout->u.chunk.addr, udata)<0) { + /* Note: don't push error on stack, leave that to next higher level, + * since many times the B-tree is searched in order to determine + * if a chunk exists in the B-tree or not. -QAK + */ +#ifdef OLD_WAY H5E_clear(NULL); HGOTO_ERROR(H5E_BTREE,H5E_NOTFOUND,HADDR_UNDEF,"Can't locate chunk info"); +#else /* OLD_WAY */ + HGOTO_DONE(HADDR_UNDEF) +#endif /* OLD_WAY */ } /* end if */ /* Success! Set the return value */ |