summaryrefslogtreecommitdiffstats
path: root/src/H5Dbtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Dbtree.c')
-rw-r--r--src/H5Dbtree.c65
1 files changed, 21 insertions, 44 deletions
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index 762c252..85238da 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -127,7 +127,7 @@ static herr_t H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info,
static herr_t H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info);
static hbool_t H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
static herr_t H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_ud_t *udata);
+ H5D_chunk_ud_t *udata, const H5D_t *dset);
static herr_t H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_ud_t *udata);
static int H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info,
@@ -153,21 +153,21 @@ static herr_t H5D__btree_idx_dest(const H5D_chk_idx_info_t *idx_info);
/* v1 B-tree indexed chunk I/O ops */
const H5D_chunk_ops_t H5D_COPS_BTREE[1] = {{
- H5D__btree_idx_init,
- H5D__btree_idx_create,
- H5D__btree_idx_is_space_alloc,
- H5D__btree_idx_insert,
- H5D__btree_idx_get_addr,
- NULL,
- H5D__btree_idx_iterate,
- H5D__btree_idx_remove,
- H5D__btree_idx_delete,
- H5D__btree_idx_copy_setup,
- H5D__btree_idx_copy_shutdown,
- H5D__btree_idx_size,
- H5D__btree_idx_reset,
- H5D__btree_idx_dump,
- H5D__btree_idx_dest
+ H5D__btree_idx_init, /* insert */
+ H5D__btree_idx_create, /* create */
+ H5D__btree_idx_is_space_alloc, /* is_space_alloc */
+ H5D__btree_idx_insert, /* insert */
+ H5D__btree_idx_get_addr, /* get_addr */
+ NULL, /* resize */
+ H5D__btree_idx_iterate, /* iterate */
+ H5D__btree_idx_remove, /* remove */
+ H5D__btree_idx_delete, /* delete */
+ H5D__btree_idx_copy_setup, /* copy_setup */
+ H5D__btree_idx_copy_shutdown, /* copy_shutdown */
+ H5D__btree_idx_size, /* size */
+ H5D__btree_idx_reset, /* reset */
+ H5D__btree_idx_dump, /* dump */
+ H5D__btree_idx_dest /* destroy */
}};
@@ -218,7 +218,6 @@ H5FL_DEFINE_STATIC(H5O_layout_chunk_t);
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static H5UC_t *
H5D__btree_get_shared(const H5F_t H5_ATTR_UNUSED *f, const void *_udata)
{
@@ -439,7 +438,6 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key)
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static htri_t
H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, const void *_lt_key,
void *_udata)
@@ -539,7 +537,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static H5B_ins_t
H5D__btree_insert(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, void *_lt_key,
hbool_t *lt_key_changed,
@@ -633,7 +630,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static H5B_ins_t
H5D__btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out */ ,
hbool_t *lt_key_changed /*out */ ,
@@ -649,7 +645,7 @@ H5D__btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out
/* Remove raw data chunk from file */
H5_CHECK_OVERFLOW(lt_key->nbytes, uint32_t, hsize_t);
if(H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, addr, (hsize_t)lt_key->nbytes) < 0)
- HGOTO_ERROR(H5E_STORAGE, H5E_CANTFREE, H5B_INS_ERROR, "unable to free chunk")
+ HGOTO_ERROR(H5E_STORAGE, H5E_CANTFREE, H5B_INS_ERROR, "unable to free chunk")
/* Mark keys as unchanged */
*lt_key_changed = FALSE;
@@ -761,7 +757,6 @@ H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key,
const void *_udata)
@@ -969,17 +964,12 @@ done:
static hbool_t
H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
{
- hbool_t ret_value = FALSE; /* Return value */
-
FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(storage);
- /* Set return value */
- ret_value = (hbool_t)H5F_addr_defined(storage->idx_addr);
-
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI((hbool_t)H5F_addr_defined(storage->idx_addr))
} /* end H5D__btree_idx_is_space_alloc() */
@@ -996,7 +986,8 @@ H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
+H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
+ const H5D_t H5_ATTR_UNUSED *dset)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1076,7 +1067,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static int
H5D__btree_idx_iterate_cb(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
const void *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key,
@@ -1353,9 +1343,8 @@ done:
static herr_t
H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
{
- H5D_chunk_common_ud_t udata; /* User-data for loading B-tree nodes */
+ H5D_chunk_common_ud_t udata; /* User-data for loading B-tree nodes */
H5B_info_t bt_info; /* B-tree info */
- hbool_t shared_init = FALSE; /* Whether shared B-tree info is initialized */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1368,11 +1357,6 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
HDassert(idx_info->storage);
HDassert(index_size);
- /* Initialize the shared info for the B-tree traversal */
- if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
- shared_init = TRUE;
-
/* Initialize B-tree node user-data */
HDmemset(&udata, 0, sizeof udata);
udata.layout = idx_info->layout;
@@ -1386,13 +1370,6 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
*index_size = bt_info.size;
done:
- if(shared_init) {
- if(NULL == idx_info->storage->u.btree.shared)
- HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil")
- if(H5UC_DEC(idx_info->storage->u.btree.shared) < 0)
- HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")
- } /* end if */
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__btree_idx_size() */