diff options
-rw-r--r-- | src/H5Abtree2.c | 16 | ||||
-rw-r--r-- | src/H5B2.c | 32 | ||||
-rw-r--r-- | src/H5B2cache.c | 3 | ||||
-rw-r--r-- | src/H5B2dbg.c | 35 | ||||
-rw-r--r-- | src/H5B2hdr.c | 6 | ||||
-rw-r--r-- | src/H5B2int.c | 19 | ||||
-rw-r--r-- | src/H5B2pkg.h | 2 | ||||
-rw-r--r-- | src/H5B2private.h | 4 | ||||
-rw-r--r-- | src/H5B2test.c | 2 | ||||
-rw-r--r-- | src/H5Dbtree2.c | 16 | ||||
-rw-r--r-- | src/H5Gbtree2.c | 18 | ||||
-rw-r--r-- | src/H5HF.c | 90 | ||||
-rw-r--r-- | src/H5HFbtree2.c | 35 | ||||
-rw-r--r-- | src/H5HFcache.c | 9 | ||||
-rw-r--r-- | src/H5HFdbg.c | 74 | ||||
-rw-r--r-- | src/H5HFhdr.c | 42 | ||||
-rw-r--r-- | src/H5HFhuge.c | 87 | ||||
-rw-r--r-- | src/H5HFman.c | 35 | ||||
-rw-r--r-- | src/H5HFpkg.h | 16 | ||||
-rw-r--r-- | src/H5HFprivate.h | 4 | ||||
-rw-r--r-- | src/H5SM.c | 62 | ||||
-rw-r--r-- | src/H5SMbtree2.c | 8 | ||||
-rw-r--r-- | src/H5SMprivate.h | 2 | ||||
-rw-r--r-- | src/H5VM.c | 4 | ||||
-rw-r--r-- | src/H5system.c | 3 | ||||
-rw-r--r-- | tools/misc/h5debug.c | 14 |
26 files changed, 454 insertions, 184 deletions
diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index b4bef75..972fb0b 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -85,8 +85,8 @@ static herr_t H5A__dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5A__dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5A__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *_udata); /* v2 B-tree driver callbacks for 'name' index */ static herr_t H5A__dense_btree2_name_store(void *native, const void *udata); @@ -95,8 +95,8 @@ static herr_t H5A__dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5A__dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5A__dense_btree2_name_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5A__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *_udata); /* Fractal heap function callbacks */ static herr_t H5A__dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); @@ -381,8 +381,8 @@ H5A__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_U *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_name_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) +H5A__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, + const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord; @@ -539,8 +539,8 @@ H5A__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) +H5A__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, + const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord; @@ -39,9 +39,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5B2pkg.h" /* v2 B-trees */ -#include "H5Eprivate.h" /* Error handling */ +#include "H5private.h" /* Generic Functions */ +#include "H5B2pkg.h" /* v2 B-trees */ +#include "H5Eprivate.h" /* Error handling */ /****************/ @@ -90,18 +90,18 @@ extern const H5B2_class_t H5D_BT2[1]; extern const H5B2_class_t H5D_BT2_FILT[1]; const H5B2_class_t *const H5B2_client_class_g[] = { - H5B2_TEST, /* 0 - H5B2_TEST_ID */ - H5HF_HUGE_BT2_INDIR, /* 1 - H5B2_FHEAP_HUGE_INDIR_ID */ - H5HF_HUGE_BT2_FILT_INDIR, /* 2 - H5B2_FHEAP_HUGE_FILT_INDIR_ID */ - H5HF_HUGE_BT2_DIR, /* 3 - H5B2_FHEAP_HUGE_DIR_ID */ - H5HF_HUGE_BT2_FILT_DIR, /* 4 - H5B2_FHEAP_HUGE_FILT_DIR_ID */ - H5G_BT2_NAME, /* 5 - H5B2_GRP_DENSE_NAME_ID */ - H5G_BT2_CORDER, /* 6 - H5B2_GRP_DENSE_CORDER_ID */ - H5SM_INDEX, /* 7 - H5B2_SOHM_INDEX_ID */ - H5A_BT2_NAME, /* 8 - H5B2_ATTR_DENSE_NAME_ID */ - H5A_BT2_CORDER, /* 9 - H5B2_ATTR_DENSE_CORDER_ID */ - H5D_BT2, /* 10 - H5B2_CDSET_ID */ - H5D_BT2_FILT, /* 11 - H5B2_CDSET_FILT_ID */ + H5B2_TEST, /* 0 - H5B2_TEST_ID */ + H5HF_HUGE_BT2_INDIR, /* 1 - H5B2_FHEAP_HUGE_INDIR_ID */ + H5HF_HUGE_BT2_FILT_INDIR, /* 2 - H5B2_FHEAP_HUGE_FILT_INDIR_ID */ + H5HF_HUGE_BT2_DIR, /* 3 - H5B2_FHEAP_HUGE_DIR_ID */ + H5HF_HUGE_BT2_FILT_DIR, /* 4 - H5B2_FHEAP_HUGE_FILT_DIR_ID */ + H5G_BT2_NAME, /* 5 - H5B2_GRP_DENSE_NAME_ID */ + H5G_BT2_CORDER, /* 6 - H5B2_GRP_DENSE_CORDER_ID */ + H5SM_INDEX, /* 7 - H5B2_SOHM_INDEX_ID */ + H5A_BT2_NAME, /* 8 - H5B2_ATTR_DENSE_NAME_ID */ + H5A_BT2_CORDER, /* 9 - H5B2_ATTR_DENSE_CORDER_ID */ + H5D_BT2, /* 10 - H5B2_CDSET_ID */ + H5D_BT2_FILT, /* 11 - H5B2_CDSET_FILT_ID */ }; @@ -442,7 +442,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, H5B2_nodepos_t curr_pos; /* Position of the current node */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(FALSE) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); diff --git a/src/H5B2cache.c b/src/H5B2cache.c index bb6c6ea..58e76af 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -702,7 +702,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, /* Version */ if(*image++ != H5B2_INT_VERSION) - HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree internal node version") + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree internal node version") /* B-tree type */ if(*image++ != (uint8_t)udata->hdr->cls->id) @@ -1008,7 +1008,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5B2__cache_int_free_icr() */ - /*------------------------------------------------------------------------- * Function: H5B2__cache_leaf_get_load_size diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 4d9a019..c7dc165 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -141,12 +141,12 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, */ HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Tree type ID:", hdr->cls->name, (unsigned)hdr->cls->id); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of node:", - hdr->node_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + (unsigned)hdr->node_size); + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of raw (disk) record:", - hdr->rrec_size); + (unsigned)hdr->rrec_size); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Dirty flag:", hdr->cache_info.is_dirty ? "True" : "False"); @@ -262,22 +262,19 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node") /* Print opening message */ - if(internal->depth == 1) - HDfprintf(stream, "%*sv2 B-tree Internal 'Leaf' Node...\n", indent, ""); - else - HDfprintf(stream, "%*sv2 B-tree Internal 'Branch' Node...\n", indent, ""); + HDfprintf(stream, "%*sv2 B-tree Internal Node...\n", indent, ""); /* * Print the values. */ HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Tree type ID:", hdr->cls->name, (unsigned)hdr->cls->id); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of node:", - hdr->node_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + (unsigned)hdr->node_size); + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of raw (disk) record:", - hdr->rrec_size); + (unsigned)hdr->rrec_size); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Dirty flag:", internal->cache_info.is_dirty ? "True" : "False"); @@ -300,8 +297,7 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); HDassert(H5B2_INT_NREC(internal, hdr, u)); - (void)(type->debug)(stream, f, dxpl_id, indent + 6, MAX (0, fwidth-6), - H5B2_INT_NREC(internal, hdr, u), dbg_ctx); + (void)(type->debug)(stream, indent + 6, MAX (0, fwidth-6), H5B2_INT_NREC(internal, hdr, u), dbg_ctx); } /* end for */ /* Print final node pointer */ @@ -404,12 +400,12 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent */ HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Tree type ID:", hdr->cls->name, (unsigned)hdr->cls->id); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of node:", - hdr->node_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + (unsigned)hdr->node_size); + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of raw (disk) record:", - hdr->rrec_size); + (unsigned)hdr->rrec_size); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Dirty flag:", leaf->cache_info.is_dirty ? "True" : "False"); @@ -424,8 +420,7 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); HDassert(H5B2_LEAF_NREC(leaf, hdr, u)); - (void)(type->debug)(stream, f, dxpl_id, indent + 6, MAX (0, fwidth-6), - H5B2_LEAF_NREC(leaf, hdr, u), dbg_ctx); + (void)(type->debug)(stream, indent + 6, MAX (0, fwidth-6), H5B2_LEAF_NREC(leaf, hdr, u), dbg_ctx); } /* end for */ done: diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 66c8019..f3945bc 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -109,7 +109,7 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t); */ herr_t H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, - void *parent, unsigned depth) + void *parent, uint16_t depth) { size_t sz_max_nrec; /* Temporary variable for range checking */ unsigned u_max_nrec_size; /* Temporary variable for range checking */ @@ -138,7 +138,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, hdr->pending_delete = FALSE; /* Assign dynamic information */ - hdr->depth = (uint16_t)depth; + hdr->depth = depth; /* Assign user's information */ hdr->split_percent = cparam->split_percent; @@ -313,7 +313,7 @@ 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(hdr, cparam, ctx_udata, parent, (unsigned)0) < 0) + if(H5B2__hdr_init(hdr, cparam, ctx_udata, parent, (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 */ diff --git a/src/H5B2int.c b/src/H5B2int.c index e1a268b..f7927db 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -744,6 +744,7 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, uint16_t new_left_nrec = (uint16_t)(*left_nrec + *right_nrec) / 2; /* New number of records for left child */ uint16_t move_nrec = (uint16_t)(*left_nrec - new_left_nrec); /* Number of records to move from left node to right */ + /* Sanity check */ HDassert(*left_nrec > *right_nrec); /* Slide records in right node up */ @@ -3173,8 +3174,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, } /* end if */ else { if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, - &internal_flags, idx) < 0) + parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ @@ -3185,8 +3185,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, } /* end if */ else { if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, - &internal_flags, (idx - 1)) < 0) + parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ @@ -3198,8 +3197,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, } /* end if */ else { if(H5B2__merge3(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, - &internal_flags, idx) < 0) + parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end else */ @@ -3601,8 +3599,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, } /* end if */ else { if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, - &internal_flags, idx) < 0) + parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ @@ -3613,8 +3610,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, } /* end if */ else { if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, - &internal_flags, (idx - 1)) < 0) + parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ @@ -3626,8 +3622,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, } /* end if */ else { if(H5B2__merge3(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, - &internal_flags, idx) < 0) + parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end else */ diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index d5ef9fe..834ef3d 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -315,7 +315,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, void *ctx_udata, void *parent); H5_DLL herr_t H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, - void *ctx_udata, void *parent, unsigned depth); + void *ctx_udata, void *parent, 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); diff --git a/src/H5B2private.h b/src/H5B2private.h index 472e4a4..1047a29 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -95,8 +95,8 @@ struct H5B2_class_t { herr_t (*compare)(const void *rec1, const void *rec2); /* Compare two native records */ herr_t (*encode)(uint8_t *raw, const void *record, void *ctx); /* Encode record from native form to disk storage form */ herr_t (*decode)(const uint8_t *raw, void *record, void *ctx); /* Decode record from disk storage form to native form */ - herr_t (*debug)(FILE *stream, const H5F_t *f, hid_t dxpl_id, /* Print a record for debugging */ - int indent, int fwidth, const void *record, const void *ctx); + herr_t (*debug)(FILE *stream, int indent, int fwidth, /* Print a record for debugging */ + const void *record, const void *ctx); void *(*crt_dbg_ctx)(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr); /* Create debugging context */ herr_t (*dst_dbg_ctx)(void *dbg_ctx); /* Destroy debugging context */ }; diff --git a/src/H5B2test.c b/src/H5B2test.c index 3fe7b52..654659b 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -301,7 +301,7 @@ H5B2__test_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUS { FUNC_ENTER_STATIC_NOERR - HDassert (record); + HDassert(record); HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Record:", *(const hsize_t *)record); diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index ecb0082..12b3194 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -96,14 +96,14 @@ static herr_t H5D__bt2_dst_dbg_context(void *_u_ctx); /* v2 B-tree class for indexing non-filtered chunked datasets */ static herr_t H5D__bt2_unfilt_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5D__bt2_unfilt_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5D__bt2_unfilt_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *u_ctx); +static herr_t H5D__bt2_unfilt_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *u_ctx); /* v2 B-tree class for indexing filtered chunked datasets */ static herr_t H5D__bt2_filt_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5D__bt2_filt_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5D__bt2_filt_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *u_ctx); +static herr_t H5D__bt2_filt_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *u_ctx); /* Helper routine */ static herr_t H5D__bt2_idx_open(const H5D_chk_idx_info_t *idx_info); @@ -563,8 +563,8 @@ H5D__bt2_unfilt_decode(const uint8_t *raw, void *_record, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5D__bt2_unfilt_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_record, const void *_u_ctx) +H5D__bt2_unfilt_debug(FILE *stream, int indent, int fwidth, + const void *_record, const void *_u_ctx) { const H5D_chunk_rec_t *record = (const H5D_chunk_rec_t *)_record; /* The native record */ const H5D_bt2_ctx_ud_t *u_ctx = (const H5D_bt2_ctx_ud_t *)_u_ctx; /* User data for creating callback context */ @@ -680,8 +680,8 @@ H5D__bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5D__bt2_filt_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_record, const void *_u_ctx) +H5D__bt2_filt_debug(FILE *stream, int indent, int fwidth, + const void *_record, const void *_u_ctx) { const H5D_chunk_rec_t *record = (const H5D_chunk_rec_t *)_record; /* The native record */ const H5D_bt2_ctx_ud_t *u_ctx = (const H5D_bt2_ctx_ud_t *)_u_ctx; /* User data for creating callback context */ diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 3c6fac6..b464930 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -83,8 +83,8 @@ static herr_t H5G_dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5G_dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_corder_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *_udata); /* v2 B-tree driver callbacks for 'name' index */ static herr_t H5G_dense_btree2_name_store(void *native, const void *udata); @@ -93,8 +93,8 @@ static herr_t H5G_dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5G_dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_name_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *_udata); /* Fractal heap function callbacks */ static herr_t H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); @@ -362,9 +362,8 @@ H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, + const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; unsigned u; /* Local index variable */ @@ -528,9 +527,8 @@ H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, + const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; unsigned u; /* Local index variable */ @@ -15,16 +15,16 @@ /*------------------------------------------------------------------------- * - * Created: H5HF.c - * Feb 24 2006 - * Quincey Koziol <koziol@hdfgroup.org> + * Created: H5HF.c + * Feb 24 2006 + * Quincey Koziol <koziol@ncsa.uiuc.edu> * - * Purpose: Implements a "fractal heap" for storing variable- - * length objects in a file. + * Purpose: Implements a "fractal heap" for storing variable- + * length objects in a file. * - * Please see the documentation in: - * doc/html/TechNotes/FractalHeap.html for a full description - * of how they work, etc. + * Please see the documentation in: + * doc/html/TechNotes/FractalHeap.html for a full description + * of how they work, etc. * *------------------------------------------------------------------------- */ @@ -169,7 +169,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) /* Create shared fractal heap header */ if(HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, dxpl_id, cparam))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header") /* Allocate fractal heap wrapper */ if(NULL == (fh = H5FL_MALLOC(H5HF_t))) @@ -182,11 +182,11 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) /* Point fractal heap wrapper at header and bump it's ref count */ fh->hdr = hdr; if(H5HF_hdr_incr(fh->hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Increment # of files using this heap header */ if(H5HF_hdr_fuse_incr(fh->hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") /* Set file pointer for this heap open context */ fh->f = f; @@ -253,7 +253,7 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) /* Increment # of files using this heap header */ if(H5HF_hdr_fuse_incr(fh->hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") /* Set file pointer for this heap open context */ fh->f = f; @@ -455,8 +455,8 @@ H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *_id, size_t *obj_len_p) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'tiny' object's length") } /* end if */ else { - HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); - HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") +HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); +HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ done: @@ -465,6 +465,68 @@ done: /*------------------------------------------------------------------------- + * Function: H5HF_get_obj_off + * + * Purpose: Get the offset of an entry in a fractal heap + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 20 2015 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, hsize_t *obj_off_p) +{ + const uint8_t *id = (const uint8_t *)_id; /* Object ID */ + uint8_t id_flags; /* Heap ID flag bits */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* + * Check arguments. + */ + HDassert(fh); + HDassert(id); + HDassert(obj_off_p); + + /* Get the ID flags */ + id_flags = *id; + + /* Check for correct heap ID version */ + if((id_flags & H5HF_ID_VERS_MASK) != H5HF_ID_VERS_CURR) + HGOTO_ERROR(H5E_HEAP, H5E_VERSION, FAIL, "incorrect heap ID version") + + /* Set the shared heap header's file context for this operation */ + fh->hdr->f = fh->f; + + /* Check type of object in heap */ + if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { + H5HF__man_get_obj_off(fh->hdr, id, obj_off_p); + } /* end if */ + else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { + /* Huge objects are located directly in the file */ + if(H5HF__huge_get_obj_off(fh->hdr, dxpl_id, id, obj_off_p) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's offset") + } /* end if */ + else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { + /* Tiny objects are not stored in the heap */ + *obj_off_p = (hsize_t)0; + } /* end if */ + else { +HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); +HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_get_obj_off() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_read * * Purpose: Read an object from a fractal heap into a buffer diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index efe52ef..d82de93 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -80,8 +80,8 @@ static herr_t H5HF__huge_bt2_indir_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5HF__huge_bt2_indir_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5HF__huge_bt2_indir_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5HF__huge_bt2_indir_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *_udata); /* Callbacks for filtered indirect objects */ static herr_t H5HF__huge_bt2_filt_indir_store(void *native, const void *udata); @@ -90,8 +90,8 @@ static herr_t H5HF__huge_bt2_filt_indir_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5HF__huge_bt2_filt_indir_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5HF__huge_bt2_filt_indir_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5HF__huge_bt2_filt_indir_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *_udata); /* Callbacks for direct objects */ static herr_t H5HF__huge_bt2_dir_store(void *native, const void *udata); @@ -100,8 +100,8 @@ static herr_t H5HF__huge_bt2_dir_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5HF__huge_bt2_dir_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5HF__huge_bt2_dir_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5HF__huge_bt2_dir_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *_udata); /* Callbacks for filtered direct objects */ static herr_t H5HF__huge_bt2_filt_dir_store(void *native, const void *udata); @@ -110,8 +110,8 @@ static herr_t H5HF__huge_bt2_filt_dir_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5HF__huge_bt2_filt_dir_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5HF__huge_bt2_filt_dir_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5HF__huge_bt2_filt_dir_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *_udata); /*********************/ /* Package Variables */ @@ -495,9 +495,8 @@ H5HF__huge_bt2_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF__huge_bt2_indir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5HF__huge_bt2_indir_debug(FILE *stream, int indent, int fwidth, + const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5HF_huge_bt2_indir_rec_t *nrecord = (const H5HF_huge_bt2_indir_rec_t *)_nrecord; @@ -700,9 +699,8 @@ H5HF__huge_bt2_filt_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF__huge_bt2_filt_indir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5HF__huge_bt2_filt_indir_debug(FILE *stream, int indent, int fwidth, + const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5HF_huge_bt2_filt_indir_rec_t *nrecord = (const H5HF_huge_bt2_filt_indir_rec_t *)_nrecord; @@ -889,9 +887,8 @@ H5HF__huge_bt2_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF__huge_bt2_dir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5HF__huge_bt2_dir_debug(FILE *stream, int indent, int fwidth, + const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5HF_huge_bt2_dir_rec_t *nrecord = (const H5HF_huge_bt2_dir_rec_t *)_nrecord; @@ -1107,8 +1104,8 @@ H5HF__huge_bt2_filt_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF__huge_bt2_filt_dir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) +H5HF__huge_bt2_filt_dir_debug(FILE *stream, int indent, int fwidth, + const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5HF_huge_bt2_filt_dir_rec_t *nrecord = (const H5HF_huge_bt2_filt_dir_rec_t *)_nrecord; diff --git a/src/H5HFcache.c b/src/H5HFcache.c index cff1772..7337f39 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -310,6 +310,10 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5HF__dtable_encode() */ +/**************************************************/ +/* metadata cache callback definitions for header */ +/**************************************************/ + /*------------------------------------------------------------------------- * Function: H5HF__cache_hdr_get_load_size() @@ -497,7 +501,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, if(NULL == (hdr = H5HF_hdr_alloc(udata->f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* Compute the 'base' size of the fractal heap header on disk */ + /* Compute the 'base' size of the fractal heap header on disk */ size = (size_t)H5HF_HEADER_SIZE(hdr); /* the size we have just calculated presumes that there is no I/O @@ -1657,6 +1661,7 @@ H5HF__cache_dblock_get_load_size(const void *_image, void *_udata, size_t *image HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { /* Check for root direct block */ @@ -1914,7 +1919,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, HDassert(!udata->decompressed); /* Allocate block buffer */ - /* XXX: Change to using free-list factories */ +/* XXX: Change to using free-list factories */ if(NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") } diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 3cb4d54..40191e5 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -100,6 +100,80 @@ static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, /*------------------------------------------------------------------------- + * Function: H5HF_id_print + * + * Purpose: Prints a fractal heap ID. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 20 2015 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_id_print(H5HF_t *fh, hid_t dxpl_id, const void *_id, FILE *stream, int indent, int fwidth) +{ + const uint8_t *id = (const uint8_t *)_id; /* Object ID */ + uint8_t id_flags; /* Heap ID flag bits */ + hsize_t obj_off; /* Offset of object */ + size_t obj_len; /* Length of object */ + char id_type; /* Character for the type of heap ID */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* + * Check arguments. + */ + HDassert(fh); + HDassert(id); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); + + /* Get the ID flags */ + id_flags = *id; + + /* Check for correct heap ID version */ + if((id_flags & H5HF_ID_VERS_MASK) != H5HF_ID_VERS_CURR) + HGOTO_ERROR(H5E_HEAP, H5E_VERSION, FAIL, "incorrect heap ID version") + + /* Check type of object in heap */ + if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { + id_type = 'M'; + } /* end if */ + else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { + id_type = 'H'; + } /* end if */ + else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { + id_type = 'T'; + } /* end if */ + else { +HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); +HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") + } /* end else */ + + /* Get the length of the heap object */ + if(H5HF_get_obj_len(fh, dxpl_id, id, &obj_len) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length") + + /* Get the offset of the heap object */ + if(H5HF_get_obj_off(fh, dxpl_id, id, &obj_off) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length") + + /* Display the heap ID */ + HDfprintf(stream, "%*s%-*s (%c, %Hu, %Zu)\n", indent, "", fwidth, + "Heap ID info: (type, offset, length)", + id_type, obj_off, obj_len); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_id_print() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_dtable_debug * * Purpose: Prints debugging info about a doubling table diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index e1e191d..d1426c6 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -122,7 +122,7 @@ H5HF_hdr_alloc(H5F_t *f) /* Allocate space for the shared information */ if(NULL == (hdr = H5FL_CALLOC(H5HF_hdr_t))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "allocation failed for fractal heap shared header") + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "allocation failed for fractal heap shared header") /* Set the internal parameters for the heap */ hdr->f = f; @@ -222,7 +222,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* Compute/cache some values */ hdr->heap_off_size = (uint8_t)H5HF_SIZEOF_OFFSET_BITS(hdr->man_dtable.cparam.max_index); if(H5HF_dtable_init(&hdr->man_dtable) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info") /* Set the size of heap IDs */ hdr->heap_len_size = (uint8_t)MIN(hdr->man_dtable.max_dir_blk_off_size, @@ -315,11 +315,11 @@ H5HF_hdr_finish_init(H5HF_hdr_t *hdr) /* First phase of header final initialization */ if(H5HF_hdr_finish_init_phase1(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #1 of header final initialization") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #1 of header final initialization") /* Second phase of header final initialization */ if(H5HF_hdr_finish_init_phase2(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #2 of header final initialization") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #2 of header final initialization") done: FUNC_LEAVE_NOAPI(ret_value) @@ -357,34 +357,34 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) #ifndef NDEBUG /* Check for valid parameters */ if(cparam->managed.width == 0) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width must be greater than zero") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width must be greater than zero") if(cparam->managed.width > H5HF_WIDTH_LIMIT) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width too large") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width too large") if(!POWER_OF_TWO(cparam->managed.width)) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width not power of two") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width not power of two") if(cparam->managed.start_block_size == 0) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "starting block size must be greater than zero") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "starting block size must be greater than zero") if(!POWER_OF_TWO(cparam->managed.start_block_size)) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "starting block size not power of two") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "starting block size not power of two") if(cparam->managed.max_direct_size == 0) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size must be greater than zero") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size must be greater than zero") if(cparam->managed.max_direct_size > H5HF_MAX_DIRECT_SIZE_LIMIT) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size too large") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size too large") if(!POWER_OF_TWO(cparam->managed.max_direct_size)) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not power of two") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not power of two") if(cparam->managed.max_direct_size < cparam->max_man_size) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks") if(cparam->managed.max_index == 0) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. heap size must be greater than zero") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. heap size must be greater than zero") #endif /* NDEBUG */ /* Allocate & basic initialization for the shared header */ if(NULL == (hdr = H5HF_hdr_alloc(f))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "can't allocate space for shared heap info") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "can't allocate space for shared heap info") #ifndef NDEBUG if(cparam->managed.max_index > (unsigned)(8 * hdr->sizeof_size)) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. heap size too large for file") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. heap size too large for file") #endif /* NDEBUG */ /* Set the creation parameters for the heap */ @@ -404,7 +404,7 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) /* First phase of header final initialization */ /* (doesn't need ID length set up) */ if(H5HF_hdr_finish_init_phase1(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #1 of header final initialization") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #1 of header final initialization") /* Copy any I/O filter pipeline */ /* (This code is not in the "finish init phase" routines because those @@ -489,21 +489,21 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) /* Second phase of header final initialization */ /* (needs ID and filter lengths set up) */ if(H5HF_hdr_finish_init_phase2(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #2 of header final initialization") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #2 of header final initialization") /* Extra checking for possible gap between max. direct block size minus * overhead and "huge" object size */ dblock_overhead = H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr); if((cparam->managed.max_direct_size - dblock_overhead) < cparam->max_man_size) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks") /* Allocate space for the header on disk */ if(HADDR_UNDEF == (hdr->heap_addr = H5MF_alloc(f, H5FD_MEM_FHEAP_HDR, dxpl_id, (hsize_t)hdr->heap_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for fractal heap header") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for fractal heap header") /* Cache the new fractal heap header */ if(H5AC_insert_entry(f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, HADDR_UNDEF, "can't add fractal heap header to cache") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, HADDR_UNDEF, "can't add fractal heap header to cache") /* Set address of heap header to return */ ret_value = hdr->heap_addr; diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index abf232d..95095e9 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -588,6 +588,93 @@ done: /*------------------------------------------------------------------------- + * Function: H5HF__huge_get_obj_off + * + * Purpose: Get the offset of a 'huge' object in a fractal heap + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 8 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, + hsize_t *obj_off_p) +{ + haddr_t obj_addr; /* Object's address in the file */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* + * Check arguments. + */ + HDassert(hdr); + HDassert(H5F_addr_defined(hdr->huge_bt2_addr)); + HDassert(id); + HDassert(obj_off_p); + + /* Skip over the flag byte */ + id++; + + /* Check if 'huge' object ID encodes address & length directly */ + if(hdr->huge_ids_direct) { + /* Retrieve the object's address (common) */ + H5F_addr_decode(hdr->f, &id, &obj_addr); + } /* end if */ + else { + /* Sanity check */ + HDassert(H5F_addr_defined(hdr->huge_bt2_addr)); + + /* Check if v2 B-tree is open yet */ + if(NULL == hdr->huge_bt2) { + /* Open existing v2 B-tree */ + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f, NULL))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") + } /* end if */ + + if(hdr->filter_len > 0) { + H5HF_huge_bt2_filt_indir_rec_t found_rec; /* Record found from tracking object */ + H5HF_huge_bt2_filt_indir_rec_t search_rec; /* Record for searching for object */ + + /* Get ID for looking up 'huge' object in v2 B-tree */ + UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) + + /* Look up object in v2 B-tree */ + 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 */ + obj_addr = found_rec.addr; + } /* end if */ + else { + H5HF_huge_bt2_indir_rec_t found_rec; /* Record found from tracking object */ + H5HF_huge_bt2_indir_rec_t search_rec; /* Record for searching for object */ + + /* Get ID for looking up 'huge' object in v2 B-tree */ + UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) + + /* Look up object in v2 B-tree */ + 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 */ + obj_addr = found_rec.addr; + } /* end else */ + } /* end else */ + + /* Set the value to return */ + *obj_off_p = (hsize_t)obj_addr; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__huge_get_obj_off() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_huge_op_real * * Purpose: Internal routine to perform an operation on a 'huge' object diff --git a/src/H5HFman.c b/src/H5HFman.c index fabf3c9..cff4395 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -257,6 +257,41 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) /*------------------------------------------------------------------------- + * Function: H5HF__man_get_obj_off + * + * Purpose: Get the offset of a managed heap object + * + * Return: SUCCEED (Can't fail) + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 20 2015 + * + *------------------------------------------------------------------------- + */ +void +H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p) +{ + FUNC_ENTER_PACKAGE_NOERR + + /* + * Check arguments. + */ + HDassert(hdr); + HDassert(id); + HDassert(obj_off_p); + + /* Skip over the flag byte */ + id++; + + /* Skip over object offset */ + UINT64DECODE_VAR(id, *obj_off_p, hdr->heap_off_size); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5HF__man_get_obj_off() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_man_op_real * * Purpose: Internal routine to perform an operation on a managed heap diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 28ceede..b4e6558 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -32,11 +32,11 @@ #include "H5HFprivate.h" /* Other private headers needed by this file */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5B2private.h" /* v2 B-trees */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5FSprivate.h" /* Free space manager */ -#include "H5SLprivate.h" /* Skip lists */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5B2private.h" /* v2 B-trees */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5FSprivate.h" /* Free space manager */ +#include "H5SLprivate.h" /* Skip lists */ /**************************/ /* Package Private Macros */ @@ -717,6 +717,8 @@ H5_DLL herr_t H5HF_man_insert(H5HF_hdr_t *fh, hid_t dxpl_id, size_t obj_size, const void *obj, void *id); H5_DLL herr_t H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); +H5_DLL void H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, + hsize_t *obj_off_p); H5_DLL herr_t H5HF_man_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id, void *obj); H5_DLL herr_t H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, @@ -731,6 +733,8 @@ H5_DLL herr_t H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, void *id); H5_DLL herr_t H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, size_t *obj_len_p); +H5_DLL herr_t H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, + const uint8_t *id, hsize_t *obj_off_p); H5_DLL herr_t H5HF_huge_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id, void *obj); H5_DLL herr_t H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, @@ -763,7 +767,7 @@ H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); /* Debugging routines for dumping file structures */ H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, - hbool_t dump_internal, FILE *stream, int indent, int fwidth); + hbool_t dump_internal, FILE *stream, int indent, int fwidth); H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth); H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index a32f21f..c052143 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -116,6 +116,8 @@ H5_DLL herr_t H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, void *id/*out*/); H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *id, size_t *obj_len_p/*out*/); +H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, + hsize_t *obj_off_p/*out*/); H5_DLL herr_t H5HF_read(H5HF_t *fh, hid_t dxpl_id, const void *id, void *obj/*out*/); H5_DLL herr_t H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *id, hbool_t *id_changed, @@ -133,6 +135,8 @@ H5_DLL herr_t H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats); H5_DLL herr_t H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size/*out*/); /* Debugging routines */ +H5_DLL herr_t H5HF_id_print(H5HF_t *fh, hid_t dxpl_id, + const void *id, FILE *stream, int indent, int fwidth); #ifdef H5HF_DEBUGGING H5_DLL herr_t H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth); @@ -1266,7 +1266,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Encode the message to be written */ if((buf_size = H5O_msg_raw_size(f, type_id, TRUE, mesg)) == 0) HGOTO_ERROR(H5E_SOHM, H5E_BADSIZE, FAIL, "can't find message size") - if(NULL == (encoding_buf = H5MM_calloc(buf_size))) + if(NULL == (encoding_buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "can't allocate buffer for encoding") if(H5O_msg_encode(f, type_id, TRUE, (unsigned char *)encoding_buf, mesg) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTENCODE, FAIL, "can't encode message to be shared") @@ -2609,14 +2609,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, - FILE *stream, int indent, int fwidth, - unsigned table_vers, size_t num_messages) +H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, + int indent, int fwidth, haddr_t table_addr) { - + H5SM_master_table_t *table = NULL; /* SOHM master table */ H5SM_list_t *list = NULL; /* SOHM index list for message type (if in list form) */ - H5SM_index_header_t header; /* A "false" header used to read the list */ - H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */ + H5SM_list_cache_ud_t lst_cache_udata; /* List user-data for metadata cache callback */ + H5SM_table_cache_ud_t tbl_cache_udata; /* Table user-data for metadata cache callback */ + H5HF_t *fh = NULL; /* Fractal heap for SOHM messages */ + unsigned index_num; /* Index of list, within master table */ unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2628,35 +2629,48 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, HDassert(indent >= 0); HDassert(fwidth >= 0); - /* Check arguments. Version must be 0, the only version implemented so far */ - if(table_vers > H5SM_LIST_VERSION) - HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "unknown shared message list version") - if(num_messages == 0 || num_messages > H5O_SHMESG_MAX_LIST_SIZE) - HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "number of indexes must be between 1 and H5O_SHMESG_MAX_NINDEXES") + /* Set up user data for callback */ + tbl_cache_udata.f = f; + + /* Look up the master SOHM table */ + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) + HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") - /* Create a temporary header using the arguments. The cache needs this to load the list. */ - HDmemset(&header, 0, sizeof(H5SM_index_header_t)); - header.list_max = header.num_messages = num_messages; - header.index_type = H5SM_LIST; - header.index_addr = list_addr; + /* Determine which index the list is part of */ + index_num = table->num_indexes; + for(x = 0; x < table->num_indexes; x++) { + if(H5F_addr_eq(table->indexes[x].index_addr, list_addr)) { + index_num = x; + break; + } /* end if */ + } /* end for */ + if(x == table->num_indexes) + HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "list address doesn't match address for any indices in table") /* Set up user data for metadata cache callback */ - cache_udata.f = f; - cache_udata.header = &header; + lst_cache_udata.f = f; + lst_cache_udata.header = &(table->indexes[index_num]); /* Get the list from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") + /* Open the heap, if one exists */ + if(H5F_addr_defined(table->indexes[index_num].heap_addr)) + if(NULL == (fh = H5HF_open(f, dxpl_id, table->indexes[index_num].heap_addr))) + HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open SOHM heap") + HDfprintf(stream, "%*sShared Message List Index...\n", indent, ""); - for(x = 0; x < num_messages; ++x) { + for(x = 0; x < table->indexes[index_num].num_messages; ++x) { HDfprintf(stream, "%*sShared Object Header Message %d...\n", indent, "", x); HDfprintf(stream, "%*s%-*s %08lu\n", indent + 3, "", fwidth, "Hash value:", (unsigned long)list->messages[x].hash); if(list->messages[x].location == H5SM_IN_HEAP) { + HDassert(fh); + HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth, "Location:", "in heap"); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s 0x%Zx\n", indent + 3, "", fwidth, "Heap ID:", list->messages[x].u.heap_loc.fheap_id); HDfprintf(stream, "%*s%-*s %u\n", indent + 3, "", fwidth, "Reference count:", list->messages[x].u.heap_loc.ref_count); @@ -2677,8 +2691,12 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, } /* end for */ done: + if(fh && H5HF_close(fh, dxpl_id) < 0) + HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "unable to close SOHM heap") if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, list, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5SM_list_debug() */ diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 48a87eb..e533ae8 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -48,8 +48,8 @@ static void *H5SM__bt2_crt_context(void *udata); static herr_t H5SM__bt2_dst_context(void *ctx); static herr_t H5SM__bt2_store(void *native, const void *udata); -static herr_t H5SM__bt2_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5SM__bt2_debug(FILE *stream, int indent, int fwidth, + const void *record, const void *_udata); static void *H5SM__bt2_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr); @@ -195,8 +195,8 @@ H5SM__bt2_store(void *native, const void *udata) *------------------------------------------------------------------------- */ static herr_t -H5SM__bt2_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *record, const void H5_ATTR_UNUSED *_udata) +H5SM__bt2_debug(FILE *stream, int indent, int fwidth, + const void *record, const void H5_ATTR_UNUSED *_udata) { const H5SM_sohm_t *sohm = (const H5SM_sohm_t *)record; diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index d072434..57afacf 100644 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -74,7 +74,7 @@ H5_DLL herr_t H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, FILE *stream, int indent, int fwidth, unsigned table_vers, unsigned num_indexes); H5_DLL herr_t H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, - FILE *stream, int indent, int fwidth, unsigned list_vers, size_t num_messages); + FILE *stream, int indent, int fwidth, haddr_t table_addr); #endif /*_H5SMprivate_H*/ @@ -1306,8 +1306,8 @@ H5VM_chunk_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, * * Return: Chunk index on success (can't fail) * - * Programmer: Quincey Koziol - * Monday, April 21, 2003 + * Programmer: Vailin Choi + * Monday, February 9, 2015 * *------------------------------------------------------------------------- */ diff --git a/src/H5system.c b/src/H5system.c index 07c2a86..adee41f 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -788,9 +788,6 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz) #ifdef H5_HAVE_WINSOCK2_H #pragma comment(lib, "advapi32.lib") #endif -#ifdef H5_HAVE_WINSOCK2_H -#pragma comment(lib, "advapi32.lib") -#endif #define WloginBuffer_count 256 static char Wlogin_buffer[WloginBuffer_count]; diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index ecfa655..aac14db 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -382,11 +382,11 @@ main(int argc, char *argv[]) /* Build array of chunk dimensions */ ndims = (unsigned)extra; - dim[0] = extra2; + dim[0] = (uint32_t)extra2; if(ndims > 1) - dim[1] = extra3; + dim[1] = (uint32_t)extra3; if(ndims > 2) - dim[2] = extra4; + dim[2] = (uint32_t)extra4; /* Check for dimension error */ if(ndims > 3) { @@ -554,14 +554,14 @@ main(int argc, char *argv[]) */ /* Check for enough valid parameters */ - if(extra2 == 0) { - HDfprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n"); + if(extra == 0) { + HDfprintf(stderr, "ERROR: Need shared message header address in order to shared message list\n"); HDfprintf(stderr, "Shared message list usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <shared message list address> <list format version> <number of mesages in list>\n"); + HDfprintf(stderr, "\th5debug <filename> <shared message list address> <shared message header address>\n"); HDexit(4); } /* end if */ - status = H5SM_list_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, (unsigned) extra, (size_t) extra2); + status = H5SM_list_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, (haddr_t)extra); } else if(!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* |