summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-09-14 10:28:53 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-09-14 10:28:53 (GMT)
commitab8cc1c511492133cfb80f2618d703672d655eb1 (patch)
tree59f7c27ccef5f0c1a863fe5fd2fef3679222a6d0
parentae7d45d612db414c8f9f8d21d732974ab33bb651 (diff)
downloadhdf5-ab8cc1c511492133cfb80f2618d703672d655eb1.zip
hdf5-ab8cc1c511492133cfb80f2618d703672d655eb1.tar.gz
hdf5-ab8cc1c511492133cfb80f2618d703672d655eb1.tar.bz2
[svn-r19380] Description:
Minor code cleanups. Tested on: Mac OS X/32 10.6.4 (amazon) w/debug & production (h5committest not required on this branch)
-rw-r--r--MANIFEST1
-rw-r--r--src/H5B2.c2
-rw-r--r--src/H5B2dbg.c11
-rw-r--r--src/H5Dbtree2.c472
-rw-r--r--src/H5Dchunk.c52
-rw-r--r--src/H5Dearray.c215
-rw-r--r--src/H5Dint.c6
-rw-r--r--src/H5Dlayout.c35
-rw-r--r--src/H5Dpkg.h2
-rw-r--r--src/H5Olayout.c47
-rw-r--r--src/H5Oprivate.h35
-rw-r--r--src/H5Ostorage.c29
-rw-r--r--test/dsets.c128
-rw-r--r--tools/misc/h5debug.c10
14 files changed, 429 insertions, 616 deletions
diff --git a/MANIFEST b/MANIFEST
index 01b728b..1f16189 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -471,6 +471,7 @@
./src/H5CSprivate.h
./src/H5D.c
./src/H5Dbtree.c
+./src/H5Dbtree2.c
./src/H5Dchunk.c
./src/H5Dcompact.c
./src/H5Dcontig.c
diff --git a/src/H5B2.c b/src/H5B2.c
index d31f0cf..9c3fd7b 100644
--- a/src/H5B2.c
+++ b/src/H5B2.c
@@ -97,7 +97,7 @@ const H5B2_class_t *const H5B2_client_class_g[] = {
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 */
+ H5D_BT2_FILT, /* 11 - H5B2_CDSET_FILT_ID */
};
diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c
index 1199edf..a7f6819 100644
--- a/src/H5B2dbg.c
+++ b/src/H5B2dbg.c
@@ -84,10 +84,7 @@
* koziol@ncsa.uiuc.edu
* Feb 2 2005
*
- * Modifications:
- * Vailin Choi; August 2010
- * Created debugging context so that the header can be loaded correctly.
- *--------------------------------------------------------------------------
+ *-------------------------------------------------------------------------
*/
herr_t
H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth,
@@ -202,9 +199,6 @@ done:
* koziol@ncsa.uiuc.edu
* Feb 4 2005
*
- * Modifications:
- * Vailin Choi; August 2010
- * Created debugging context so that the header can be loaded correctly.
*-------------------------------------------------------------------------
*/
herr_t
@@ -337,9 +331,6 @@ done:
* koziol@ncsa.uiuc.edu
* Feb 7 2005
*
- * Modifications:
- * Vailin Choi; August 2010
- * Created debugging context so that the header can be loaded correctly.
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c
index 1b014e5..0cdf465 100644
--- a/src/H5Dbtree2.c
+++ b/src/H5Dbtree2.c
@@ -37,10 +37,12 @@
#include "H5MFprivate.h" /* File space management */
#include "H5Vprivate.h" /* Vector and array functions */
+
/****************/
/* Local Macros */
/****************/
+
/******************/
/* Local Typedefs */
/******************/
@@ -94,16 +96,18 @@ typedef struct H5D_bt2_find_ud_t {
unsigned ndims; /* Number of dimensions for the chunked dataset */
} H5D_bt2_find_ud_t;
+
/********************/
/* Local Prototypes */
/********************/
-/* v2 B-tree class for indexing non-filtered chunked datasets */
+/* Shared v2 B-tree methods for indexing filtered and non-filtered chunked datasets */
static void *H5D_bt2_crt_context(void *udata);
static herr_t H5D_bt2_dst_context(void *ctx);
static void *H5D_bt2_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr);
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_store(void *native, const void *udata);
static herr_t H5D_bt2_compare(const void *rec1, const void *rec2);
static herr_t H5D_bt2_encode(uint8_t *raw, const void *native, void *ctx);
@@ -139,7 +143,7 @@ static herr_t H5D_bt2_filt_remove_cb(const void *nrecord, void *_udata);
/* Callback for H5B2_modify() which is called in H5D_bt2_idx_insert() */
static herr_t H5D_bt2_mod_filt_cb(void *_record, void *_op_data, hbool_t *changed);
-/* Chunked dataset I/O ops for v2 B-tree indexing */
+/* Chunked layout indexing callbacks for v2 B-tree indexing */
static herr_t H5D_bt2_idx_create(const H5D_chk_idx_info_t *idx_info);
static hbool_t H5D_bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
static herr_t H5D_bt2_idx_insert(const H5D_chk_idx_info_t *idx_info,
@@ -161,6 +165,7 @@ static herr_t H5D_bt2_idx_dump(const H5O_storage_chunk_t *storage,
FILE *stream);
static herr_t H5D_bt2_idx_dest(const H5D_chk_idx_info_t *idx_info);
+
/*********************/
/* Package Variables */
/*********************/
@@ -224,11 +229,18 @@ const H5B2_class_t H5D_BT2_FILT[1] = {{ /* B-tree class information */
H5D_bt2_dst_dbg_context /* Destroy debugging context */
}};
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/* Declare a free list to manage the H5D_bt2_ctx_t struct */
H5FL_DEFINE_STATIC(H5D_bt2_ctx_t);
/* Declare a free list to manage the H5D_bt2_ctx_ud_t struct */
H5FL_DEFINE_STATIC(H5D_bt2_ctx_ud_t);
+
+
/*-------------------------------------------------------------------------
* Function: H5D_bt2_crt_context
*
@@ -335,32 +347,6 @@ H5D_bt2_store(void *record, const void *_udata)
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_store
- *
- * Purpose: Store native information into record for v2 B-tree
- * (filtered)
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Vailin Choi; June 2010
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5D_bt2_filt_store(void *record, const void *_udata)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_store)
-
- const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */
-
- *(H5D_bt2_filt_rec_t *)record = *(const H5D_bt2_filt_rec_t *)udata->rec;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_filt_store() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5D_bt2_compare
*
* Purpose: Compare two native information records, according to some key
@@ -396,43 +382,43 @@ H5D_bt2_compare(const void *_udata, const void *_rec2)
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_compare
+ * Function: H5D_bt2_encode
*
- * Purpose: Compare two native information records, according to some key
- * (filtered)
+ * Purpose: Encode native information into raw form for storing on disk
+ * (non-filtered)
*
- * Return: <0 if rec1 < rec2
- * =0 if rec1 == rec2
- * >0 if rec1 > rec2
+ * Return: Success: non-negative
+ * Failure: negative
*
* Programmer: Vailin Choi; June 2010
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_filt_compare(const void *_udata, const void *_rec2)
+H5D_bt2_encode(uint8_t *raw, const void *_record, void *_ctx)
{
- const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */
-
- const H5D_bt2_filt_rec_t *rec1 = (const H5D_bt2_filt_rec_t *)udata->rec; /* The native record */
- const H5D_bt2_filt_rec_t *rec2 = (const H5D_bt2_filt_rec_t *)_rec2; /* The native record */
- herr_t ret_value; /* Return value */
+ H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
+ const H5D_bt2_rec_t *record = (const H5D_bt2_rec_t *)_record; /* The native record */
+ unsigned i; /* Local index varible */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_compare)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_encode)
- HDassert(rec1);
- HDassert(rec2);
+ /* Sanity check */
+ HDassert(ctx);
- /* Compare the offsets but ignore the other fields */
- ret_value = H5V_vector_cmp_u(udata->ndims, rec1->offset, rec2->offset);
+ /* Encode the record's fields */
+ H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->addr);
+ for(i = 0; i < ctx->ndims; i++)
+ UINT64ENCODE(raw, record->offset[i]);
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_filt_compare() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5D_bt2_encode() */
+
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_encode
+ * Function: H5D_bt2_decode
*
- * Purpose: Encode native information into raw form for storing on disk
+ * Purpose: Decode raw disk form of record into native form
* (non-filtered)
*
* Return: Success: non-negative
@@ -443,30 +429,64 @@ H5D_bt2_filt_compare(const void *_udata, const void *_rec2)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_encode(uint8_t *raw, const void *_record, void *_ctx)
+H5D_bt2_decode(const uint8_t *raw, void *_record, void *_ctx)
{
- H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
- const H5D_bt2_rec_t *record = (const H5D_bt2_rec_t *)_record; /* The native record */
- unsigned i; /* Local index varible */
+ H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
+ H5D_bt2_rec_t *record = (H5D_bt2_rec_t *)_record; /* The native record */
+ unsigned i; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_encode)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_decode)
/* Sanity check */
HDassert(ctx);
- /* Encode the record's fields */
- H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->addr);
+ /* Decode the record's fields */
+ H5F_addr_decode_len(ctx->sizeof_addr, &raw, &record->addr);
for(i = 0; i < ctx->ndims; i++)
- UINT64ENCODE(raw, record->offset[i]);
+ UINT64DECODE(raw, record->offset[i]);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_encode() */
+} /* H5D_bt2_decode() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_encode
+ * Function: H5D_bt2_debug
*
- * Purpose: Encode native information into raw form for storing on disk
+ * Purpose: Debug native form of record (non-filtered)
+ *
+ * Return: Success: non-negative
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi; June 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_bt2_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
+ int indent, int fwidth, const void *_record, const void *_u_ctx)
+{
+ const H5D_bt2_rec_t *record = (const H5D_bt2_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 */
+ unsigned u; /* Local index variable */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_debug)
+
+ HDassert(record);
+
+ HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Chunk address:", (unsigned)record->addr);
+ HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:");
+ for(u = 0; u < u_ctx->ndims; u++)
+ HDfprintf(stream, "%s%Hd", u?", ":"", record->offset[u]);
+ HDfputs("}\n", stream);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5D_bt2_debug() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_bt2_filt_store
+ *
+ * Purpose: Store native information into record for v2 B-tree
* (filtered)
*
* Return: Success: non-negative
@@ -477,34 +497,58 @@ H5D_bt2_encode(uint8_t *raw, const void *_record, void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx)
+H5D_bt2_filt_store(void *record, const void *_udata)
{
- H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
- const H5D_bt2_filt_rec_t *record = (const H5D_bt2_filt_rec_t *)_record; /* The native record */
- unsigned i; /* Local index variable */
-
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_encode)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_store)
- /* Sanity check */
- HDassert(ctx);
+ const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */
- /* Encode the record's fields */
- H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->addr);
- UINT64ENCODE_VAR(raw, record->nbytes, ctx->chunk_size_len);
- UINT32ENCODE(raw, record->filter_mask);
- for(i = 0; i < ctx->ndims; i++)
- UINT64ENCODE(raw, record->offset[i]);
+ *(H5D_bt2_filt_rec_t *)record = *(const H5D_bt2_filt_rec_t *)udata->rec;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_filt_encode() */
+} /* H5D_bt2_filt_store() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_bt2_filt_compare
+ *
+ * Purpose: Compare two native information records, according to some key
+ * (filtered)
+ *
+ * Return: <0 if rec1 < rec2
+ * =0 if rec1 == rec2
+ * >0 if rec1 > rec2
+ *
+ * Programmer: Vailin Choi; June 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_bt2_filt_compare(const void *_udata, const void *_rec2)
+{
+ const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */
+
+ const H5D_bt2_filt_rec_t *rec1 = (const H5D_bt2_filt_rec_t *)udata->rec; /* The native record */
+ const H5D_bt2_filt_rec_t *rec2 = (const H5D_bt2_filt_rec_t *)_rec2; /* The native record */
+ herr_t ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_compare)
+
+ HDassert(rec1);
+ HDassert(rec2);
+
+ /* Compare the offsets but ignore the other fields */
+ ret_value = H5V_vector_cmp_u(udata->ndims, rec1->offset, rec2->offset);
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5D_bt2_filt_compare() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_decode
+ * Function: H5D_bt2_filt_encode
*
- * Purpose: Decode raw disk form of record into native form
- * (non-filtered)
+ * Purpose: Encode native information into raw form for storing on disk
+ * (filtered)
*
* Return: Success: non-negative
* Failure: negative
@@ -514,24 +558,26 @@ H5D_bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_decode(const uint8_t *raw, void *_record, void *_ctx)
+H5D_bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx)
{
- H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
- H5D_bt2_rec_t *record = (H5D_bt2_rec_t *)_record; /* The native record */
- unsigned i; /* Local index variable */
+ H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
+ const H5D_bt2_filt_rec_t *record = (const H5D_bt2_filt_rec_t *)_record; /* The native record */
+ unsigned i; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_decode)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_encode)
/* Sanity check */
HDassert(ctx);
- /* Decode the record's fields */
- H5F_addr_decode_len(ctx->sizeof_addr, &raw, &record->addr);
+ /* Encode the record's fields */
+ H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->addr);
+ UINT64ENCODE_VAR(raw, record->nbytes, ctx->chunk_size_len);
+ UINT32ENCODE(raw, record->filter_mask);
for(i = 0; i < ctx->ndims; i++)
- UINT64DECODE(raw, record->offset[i]);
+ UINT64ENCODE(raw, record->offset[i]);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_decode() */
+} /* H5D_bt2_filt_encode() */
/*-------------------------------------------------------------------------
@@ -571,40 +617,6 @@ H5D_bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx)
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_debug
- *
- * Purpose: Debug native form of record (non-filtered)
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Vailin Choi; June 2010
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5D_bt2_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
- int indent, int fwidth, const void *_record, const void *_u_ctx)
-{
- const H5D_bt2_rec_t *record = (const H5D_bt2_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 */
- unsigned u; /* Local index variable */
-
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_debug)
-
- HDassert(record);
-
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Chunk address:", (unsigned)record->addr);
- HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:");
- for(u = 0; u < u_ctx->ndims; u++)
- HDfprintf(stream, "%s%Hd", u?", ":"", record->offset[u]);
- HDfputs("}\n", stream);
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_debug() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5D_bt2_filt_debug
*
* Purpose: Debug native form of record (filterd)
@@ -640,6 +652,7 @@ H5D_bt2_filt_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5D_bt2_filt_debug() */
+
/*-------------------------------------------------------------------------
* Function: H5D_bt2_crt_dbg_context
*
@@ -792,7 +805,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_bt2_idx_open() */
-
/*-------------------------------------------------------------------------
* Function: H5D_bt2_idx_create
@@ -825,8 +837,10 @@ H5D_bt2_idx_create(const H5D_chk_idx_info_t *idx_info)
bt2_cparam.rrec_size = H5F_SIZEOF_ADDR(idx_info->f) /* Address of chunk */
+ (idx_info->layout->ndims - 1) * 8; /* # of dimensions x 64-bit chunk offsets */
+ /* General parameters */
if(idx_info->pline->nused > 0) {
unsigned chunk_size_len; /* Size of encoded chunk size */
+
/*
* Compute the size required for encoding the size of a chunk,
* allowing for an extra byte, in case the filter makes the chunk larger.
@@ -837,7 +851,8 @@ H5D_bt2_idx_create(const H5D_chk_idx_info_t *idx_info)
bt2_cparam.rrec_size += chunk_size_len + 4; /* Size of encoded chunk size & filter mask */
bt2_cparam.cls = H5D_BT2_FILT;
- } else
+ } /* end if */
+ else
bt2_cparam.cls = H5D_BT2;
bt2_cparam.node_size = idx_info->layout->u.btree2.cparam.node_size;
@@ -890,58 +905,6 @@ H5D_bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_found_cb
- *
- * Purpose: Retrieve record (non-filtered) for dataset chunk when it is found
- * in the v2 B-tree.
- * This is the callback for H5B2_find() which is called in
- * H5D_bt2_idx_get_addr() and H5D_bt2_idx_insert().
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Vailin Choi; June 2010
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5D_bt2_found_cb(const void *nrecord, void *op_data)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_found_cb)
-
- *(H5D_bt2_rec_t *)op_data = *(const H5D_bt2_rec_t *)nrecord;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_found_cb() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_found_cb
- *
- * Purpose: Retrieve record (filtered) for dataset chunk when it is found
- * in the v2 B-tree.
- * This is the callback for H5B2_find() which is called in
- * H5D_bt2_idx_get_addr() and H5D_bt2_idx_insert().
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Vailin Choi; June 2010
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5D_bt2_filt_found_cb(const void *nrecord, void *op_data)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_found_cb)
-
- *(H5D_bt2_filt_rec_t *)op_data = *(const H5D_bt2_filt_rec_t *)nrecord;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_filt_found_cb() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5D_bt2_mod_filt_cb
*
* Purpose: Modify record (filtered) for dataset chunk when it is found
@@ -990,9 +953,9 @@ H5D_bt2_mod_filt_cb(void *_record, void *_op_data, hbool_t *changed)
static herr_t
H5D_bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
{
- H5B2_t *bt2_cdset = NULL; /* v2 B-tree handle for indexing chunks */
- H5D_bt2_find_ud_t bt2_udata;
- unsigned u; /* local index variable */
+ H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */
+ H5D_bt2_find_ud_t bt2_udata; /* User data for v2 B-tree calls */
+ unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_insert)
@@ -1005,20 +968,22 @@ H5D_bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
HDassert(H5F_addr_defined(idx_info->storage->idx_addr));
HDassert(udata);
+ /* Check if the v2 B-tree is open yet */
if(NULL == idx_info->storage->u.btree2.bt2) {
/* Open existing v2 B-tree */
if(H5D_bt2_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
} /* end if */
- bt2_cdset = idx_info->storage->u.btree2.bt2;
+ /* Set convenience pointer to v2 B-tree structure */
+ bt2 = idx_info->storage->u.btree2.bt2;
/* Check for filters on chunks */
if(idx_info->pline->nused > 0) { /* filtered chunk */
- unsigned allow_chunk_size_len; /* Allowed size of encoded chunk size */
- unsigned new_chunk_size_len; /* Size of encoded chunk size */
H5D_bt2_filt_rec_t rec; /* Record for searching object */
H5D_bt2_filt_rec_t found_rec; /* Record found from searching for object */
+ unsigned allow_chunk_size_len; /* Allowed size of encoded chunk size */
+ unsigned new_chunk_size_len; /* Size of encoded chunk size */
/*
* Compute the size required for encoding the size of a chunk,
@@ -1052,7 +1017,7 @@ H5D_bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
bt2_udata.ndims = idx_info->layout->ndims - 1;
/* Try to find the chunked record */
- if(H5B2_find(bt2_cdset, idx_info->dxpl_id, &bt2_udata, H5D_bt2_filt_found_cb, &found_rec) < 0)
+ if(H5B2_find(bt2, idx_info->dxpl_id, &bt2_udata, H5D_bt2_filt_found_cb, &found_rec) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "can't find object in v2 B-tree")
/* Check for previous chunk */
@@ -1062,40 +1027,41 @@ H5D_bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
/* Check for chunk being same size */
if(udata->nbytes != found_rec.nbytes) {
-
- H5_CHECK_OVERFLOW(found_rec.nbytes, uint32_t, hsize_t);
-
/* Free the original chunk */
+ H5_CHECK_OVERFLOW(found_rec.nbytes, uint32_t, hsize_t);
if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, found_rec.addr, (hsize_t)found_rec.nbytes) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk")
/* Allocate a new chunk */
H5_CHECK_OVERFLOW(udata->nbytes, uint32_t, hsize_t);
- rec.addr = udata->addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, (hsize_t)udata->nbytes);
-
+ udata->addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, (hsize_t)udata->nbytes);
if(!H5F_addr_defined(udata->addr))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk")
+ rec.addr = udata->addr;
/* Modify record for object in v2 B-tree */
- if(H5B2_modify(bt2_cdset, idx_info->dxpl_id, &bt2_udata, H5D_bt2_mod_filt_cb, &rec) < 0)
+ if(H5B2_modify(bt2, idx_info->dxpl_id, &bt2_udata, H5D_bt2_mod_filt_cb, &rec) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to modify record in v2 B-tree")
-
- } else
+ } /* end if */
+ else
/* Don't need to reallocate chunk, but send its address back up */
udata->addr = found_rec.addr;
- } else { /* Not found */
+ } /* end if */
+ else { /* Not found */
H5_CHECK_OVERFLOW(udata->nbytes, uint32_t, hsize_t);
/* Allocate a new chunk */
- rec.addr = udata->addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, (hsize_t)udata->nbytes);
+ udata->addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, (hsize_t)udata->nbytes);
if(!H5F_addr_defined(udata->addr))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk")
+ rec.addr = udata->addr;
/* Insert record for object in v2 B-tree */
- if(H5B2_insert(bt2_cdset, idx_info->dxpl_id, &bt2_udata) < 0)
+ if(H5B2_insert(bt2, idx_info->dxpl_id, &bt2_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "couldn't insert record in v2 B-tree")
- }
- } else { /* non-filtered chunk */
+ } /* end else */
+ } /* end if */
+ else { /* non-filtered chunk */
H5D_bt2_rec_t rec;
/* The record should not be there */
@@ -1111,13 +1077,13 @@ H5D_bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
/* Allocate storage for the new chunk */
H5_CHECK_OVERFLOW(udata->nbytes, uint32_t, hsize_t);
- rec.addr = udata->addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, (hsize_t)udata->nbytes);
-
+ udata->addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, (hsize_t)udata->nbytes);
if(!H5F_addr_defined(udata->addr))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk")
+ rec.addr = udata->addr;
/* Insert record for object in v2 B-tree */
- if(H5B2_insert(bt2_cdset, idx_info->dxpl_id, &bt2_udata) < 0)
+ if(H5B2_insert(bt2, idx_info->dxpl_id, &bt2_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "couldn't insert record in v2 B-tree")
} /* end else */
HDassert(H5F_addr_defined(udata->addr));
@@ -1128,6 +1094,58 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5D_bt2_found_cb
+ *
+ * Purpose: Retrieve record (non-filtered) for dataset chunk when it is found
+ * in the v2 B-tree.
+ * This is the callback for H5B2_find() which is called in
+ * H5D_bt2_idx_get_addr() and H5D_bt2_idx_insert().
+ *
+ * Return: Success: non-negative
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi; June 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_bt2_found_cb(const void *nrecord, void *op_data)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_found_cb)
+
+ *(H5D_bt2_rec_t *)op_data = *(const H5D_bt2_rec_t *)nrecord;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5D_bt2_found_cb() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_bt2_filt_found_cb
+ *
+ * Purpose: Retrieve record (filtered) for dataset chunk when it is found
+ * in the v2 B-tree.
+ * This is the callback for H5B2_find() which is called in
+ * H5D_bt2_idx_get_addr() and H5D_bt2_idx_insert().
+ *
+ * Return: Success: non-negative
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi; June 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_bt2_filt_found_cb(const void *nrecord, void *op_data)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_found_cb)
+
+ *(H5D_bt2_filt_rec_t *)op_data = *(const H5D_bt2_filt_rec_t *)nrecord;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5D_bt2_filt_found_cb() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5D_bt2_idx_get_addr
*
* Purpose: Get the file address of a chunk if file space has been
@@ -1143,9 +1161,9 @@ done:
static herr_t
H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
{
- H5B2_t *bt2_cdset = NULL; /* v2 B-tree handle for indexing chunks */
+ H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */
+ H5D_bt2_find_ud_t bt2_udata; /* User data for v2 B-tree calls */
unsigned u; /* Local index variable */
- H5D_bt2_find_ud_t bt2_udata;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_get_addr)
@@ -1159,13 +1177,15 @@ H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
HDassert(H5F_addr_defined(idx_info->storage->idx_addr));
HDassert(udata);
+ /* Check if the v2 B-tree is open yet */
if(NULL == idx_info->storage->u.btree2.bt2) {
/* Open existing v2 B-tree */
if(H5D_bt2_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
} /* end if */
- bt2_cdset = idx_info->storage->u.btree2.bt2;
+ /* Set convenience pointer to v2 B-tree structure */
+ bt2 = idx_info->storage->u.btree2.bt2;
/* Check for filters on chunks */
if(idx_info->pline->nused > 0) { /* filtered chunk */
@@ -1185,14 +1205,15 @@ H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
bt2_udata.ndims = idx_info->layout->ndims - 1;
/* Go get chunk information from v2 B-tree */
- if(H5B2_find(bt2_cdset, idx_info->dxpl_id, &bt2_udata, H5D_bt2_filt_found_cb, &found_rec) < 0)
+ if(H5B2_find(bt2, idx_info->dxpl_id, &bt2_udata, H5D_bt2_filt_found_cb, &found_rec) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in v2 B-tree")
/* Set info for the chunk */
udata->addr = found_rec.addr;
udata->nbytes = found_rec.nbytes;
udata->filter_mask = found_rec.filter_mask;
- } else { /* non-filtered chunk */
+ } /* end if */
+ else { /* non-filtered chunk */
H5D_bt2_rec_t search_rec; /* Record for searching object */
H5D_bt2_rec_t found_rec; /* Record found from searching for object */
@@ -1208,7 +1229,7 @@ H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
bt2_udata.ndims = idx_info->layout->ndims - 1;
/* Go get chunk information from v2 B-tree */
- if(H5B2_find(bt2_cdset, idx_info->dxpl_id, &bt2_udata, H5D_bt2_found_cb, &found_rec) < 0)
+ if(H5B2_find(bt2, idx_info->dxpl_id, &bt2_udata, H5D_bt2_found_cb, &found_rec) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in v2 B-tree")
udata->addr = found_rec.addr;
@@ -1216,7 +1237,7 @@ H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
/* Update the other (constant) information for the chunk */
udata->nbytes = idx_info->layout->size;
udata->filter_mask = 0;
- }
+ } /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1239,13 +1260,12 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static int
H5D_bt2_idx_iterate_cb(const void *_record, void *_udata)
{
- H5D_bt2_it_ud_t *udata = (H5D_bt2_it_ud_t *)_udata; /* User data */
- unsigned u; /* Local index variable */
- int ret_value; /* Return value */
+ H5D_bt2_it_ud_t *udata = (H5D_bt2_it_ud_t *)_udata; /* User data */
+ unsigned u; /* Local index variable */
+ int ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOERR(H5D_bt2_idx_iterate_cb, -)
@@ -1258,7 +1278,8 @@ H5D_bt2_idx_iterate_cb(const void *_record, void *_udata)
udata->chunk_rec.filter_mask = filt_rec->filter_mask;
for(u = 0; u < (udata->common.layout->ndims - 1); u++)
udata->chunk_rec.offset[u] = filt_rec->offset[u];
- } else { /* non-filtered record */
+ } /* end if */
+ else { /* non-filtered record */
const H5D_bt2_rec_t *rec = (const H5D_bt2_rec_t *)_record;
udata->chunk_rec.chunk_addr = rec->addr;
@@ -1266,7 +1287,7 @@ H5D_bt2_idx_iterate_cb(const void *_record, void *_udata)
udata->chunk_rec.filter_mask = 0;
for(u = 0; u < (udata->common.layout->ndims - 1); u++)
udata->chunk_rec.offset[u] = rec->offset[u];
- }
+ } /* end else */
/* Make "generic chunk" callback */
if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0)
@@ -1275,6 +1296,7 @@ H5D_bt2_idx_iterate_cb(const void *_record, void *_udata)
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_bt2_idx_iterate_cb() */
+
/*-------------------------------------------------------------------------
* Function: H5D_bt2_idx_iterate
*
@@ -1291,8 +1313,8 @@ static int
H5D_bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_cb_func_t chunk_cb, void *chunk_udata)
{
- H5D_bt2_it_ud_t udata; /* User data for B-tree iterator callback */
- H5B2_t *bt2_cdset = NULL; /* v2 B-tree handle for indexing chunks */
+ H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */
+ H5D_bt2_it_ud_t udata; /* User data for B-tree iterator callback */
int ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_iterate)
@@ -1313,19 +1335,22 @@ H5D_bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info,
udata.filtered = idx_info->pline->nused > 0;
HDmemset(&udata.chunk_rec, 0, sizeof(udata.chunk_rec));
+ /* Check if the v2 B-tree is open yet */
if(NULL == idx_info->storage->u.btree2.bt2) {
/* Open existing v2 B-tree */
if(H5D_bt2_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
} /* end if */
- bt2_cdset = idx_info->storage->u.btree2.bt2;
+ /* Set convenience pointer to v2 B-tree structure */
+ bt2 = idx_info->storage->u.btree2.bt2;
+ /* Prepare user data for iterate callback */
udata.cb = chunk_cb;
udata.udata = chunk_udata;
/* Iterate over the records in the v2 B-tree */
- if((ret_value = H5B2_iterate(bt2_cdset, idx_info->dxpl_id, H5D_bt2_idx_iterate_cb, &udata)) < 0)
+ if((ret_value = H5B2_iterate(bt2, idx_info->dxpl_id, H5D_bt2_idx_iterate_cb, &udata)) < 0)
HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over v2 B-tree for dataset chunks");
done:
@@ -1414,9 +1439,9 @@ done:
static herr_t
H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata)
{
+ H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */
H5D_bt2_remove_ud_t remove_udata; /* User data for removal callback */
- H5B2_t *bt2_cdset = NULL; /* v2 B-tree handle for indexing chunks */
- H5D_bt2_find_ud_t bt2_udata;
+ H5D_bt2_find_ud_t bt2_udata; /* User data for v2 B-tree find call */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1430,13 +1455,15 @@ H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *ud
HDassert(H5F_addr_defined(idx_info->storage->idx_addr));
HDassert(udata);
+ /* Check if the v2 B-tree is open yet */
if(NULL == idx_info->storage->u.btree2.bt2) {
/* Open existing v2 B-tree */
if(H5D_bt2_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
} /* end if */
- bt2_cdset = idx_info->storage->u.btree2.bt2;
+ /* Set convenience pointer to v2 B-tree structure */
+ bt2 = idx_info->storage->u.btree2.bt2;
/* Initialize user data for removal callback */
remove_udata.f = idx_info->f;
@@ -1454,9 +1481,10 @@ H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *ud
bt2_udata.rec = &search_rec;
bt2_udata.ndims = idx_info->layout->ndims - 1;
- if(H5B2_remove(bt2_cdset, idx_info->dxpl_id, &bt2_udata, H5D_bt2_filt_remove_cb, &remove_udata) < 0)
+ if(H5B2_remove(bt2, idx_info->dxpl_id, &bt2_udata, H5D_bt2_filt_remove_cb, &remove_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree")
- } else { /* non-filtered chunk */
+ } /* end if */
+ else { /* non-filtered chunk */
H5D_bt2_rec_t search_rec; /* Record for searching for object */
remove_udata.unfilt_size = idx_info->layout->size;
@@ -1468,7 +1496,7 @@ H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *ud
bt2_udata.rec = &search_rec;
bt2_udata.ndims = idx_info->layout->ndims - 1;
- if(H5B2_remove(bt2_cdset, idx_info->dxpl_id, &bt2_udata, H5D_bt2_remove_cb, &remove_udata) < 0)
+ if(H5B2_remove(bt2, idx_info->dxpl_id, &bt2_udata, H5D_bt2_remove_cb, &remove_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree")
} /* end else */
@@ -1509,7 +1537,6 @@ H5D_bt2_idx_delete(const H5D_chk_idx_info_t *idx_info)
/* Check if the index data structure has been allocated */
if(H5F_addr_defined(idx_info->storage->idx_addr)) {
-
/* Set up user data for creating context */
u_ctx.f = idx_info->f;
u_ctx.ndims = idx_info->layout->ndims - 1;
@@ -1701,7 +1728,6 @@ H5D_bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
if(reset_addr)
storage->idx_addr = HADDR_UNDEF;
storage->u.btree2.bt2 = NULL;
-
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D_bt2_idx_reset() */
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index e70a7b0..d63497e 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -464,10 +464,6 @@ done:
* Programmer: Robb Matzke
* Monday, May 18, 1998
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -553,10 +549,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, January 15, 2009
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
hbool_t
@@ -2056,10 +2048,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, January 15, 2009
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2219,10 +2207,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, May 22, 2008
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2281,10 +2265,6 @@ done:
* Programmer: Albert Cheng
* June 27, 1998
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2380,10 +2360,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3315,10 +3291,6 @@ H5D_chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
* Programmer: Quincey Koziol
* Tuesday, May 20, 2008
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3387,10 +3359,6 @@ done:
* Programmer: Albert Cheng
* June 26, 1998
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -4684,10 +4652,6 @@ done:
* Programmer: Kent Yang
* November 15, 2005
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -4746,10 +4710,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, March 20, 2003
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5398,10 +5358,6 @@ done:
* Programmer: Vailin Choi
* June 8, 2007
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5501,10 +5457,6 @@ H5D_chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
* Programmer: Robb Matzke
* Wednesday, April 28, 1999
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5567,10 +5519,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2-btree indexing
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index 7a0277c..bcdedc5 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -167,11 +167,6 @@ const H5D_chunk_ops_t H5D_COPS_EARRAY[1] = {{
/* Library Private Variables */
/*****************************/
-
-/*******************/
-/* Local Variables */
-/*******************/
-
/* Extensible array class callbacks for dataset chunks w/o filters */
const H5EA_class_t H5EA_CLS_CHUNK[1]={{
H5EA_CLS_CHUNK_ID, /* Type of extensible array */
@@ -202,6 +197,11 @@ const H5EA_class_t H5EA_CLS_FILT_CHUNK[1]={{
H5D_earray_dst_dbg_context /* Destroy debugging context */
}};
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/* Declare a free list to manage the H5D_earray_ctx_t struct */
/* Declare a free list to manage the H5D_earray_ctx_ud_t struct */
H5FL_DEFINE_STATIC(H5D_earray_ctx_t);
@@ -441,108 +441,6 @@ H5D_earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx,
/*-------------------------------------------------------------------------
- * Function: H5D_earray_crt_dbg_context
- *
- * Purpose: Create context for debugging callback
- * (get the layout message in the specified object header)
- *
- * Return: Success: non-NULL
- * Failure: NULL
- *
- * Programmer: Vailin Choi; July 2010
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5D_earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr)
-{
- H5D_earray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */
- H5O_loc_t obj_loc; /* Pointer to an object's location */
- hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */
- H5O_layout_t layout; /* Layout message */
- void *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT(H5D_earray_crt_dbg_context)
-
- HDassert(f);
- HDassert(H5F_addr_defined(obj_addr));
-
- /* Allocate context for debugging callback */
- if(NULL == (dbg_ctx = H5FL_MALLOC(H5D_earray_ctx_ud_t)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't allocate extensible array client callback context")
-
- /* Set up the object header location info */
- H5O_loc_reset(&obj_loc);
- obj_loc.file = f;
- obj_loc.addr = obj_addr;
-
- /* Open the object header where the layout message resides */
- if(H5O_open(&obj_loc) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "can't open object header")
- obj_opened = TRUE;
-
- /* Read the layout message */
- if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info")
-
- /* close the object header */
- if(H5O_close(&obj_loc) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header")
-
- /* Create user data */
- dbg_ctx->f = f;
- dbg_ctx->chunk_size = layout.u.chunk.size;
-
- /* Set return value */
- ret_value = dbg_ctx;
-
-done:
- /* Cleanup on error */
- if(ret_value == NULL) {
- /* Release context structure */
- if(dbg_ctx)
- dbg_ctx = H5FL_FREE(H5D_earray_ctx_ud_t, dbg_ctx);
-
- /* Close object header */
- if(obj_opened) {
- if(H5O_close(&obj_loc) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header")
- } /* end if */
- } /* end if */
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_earray_crt_dbg_context() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5D_earray_dst_dbg_context
- *
- * Purpose: Destroy context for debugging callback
- * (free the layout message from the specified object header)
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Vailin Choi; July 2010
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5D_earray_dst_dbg_context(void *_dbg_ctx)
-{
- H5D_earray_ctx_ud_t *dbg_ctx = (H5D_earray_ctx_ud_t *)_dbg_ctx; /* Context for extensible array callback */
-
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_dst_dbg_context)
-
- HDassert(dbg_ctx);
-
- /* Release context structure */
- dbg_ctx = H5FL_FREE(H5D_earray_ctx_ud_t, dbg_ctx);
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5D_earray_dst_dbg_context() */
-
-/*-------------------------------------------------------------------------
* Function: H5D_earray_filt_fill
*
* Purpose: Fill "missing elements" in block of elements
@@ -702,6 +600,109 @@ H5D_earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx,
/*-------------------------------------------------------------------------
+ * Function: H5D_earray_crt_dbg_context
+ *
+ * Purpose: Create context for debugging callback
+ * (get the layout message in the specified object header)
+ *
+ * Return: Success: non-NULL
+ * Failure: NULL
+ *
+ * Programmer: Vailin Choi; July 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5D_earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr)
+{
+ H5D_earray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */
+ H5O_loc_t obj_loc; /* Pointer to an object's location */
+ hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */
+ H5O_layout_t layout; /* Layout message */
+ void *ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5D_earray_crt_dbg_context)
+
+ HDassert(f);
+ HDassert(H5F_addr_defined(obj_addr));
+
+ /* Allocate context for debugging callback */
+ if(NULL == (dbg_ctx = H5FL_MALLOC(H5D_earray_ctx_ud_t)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't allocate extensible array client callback context")
+
+ /* Set up the object header location info */
+ H5O_loc_reset(&obj_loc);
+ obj_loc.file = f;
+ obj_loc.addr = obj_addr;
+
+ /* Open the object header where the layout message resides */
+ if(H5O_open(&obj_loc) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "can't open object header")
+ obj_opened = TRUE;
+
+ /* Read the layout message */
+ if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info")
+
+ /* close the object header */
+ if(H5O_close(&obj_loc) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header")
+
+ /* Create user data */
+ dbg_ctx->f = f;
+ dbg_ctx->chunk_size = layout.u.chunk.size;
+
+ /* Set return value */
+ ret_value = dbg_ctx;
+
+done:
+ /* Cleanup on error */
+ if(ret_value == NULL) {
+ /* Release context structure */
+ if(dbg_ctx)
+ dbg_ctx = H5FL_FREE(H5D_earray_ctx_ud_t, dbg_ctx);
+
+ /* Close object header */
+ if(obj_opened) {
+ if(H5O_close(&obj_loc) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header")
+ } /* end if */
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D_earray_crt_dbg_context() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_earray_dst_dbg_context
+ *
+ * Purpose: Destroy context for debugging callback
+ * (free the layout message from the specified object header)
+ *
+ * Return: Success: non-negative
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi; July 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_earray_dst_dbg_context(void *_dbg_ctx)
+{
+ H5D_earray_ctx_ud_t *dbg_ctx = (H5D_earray_ctx_ud_t *)_dbg_ctx; /* Context for extensible array callback */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_dst_dbg_context)
+
+ HDassert(dbg_ctx);
+
+ /* Release context structure */
+ dbg_ctx = H5FL_FREE(H5D_earray_ctx_ud_t, dbg_ctx);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5D_earray_dst_dbg_context() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5D_earray_idx_depend
*
* Purpose: Create flush dependency between extensible array and dataset's
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 381323c..37db4e4 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -1116,7 +1116,6 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve external file list")
} /* end if */
-
/* Set the latest version of the layout, pline & fill messages, if requested */
if(H5F_USE_LATEST_FORMAT(file)) {
/* Set the latest version for the I/O pipeline message */
@@ -1130,11 +1129,12 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
/* Set the latest version for the layout message */
if(H5D_layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout")
- } else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) {
+ } /* end if */
+ else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) {
/* Use latest indexing type for layout message version >= 4 */
if(H5D_layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest indexing")
- }
+ } /* end if */
/* Check if this dataset is going into a parallel file and set space allocation time */
if(IS_H5FD_MPI(file))
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c
index bc3a77f..2c222a9 100644
--- a/src/H5Dlayout.c
+++ b/src/H5Dlayout.c
@@ -71,9 +71,6 @@
* Programmer: Quincey Koziol
* Thursday, March 20, 2008
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2 B-tree indexing.
*-------------------------------------------------------------------------
*/
herr_t
@@ -104,10 +101,6 @@ H5D_layout_set_io_ops(const H5D_t *dataset)
dataset->shared->layout.storage.u.chunk.ops = H5D_COPS_BTREE;
break;
- case H5D_CHUNK_IDX_BT2:
- dataset->shared->layout.storage.u.chunk.ops = H5D_COPS_BT2;
- break;
-
case H5D_CHUNK_IDX_FARRAY:
dataset->shared->layout.storage.u.chunk.ops = H5D_COPS_FARRAY;
break;
@@ -116,6 +109,10 @@ H5D_layout_set_io_ops(const H5D_t *dataset)
dataset->shared->layout.storage.u.chunk.ops = H5D_COPS_EARRAY;
break;
+ case H5D_CHUNK_IDX_BT2:
+ dataset->shared->layout.storage.u.chunk.ops = H5D_COPS_BT2;
+ break;
+
default:
HDassert(0 && "Unknown chunk index method!");
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unknown chunk index method")
@@ -150,10 +147,6 @@ done:
* Programmer: Raymond Lu
* August 14, 2002
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2 B-tree indexing.
- * Removed v1 B-tree support for layout message version >= 4.
*-------------------------------------------------------------------------
*/
size_t
@@ -220,11 +213,6 @@ H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include
ret_value++;
switch(layout->u.chunk.idx_type) {
- case H5D_CHUNK_IDX_BT2:
- /* v2 B-tree creation parameters */
- ret_value += H5D_BT2_CREATE_PARAM_SIZE;
- break;
-
case H5D_CHUNK_IDX_FARRAY:
/* Fixed array creation parameters */
ret_value += H5D_FARRAY_CREATE_PARAM_SIZE;
@@ -235,6 +223,11 @@ H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include
ret_value += H5D_EARRAY_CREATE_PARAM_SIZE;
break;
+ case H5D_CHUNK_IDX_BT2:
+ /* v2 B-tree creation parameters */
+ ret_value += H5D_BT2_CREATE_PARAM_SIZE;
+ break;
+
default:
HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, 0, "Invalid chunk index type")
} /* end switch */
@@ -280,7 +273,8 @@ H5D_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space)
layout->version = H5O_LAYOUT_VERSION_LATEST;
/* Set the latest indexing type for the layout message */
- ret_value = H5D_layout_set_latest_indexing(layout, space);
+ if(H5D_layout_set_latest_indexing(layout, space) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest indexing type")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -298,13 +292,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, January 15, 2009
*
- * Modifications:
- * Vailin Choi; June 2010
- * Modified to use Fixed Array indexing for extendible chunked dataset.
- * (fixed max. dim. setting but exclude H5S_UNLIMITED)
- *
- * Vailin Choi; August 2010
- * Added v2 B-tree indexing for chunked dataset >1 unlimited dimensions.
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index fa7eacf..b701908 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -33,8 +33,8 @@
/* Other private headers needed by this file */
#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Gprivate.h" /* Groups */
#include "H5B2private.h" /* v2 B-trees */
+#include "H5Gprivate.h" /* Groups */
#include "H5SLprivate.h" /* Skip lists */
#include "H5Tprivate.h" /* Datatypes */
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index bbebb8e..32a9809 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -96,11 +96,6 @@ H5FL_DEFINE(H5O_layout_t);
* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
- * Modifications:
- * Vailin Choi; Aug 2010
- * Added v2 B-tree index.
- * Removed v1 B-tree support for layout message version > 4.
- *
*-------------------------------------------------------------------------
*/
static void *
@@ -311,12 +306,6 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
mesg->storage.u.chunk.idx_type = mesg->u.chunk.idx_type;
switch(mesg->u.chunk.idx_type) {
- case H5D_CHUNK_IDX_BT2: /* v2 B-tree index */
- UINT32DECODE(p, mesg->u.chunk.u.btree2.cparam.node_size);
- mesg->u.chunk.u.btree2.cparam.split_percent = *p++;
- mesg->u.chunk.u.btree2.cparam.merge_percent = *p++;
- break;
-
case H5D_CHUNK_IDX_FARRAY:
/* Fixed array creation parameters */
mesg->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits = *p++;
@@ -343,6 +332,12 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid extensible array creation parameter")
break;
+ case H5D_CHUNK_IDX_BT2: /* v2 B-tree index */
+ UINT32DECODE(p, mesg->u.chunk.u.btree2.cparam.node_size);
+ mesg->u.chunk.u.btree2.cparam.split_percent = *p++;
+ mesg->u.chunk.u.btree2.cparam.merge_percent = *p++;
+ break;
+
default:
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "Invalid chunk index type")
} /* end switch */
@@ -401,10 +396,6 @@ done:
* Added version number 4 case to allow different kinds of indices for
* looking up chunks.
*
- * Vailin Choi; Aug 2010
- * Added v2 B-tree index.
- * Removed v1 B-tree support for layout message version > 4.
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -491,12 +482,6 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi
*p++ = (uint8_t)mesg->u.chunk.idx_type;
switch(mesg->u.chunk.idx_type) {
- case H5D_CHUNK_IDX_BT2: /* v2 B-tree index */
- UINT32ENCODE(p, mesg->u.chunk.u.btree2.cparam.node_size);
- *p++ = mesg->u.chunk.u.btree2.cparam.split_percent;
- *p++ = mesg->u.chunk.u.btree2.cparam.merge_percent;
- break;
-
case H5D_CHUNK_IDX_FARRAY:
/* Fixed array creation parameters */
*p++ = mesg->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits;
@@ -511,6 +496,12 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi
*p++ = mesg->u.chunk.u.earray.cparam.max_dblk_page_nelmts_bits;
break;
+ case H5D_CHUNK_IDX_BT2: /* v2 B-tree index */
+ UINT32ENCODE(p, mesg->u.chunk.u.btree2.cparam.node_size);
+ *p++ = mesg->u.chunk.u.btree2.cparam.split_percent;
+ *p++ = mesg->u.chunk.u.btree2.cparam.merge_percent;
+ break;
+
default:
HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "Invalid chunk index type")
} /* end switch */
@@ -899,10 +890,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
- * Modifications:
- * Vailin Choi; Aug 2010
- * Added v2 B-tree index.
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -944,11 +931,6 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg,
"Index Type:", "v1 B-tree");
break;
- case H5D_CHUNK_IDX_BT2:
- HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Index Type:", "v2 B-tree");
- break;
-
case H5D_CHUNK_IDX_FARRAY:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Index Type:", "Fixed Array");
@@ -959,6 +941,11 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg,
"Index Type:", "Extensible Array");
break;
+ case H5D_CHUNK_IDX_BT2:
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Index Type:", "v2 B-tree");
+ break;
+
default:
HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth,
"Index Type:", "Unknown", (unsigned)mesg->u.chunk.idx_type);
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index a736e7c..3d5aa86 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -396,13 +396,6 @@ typedef struct H5O_storage_chunk_btree_t {
} H5O_storage_chunk_btree_t;
/* Forward declaration of structs used below */
-struct H5B2_t; /* Defined in H5B2pkg.h */
-
-typedef struct H5O_storage_chunk_bt2_t {
- struct H5B2_t *bt2;
-} H5O_storage_chunk_bt2_t;
-
-/* Forward declaration of structs used below */
struct H5FA_t; /* Defined in H5FAprivate.h */
typedef struct H5O_storage_chunk_farray_t {
@@ -417,15 +410,22 @@ typedef struct H5O_storage_chunk_earray_t {
struct H5EA_t *ea; /* Pointer to extensible index array struct */
} H5O_storage_chunk_earray_t;
+/* Forward declaration of structs used below */
+struct H5B2_t; /* Defined in H5B2pkg.h */
+
+typedef struct H5O_storage_chunk_bt2_t {
+ struct H5B2_t *bt2;
+} H5O_storage_chunk_bt2_t;
+
typedef struct H5O_storage_chunk_t {
H5D_chunk_index_t idx_type; /* Type of chunk index */
haddr_t idx_addr; /* File address of chunk index */
const struct H5D_chunk_ops_t *ops; /* Pointer to chunked storage operations */
union {
H5O_storage_chunk_btree_t btree; /* Information for v1 B-tree index */
- H5O_storage_chunk_bt2_t btree2; /* Information for v2 B-tree index */
H5O_storage_chunk_farray_t farray; /* Information for fixed array index */
H5O_storage_chunk_earray_t earray; /* Information for extensible array index */
+ H5O_storage_chunk_bt2_t btree2; /* Information for v2 B-tree index */
} u;
} H5O_storage_chunk_t;
@@ -444,15 +444,6 @@ typedef struct H5O_storage_t {
} u;
} H5O_storage_t;
-typedef struct H5O_layout_chunk_bt2_t {
- /* Creation parameters for v2 B-tree data structure */
- struct {
- uint32_t node_size; /* Size of each node (in bytes) */
- uint8_t split_percent; /* % full to split nodes */
- uint8_t merge_percent; /* % full to merge nodes */
- } cparam;
-} H5O_layout_chunk_bt2_t;
-
typedef struct H5O_layout_chunk_farray_t {
/* Creation parameters for fixed array data structure */
struct {
@@ -476,6 +467,15 @@ typedef struct H5O_layout_chunk_earray_t {
hsize_t swizzled_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled "down" size of number of chunks in each dimension */
} H5O_layout_chunk_earray_t;
+typedef struct H5O_layout_chunk_bt2_t {
+ /* Creation parameters for v2 B-tree data structure */
+ struct {
+ uint32_t node_size; /* Size of each node (in bytes) */
+ uint8_t split_percent; /* % full to split nodes */
+ uint8_t merge_percent; /* % full to merge nodes */
+ } cparam;
+} H5O_layout_chunk_bt2_t;
+
typedef struct H5O_layout_chunk_t {
H5D_chunk_index_t idx_type; /* Type of chunk index */
uint8_t flags; /* Chunk layout flags */
@@ -710,7 +710,6 @@ typedef struct {
/* Forward declarations for prototype arguments */
struct H5P_genplist_t;
-struct H5S_t;
/* Object header routines */
H5_DLL herr_t H5O_init(void);
diff --git a/src/H5Ostorage.c b/src/H5Ostorage.c
index 2995e47..38de1c4 100644
--- a/src/H5Ostorage.c
+++ b/src/H5Ostorage.c
@@ -103,11 +103,6 @@ H5FL_DEFINE_STATIC(H5O_storage_t);
* Programmer: Quincey Koziol
* Wednesday, July 29, 2009
*
- * Modifications:
- * Vailin Choi; Aug 2010
- * Added v2 B-tree index.
- * Removed v1 B-tree support.
- *
*-------------------------------------------------------------------------
*/
static void *
@@ -178,11 +173,6 @@ H5O_storage_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
/* Chunk index type */
mesg->u.chunk.idx_type = (H5D_chunk_index_t)*p++;
switch(mesg->u.chunk.idx_type) {
- case H5D_CHUNK_IDX_BT2: /* v2 B-tree index */
- /* Set the chunk operations */
- mesg->u.chunk.ops = H5D_COPS_BT2;
- break;
-
case H5D_CHUNK_IDX_FARRAY:
/* Set the chunk operations */
mesg->u.chunk.ops = H5D_COPS_FARRAY;
@@ -193,6 +183,11 @@ H5O_storage_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
mesg->u.chunk.ops = H5D_COPS_EARRAY;
break;
+ case H5D_CHUNK_IDX_BT2: /* v2 B-tree index */
+ /* Set the chunk operations */
+ mesg->u.chunk.ops = H5D_COPS_BT2;
+ break;
+
default:
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "Invalid chunk index type")
} /* end switch */
@@ -608,10 +603,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 30, 2009
*
- * Modifications:
- * Vailin Choi; Aug 2010
- * Added v2 B-tree index.
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -643,11 +634,6 @@ H5O_storage_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg,
"Index Type:", "v1 B-tree");
break;
- case H5D_CHUNK_IDX_BT2:
- HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Index Type:", "v2 B-tree");
- break;
-
case H5D_CHUNK_IDX_FARRAY:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Index Type:", "Fixed Array");
@@ -658,6 +644,11 @@ H5O_storage_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg,
"Index Type:", "Extensible Array");
break;
+ case H5D_CHUNK_IDX_BT2:
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Index Type:", "v2 B-tree");
+ break;
+
default:
HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth,
"Index Type:", "Unknown", (unsigned)mesg->u.chunk.idx_type);
diff --git a/test/dsets.c b/test/dsets.c
index ae23e7e..15de972 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -285,8 +285,6 @@ const H5Z_class2_t H5Z_COUNT[1] = {{
* Programmer: Neil Fortner
* Wednesday, March 17, 2010
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
@@ -315,11 +313,6 @@ filter_count(unsigned int flags, size_t UNUSED cd_nelmts,
* Programmer: Robb Matzke
* Tuesday, December 9, 1997
*
- * Modifications:
- * Added test for compact dataset creation.
- * Raymond Lu
- * August 8, 2002
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -474,8 +467,6 @@ test_create(hid_t file)
* Programmer: Robb Matzke
* Wednesday, December 10, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -596,8 +587,6 @@ error:
* Programmer: Raymond Lu
* Wednesday, November 27, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -691,8 +680,6 @@ error:
* Programmer: Raymond Lu
* August 8, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1074,8 +1061,6 @@ error:
* Programmer: Raymond Lu
* Monday, May 12, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1222,8 +1207,6 @@ error:
* Programmer: Robb Matzke
* Wednesday, January 14, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1324,8 +1307,6 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
* Programmer: Quincey Koziol
* Friday, April 5, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -1352,8 +1333,6 @@ can_apply_bogus(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id)
* Programmer: Robb Matzke
* Tuesday, April 21, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
@@ -1378,8 +1357,6 @@ filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts,
* Programmer: Quincey Koziol
* Friday, April 5, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1431,8 +1408,6 @@ set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id)
* Programmer: Quincey Koziol
* Monday, April 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
@@ -1489,8 +1464,6 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts,
* Programmer: Raymond Lu
* 4 August 2010
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
@@ -1587,8 +1560,6 @@ error:
* Programmer: Raymond Lu
* Jan 14, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5Z_cb_return_t
@@ -1612,8 +1583,6 @@ filter_cb_cont(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size,
* Programmer: Raymond Lu
* Jan 14, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5Z_cb_return_t
@@ -1641,10 +1610,6 @@ filter_cb_fail(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size,
* Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
- * Modifications:
- * Moved out of main test_compression routine
- * Quincey Koziol, November 14, 2002
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1991,10 +1956,6 @@ error:
* Programmer: Nat Furrer and James Laird
* Monday, June 7, 2004
*
- * Modifications:
- * Make copy of data file since the test writes to the file.
- * Larry Knox, October 14, 2009
- *
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_FILTER_SZIP
@@ -2116,8 +2077,6 @@ error:
* Programmer: Nat Furrer and James Laird
* Thursday, June 10, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2195,14 +2154,6 @@ error:
* Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
- * Modifications:
- * Moved guts of filter testing out of main routine.
- * Tests shuffle, deflate, fletcher32 checksum filters.
- * Quincey Koziol, November 14, 2002
- *
- * Added Fletcher32 filter testing
- * Raymond Lu, Jan 22, 2002
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2738,8 +2689,6 @@ error:
* Programmer: Kent Yang
* Wednesday, Nov. 13th, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2856,8 +2805,6 @@ error:
* Programmer: Xiaowen Wu
* Wednesday, Dec. 23th, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2998,8 +2945,6 @@ error:
* Programmer: Xiaowen Wu
* Friday, Jan. 21th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -3129,8 +3074,6 @@ error:
* Programmer: Xiaowen Wu
* Wednesday, Jan. 26th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -3262,8 +3205,6 @@ error:
* Programmer: Xiaowen Wu
* Tuesday, Jan. 18th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -3410,8 +3351,6 @@ error:
* Programmer: Xiaowen Wu
* Tuesday, Jan. 18th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -3608,8 +3547,6 @@ error:
* Programmer: Xiaowen Wu
* Tuesday, Jan. 18th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -3897,8 +3834,6 @@ error:
* Programmer: Xiaowen Wu
* Thursday, Mar. 31th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -4096,8 +4031,6 @@ error:
* Programmer: Xiaowen Wu
* Monday, Feb. 14th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -4227,8 +4160,6 @@ error:
* Programmer: Xiaowen Wu
* Tuesday, March 15th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -4374,8 +4305,6 @@ error:
* Programmer: Xiaowen Wu
* Wednesday, Apr. 20th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -4506,8 +4435,6 @@ error:
* Programmer: Xiaowen Wu
* Wednesday, Apr. 20th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -4654,8 +4581,6 @@ error:
* Programmer: Xiaowen Wu
* Monday, Apr. 25th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -4786,8 +4711,6 @@ error:
* Programmer: Xiaowen Wu
* Monday, Apr. 25th, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -4937,8 +4860,6 @@ error:
* Programmer: Robb Matzke
* Tuesday, June 9, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -5003,8 +4924,6 @@ test_multiopen (hid_t file)
* Programmer: Robb Matzke
* Monday, June 7, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -6128,8 +6047,6 @@ error:
* Programmer: Pedro Vicente
* Monday, January 26, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -6257,8 +6174,6 @@ error:
* Programmer: Pedro Vicente
* Monday, March 8, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -6416,10 +6331,6 @@ error:
* Programmer: Quincey Koziol
* Tuesday, July 27, 2004
*
- * Modifications:
- * Vailin Choi; June 2010
- * Added dataset with > 1 unlimited dimensions to the test.
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -6439,18 +6350,18 @@ test_zero_dims(hid_t file)
TESTING("I/O on datasets with zero-sized dims");
/* Get the file's file access property list */
- if((fapl = H5Fget_access_plist(file)) < 0) TEST_ERROR;
+ if((fapl = H5Fget_access_plist(file)) < 0) FAIL_STACK_ERROR
/* Get library format */
- if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) TEST_ERROR;
+ if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) FAIL_STACK_ERROR
/*
* One-dimensional dataset
*/
- if((s = H5Screate_simple(1, &dsize, &dmax)) < 0) TEST_ERROR;
+ if((s = H5Screate_simple(1, &dsize, &dmax)) < 0) FAIL_STACK_ERROR
/* Try creating chunked dataset with undefined chunk dimensions */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
if(H5Pset_layout(dcpl, H5D_CHUNKED) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
@@ -6476,7 +6387,7 @@ test_zero_dims(hid_t file)
if((d = H5Dcreate2(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Get the chunk index type */
- if(H5D_layout_idx_type_test(d, &idx_type) < 0) TEST_ERROR;
+ if(H5D_layout_idx_type_test(d, &idx_type) < 0) FAIL_STACK_ERROR
/* Verify index type */
if(low == H5F_LIBVER_LATEST) {
@@ -6495,10 +6406,10 @@ test_zero_dims(hid_t file)
/*
* Two-dimensional dataset
*/
- if((s2 = H5Screate_simple(2, dsize2, dmax2)) < 0) TEST_ERROR;
+ if((s2 = H5Screate_simple(2, dsize2, dmax2)) < 0) FAIL_STACK_ERROR
/* Try creating chunked dataset with undefined chunk dimensions */
- if((dcpl2 = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+ if((dcpl2 = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
if(H5Pset_layout(dcpl2, H5D_CHUNKED) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
@@ -6526,7 +6437,7 @@ test_zero_dims(hid_t file)
if((d2 = H5Dcreate2(file, ZERODIM_DATASET2, H5T_NATIVE_INT, s2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Get the chunk index type */
- if(H5D_layout_idx_type_test(d2, &idx_type) < 0) TEST_ERROR;
+ if(H5D_layout_idx_type_test(d2, &idx_type) < 0) FAIL_STACK_ERROR
/* Verify index type */
if(low == H5F_LIBVER_LATEST) {
@@ -6572,10 +6483,6 @@ error:
* Programmer: Quincey Koziol
* Tuesday, August 25, 2004
*
- * Modifications:
- * Vailin Choi; June 2010
- * Added dataset with >1 unlimited dimensions to the test.
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -6763,10 +6670,6 @@ error:
* Programmer: Christian Chilan
* Monday, March 26, 2007
*
- * Modifications:
- * Vailin Choi; June 2010
- * Added dataset with >1 unlimited dimensions to the test.
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -7542,9 +7445,6 @@ error:
* Programmer: Raymond Lu
* 11 Feb 2009
*
- * Modifications:
- * Vailin Choi; June 2010
- * Added 2-D dataset with unlimited dimensions to the test.
*-------------------------------------------------------------------------
*/
static herr_t
@@ -8337,10 +8237,6 @@ filter_expand(unsigned int flags, size_t UNUSED cd_nelmts,
* Programmer: Quincey Koziol
* Tuesday, March 31, 2009
*
- * Modifications:
- * Vailin Choi; June 2010
- * Added 2-D dataset with unlimited dimensions to the test.
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -8748,12 +8644,6 @@ error:
*
* Programmer: Vailin Choi; 2009
*
- * Modifications:
- * Vailin Choi; June 2010
- * Made changes to verify that Fixed Array indexing is used also for
- * extendible chunked dataset.
- * (fixed max. dim. setting but exclude H5S_UNLIMITED)
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -9335,8 +9225,6 @@ error:
* Programmer: Robb Matzke
* Tuesday, December 9, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c
index ff8cdf0..44aaa7c 100644
--- a/tools/misc/h5debug.c
+++ b/tools/misc/h5debug.c
@@ -24,9 +24,9 @@
*-------------------------------------------------------------------------
*/
#define H5A_PACKAGE /*suppress error about including H5Apkg */
-#define H5D_PACKAGE /*suppress error about including H5Dpkg */
#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
+#define H5D_PACKAGE /*suppress error about including H5Dpkg */
#define H5EA_PACKAGE /*suppress error about including H5EApkg */
#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/
#define H5FA_PACKAGE /*suppress error about including H5FApkg */
@@ -72,10 +72,7 @@
* koziol@hdfgroup.org
* Sep 11 2008
*
- * Modifications:
- * Vailin Choi; August 2010
- * Added v2 B-tree indexing for chunked dataset >1 unlimited dimensions.
- *---------------------------------------------------------------------------
+ *-------------------------------------------------------------------------
*/
static const H5B2_class_t *
get_H5B2_class(const uint8_t *sig)
@@ -240,9 +237,6 @@ get_H5FA_class(const uint8_t *sig)
* matzke@llnl.gov
* Jul 18 1997
*
- * Modifications:
- * Vailin Choi; August 2010
- * Modified to handle v2 B-tree indexing for chunked dataset >1 unlimited dimensions.
*-------------------------------------------------------------------------
*/
int