diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dbtree.c | 34 | ||||
-rw-r--r-- | src/H5Dcompact.c | 36 | ||||
-rw-r--r-- | src/H5Dcontig.c | 18 | ||||
-rw-r--r-- | src/H5Ddbg.c | 2 | ||||
-rw-r--r-- | src/H5Dearray.c | 38 | ||||
-rw-r--r-- | src/H5Dfarray.c | 34 | ||||
-rw-r--r-- | src/H5Dint.c | 20 | ||||
-rw-r--r-- | src/H5Olayout.c | 118 | ||||
-rw-r--r-- | src/H5Oprivate.h | 83 | ||||
-rw-r--r-- | src/H5Pdcpl.c | 39 |
10 files changed, 230 insertions, 192 deletions
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 63d750a..c251994 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -901,13 +901,13 @@ H5D_btree_idx_create(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(!H5F_addr_defined(idx_info->layout->u.chunk.u.btree.addr)); + HDassert(!H5F_addr_defined(idx_info->layout->store.u.chunk.u.btree.addr)); /* Initialize "user" data for B-tree callbacks, etc. */ udata.mesg = idx_info->layout; /* Create the v1 B-tree for the chunk index */ - if(H5B_create(idx_info->f, idx_info->dxpl_id, H5B_BTREE, &udata, &(idx_info->layout->u.chunk.u.btree.addr)/*out*/) < 0) + if(H5B_create(idx_info->f, idx_info->dxpl_id, H5B_BTREE, &udata, &(idx_info->layout->store.u.chunk.u.btree.addr)/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create B-tree") done: @@ -938,7 +938,7 @@ H5D_btree_idx_is_space_alloc(const H5O_layout_t *layout) HDassert(layout); /* Set return value */ - ret_value = (hbool_t)H5F_addr_defined(layout->u.chunk.u.btree.addr); + ret_value = (hbool_t)H5F_addr_defined(layout->store.u.chunk.u.btree.addr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_btree_idx_is_space_alloc() */ @@ -968,14 +968,14 @@ H5D_btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.btree.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.btree.addr)); HDassert(udata); /* * Create the chunk it if it doesn't exist, or reallocate the chunk if * its size changed. */ - if(H5B_insert(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->u.chunk.u.btree.addr, udata) < 0) + if(H5B_insert(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->store.u.chunk.u.btree.addr, udata) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to allocate chunk") done: @@ -1012,7 +1012,7 @@ H5D_btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata HDassert(udata); /* Go get the chunk information from the B-tree */ - if(H5B_find(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->u.chunk.u.btree.addr, udata) < 0) + if(H5B_find(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->store.u.chunk.u.btree.addr, udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") done: @@ -1094,7 +1094,7 @@ H5D_btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.btree.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.btree.addr)); HDassert(chunk_cb); HDassert(chunk_udata); @@ -1105,7 +1105,7 @@ H5D_btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over existing chunks */ - if((ret_value = H5B_iterate(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->u.chunk.u.btree.addr, H5D_btree_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5B_iterate(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->store.u.chunk.u.btree.addr, H5D_btree_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over chunk B-tree"); FUNC_LEAVE_NOAPI(ret_value) @@ -1135,13 +1135,13 @@ H5D_btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t * HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.btree.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.btree.addr)); HDassert(udata); /* Remove the chunk from the v1 B-tree index and release the space for the * chunk (in the B-tree callback). */ - if(H5B_remove(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->u.chunk.u.btree.addr, udata) < 0) + if(H5B_remove(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->store.u.chunk.u.btree.addr, udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to remove chunk entry") done: @@ -1177,7 +1177,7 @@ H5D_btree_idx_delete(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->layout); /* Check if the index data structure has been allocated */ - if(H5F_addr_defined(idx_info->layout->u.chunk.u.btree.addr)) { + if(H5F_addr_defined(idx_info->layout->store.u.chunk.u.btree.addr)) { H5O_layout_t tmp_layout; /* Local copy of layout info */ H5D_btree_ud0_t udata; /* User data for B-tree iterator call */ @@ -1191,7 +1191,7 @@ H5D_btree_idx_delete(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info") /* Delete entire B-tree */ - if(H5B_delete(idx_info->f, idx_info->dxpl_id, H5B_BTREE, tmp_layout.u.chunk.u.btree.addr, &udata) < 0) + if(H5B_delete(idx_info->f, idx_info->dxpl_id, H5B_BTREE, tmp_layout.store.u.chunk.u.btree.addr, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk B-tree") /* Free the raw B-tree node buffer */ @@ -1234,7 +1234,7 @@ H5D_btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(idx_info_dst->f); HDassert(idx_info_dst->pline); HDassert(idx_info_dst->layout); - HDassert(!H5F_addr_defined(idx_info_dst->layout->u.chunk.u.btree.addr)); + HDassert(!H5F_addr_defined(idx_info_dst->layout->store.u.chunk.u.btree.addr)); /* Create shared B-tree info for each file */ if(H5D_btree_shared_create(idx_info_src->f, idx_info_src->layout) < 0) @@ -1245,7 +1245,7 @@ H5D_btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, /* Create the root of the B-tree that describes chunked storage in the dest. file */ if(H5D_btree_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") - HDassert(H5F_addr_defined(idx_info_dst->layout->u.chunk.u.btree.addr)); + HDassert(H5F_addr_defined(idx_info_dst->layout->store.u.chunk.u.btree.addr)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1326,7 +1326,7 @@ H5D_btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) udata.mesg = idx_info->layout; /* Get metadata information for B-tree */ - if(H5B_get_info(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->u.chunk.u.btree.addr, &bt_info, NULL, &udata) < 0) + if(H5B_get_info(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->layout->store.u.chunk.u.btree.addr, &bt_info, NULL, &udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to iterate over chunk B-tree") /* Set the size of the B-tree */ @@ -1369,7 +1369,7 @@ H5D_btree_idx_reset(H5O_layout_t *layout, hbool_t reset_addr) /* Reset index info */ if(reset_addr) - layout->u.chunk.u.btree.addr = HADDR_UNDEF; + layout->store.u.chunk.u.btree.addr = HADDR_UNDEF; layout->u.chunk.u.btree.shared = NULL; FUNC_LEAVE_NOAPI(SUCCEED) @@ -1399,7 +1399,7 @@ H5D_btree_idx_dump(const H5D_chk_idx_info_t *idx_info, FILE *stream) HDassert(idx_info->layout); HDassert(stream); - HDfprintf(stream, " Address: %a\n", idx_info->layout->u.chunk.u.btree.addr); + HDfprintf(stream, " Address: %a\n", idx_info->layout->store.u.chunk.u.btree.addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D_btree_idx_dump() */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index a1f5044..7639c2e 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -127,16 +127,16 @@ H5D_compact_fill(H5D_t *dset, hid_t dxpl_id) /* Check args */ HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); HDassert(dset && H5D_COMPACT == dset->shared->layout.type); - HDassert(dset->shared->layout.u.compact.buf); + HDassert(dset->shared->layout.store.u.compact.buf); HDassert(dset->shared->type); HDassert(dset->shared->space); /* Initialize the fill value buffer */ /* (use the compact dataset storage buffer as the fill value buffer) */ - if(H5D_fill_init(&fb_info, dset->shared->layout.u.compact.buf, FALSE, + if(H5D_fill_init(&fb_info, dset->shared->layout.store.u.compact.buf, FALSE, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, - dset->shared->type_id, (size_t)0, dset->shared->layout.u.compact.size, dxpl_id) < 0) + dset->shared->type_id, (size_t)0, dset->shared->layout.store.u.compact.size, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; @@ -186,13 +186,13 @@ H5D_compact_construct(H5F_t *f, H5D_t *dset) * layout. */ tmp_size = H5S_GET_EXTENT_NPOINTS(dset->shared->space) * H5T_get_size(dset->shared->type); - H5_ASSIGN_OVERFLOW(dset->shared->layout.u.compact.size, tmp_size, hssize_t, size_t); + H5_ASSIGN_OVERFLOW(dset->shared->layout.store.u.compact.size, tmp_size, hssize_t, size_t); /* Verify data size is smaller than maximum header message size * (64KB) minus other layout message fields. */ comp_data_size = H5O_MESG_MAX_SIZE - H5O_layout_meta_size(f, &(dset->shared->layout)); - if(dset->shared->layout.u.compact.size > comp_data_size) + if(dset->shared->layout.store.u.compact.size > comp_data_size) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "compact dataset size is bigger than header message maximum size") done: @@ -244,8 +244,8 @@ H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED * { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_compact_io_init) - io_info->store->compact.buf = io_info->dset->shared->layout.u.compact.buf; - io_info->store->compact.dirty = &io_info->dset->shared->layout.u.compact.dirty; + io_info->store->compact.buf = io_info->dset->shared->layout.store.u.compact.buf; + io_info->store->compact.dirty = &io_info->dset->shared->layout.store.u.compact.dirty; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D_compact_io_init() */ @@ -356,10 +356,10 @@ H5D_compact_flush(H5D_t *dset, hid_t dxpl_id, unsigned UNUSED flags) HDassert(dset); /* Check if the buffered compact information is dirty */ - if(dset->shared->layout.u.compact.dirty) { + if(dset->shared->layout.store.u.compact.dirty) { if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") - dset->shared->layout.u.compact.dirty = FALSE; + dset->shared->layout.store.u.compact.dirty = FALSE; } /* end if */ done: @@ -449,7 +449,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, max_dt_size = MAX(max_dt_size, tmp_dt_size); /* Set number of whole elements that fit in buffer */ - if(0 == (nelmts = layout_src->u.compact.size / src_dt_size)) + if(0 == (nelmts = layout_src->store.u.compact.size / src_dt_size)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "element size too large") /* Set up number of bytes to copy, and initial buffer size */ @@ -476,7 +476,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, if(NULL == (buf = H5FL_BLK_MALLOC(type_conv, buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - HDmemcpy(buf, layout_src->u.compact.buf, layout_src->u.compact.size); + HDmemcpy(buf, layout_src->store.u.compact.buf, layout_src->store.u.compact.size); /* Convert from source file to memory */ if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, NULL, dxpl_id) < 0) @@ -492,7 +492,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") - HDmemcpy(layout_dst->u.compact.buf, buf, layout_dst->u.compact.size); + HDmemcpy(layout_dst->store.u.compact.buf, buf, layout_dst->store.u.compact.size); if(H5D_vlen_reclaim(tid_mem, buf_space, H5P_DATASET_XFER_DEFAULT, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data") @@ -504,24 +504,24 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, size_t ref_count; /* Determine # of reference elements to copy */ - ref_count = layout_src->u.compact.size / H5T_get_size(dt_src); + ref_count = layout_src->store.u.compact.size / H5T_get_size(dt_src); /* Copy objects referenced in source buffer to destination file and set destination elements */ - if(H5O_copy_expand_ref(f_src, layout_src->u.compact.buf, dxpl_id, f_dst, - layout_dst->u.compact.buf, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) + if(H5O_copy_expand_ref(f_src, layout_src->store.u.compact.buf, dxpl_id, f_dst, + layout_dst->store.u.compact.buf, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy reference attribute") } /* end if */ else /* Reset value to zero */ - HDmemset(layout_dst->u.compact.buf, 0, layout_src->u.compact.size); + HDmemset(layout_dst->store.u.compact.buf, 0, layout_src->store.u.compact.size); } /* end if */ else /* Type conversion not necessary */ - HDmemcpy(layout_dst->u.compact.buf, layout_src->u.compact.buf, layout_src->u.compact.size); + HDmemcpy(layout_dst->store.u.compact.buf, layout_src->store.u.compact.buf, layout_src->store.u.compact.size); } /* end if */ else /* Type conversion not necessary */ - HDmemcpy(layout_dst->u.compact.buf, layout_src->u.compact.buf, layout_src->u.compact.size); + HDmemcpy(layout_dst->store.u.compact.buf, layout_src->store.u.compact.buf, layout_src->store.u.compact.size); done: if(buf_sid > 0 && H5I_dec_ref(buf_sid, FALSE) < 0) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 11ba22c..a2b1f59 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -132,7 +132,7 @@ H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ ) HDassert(layout); /* Allocate space for the contiguous data */ - if(HADDR_UNDEF == (layout->u.contig.addr = H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, layout->u.contig.size))) + if(HADDR_UNDEF == (layout->store.u.contig.addr = H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, layout->u.contig.size))) HGOTO_ERROR(H5E_IO, H5E_NOSPACE, FAIL, "unable to reserve file space") done: @@ -179,7 +179,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) /* Check args */ HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); HDassert(dset && H5D_CONTIGUOUS == dset->shared->layout.type); - HDassert(H5F_addr_defined(dset->shared->layout.u.contig.addr)); + HDassert(H5F_addr_defined(dset->shared->layout.store.u.contig.addr)); HDassert(dset->shared->layout.u.contig.size > 0); HDassert(dset->shared->space); HDassert(dset->shared->type); @@ -214,7 +214,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Initialize storage info for this dataset */ - store.contig.dset_addr = dset->shared->layout.u.contig.addr; + store.contig.dset_addr = dset->shared->layout.store.u.contig.addr; store.contig.dset_size = dset->shared->layout.u.contig.size; /* Get the number of elements in the dataset's dataspace */ @@ -328,7 +328,7 @@ H5D_contig_delete(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout) HDassert(layout); /* Free the file space for the chunk */ - if(H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, layout->u.contig.addr, layout->u.contig.size) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, layout->store.u.contig.addr, layout->u.contig.size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object header") done: @@ -357,7 +357,7 @@ H5D_contig_get_addr(const H5D_t *dset) HDassert(dset); HDassert(dset->shared->layout.type == H5D_CONTIGUOUS); - FUNC_LEAVE_NOAPI(dset->shared->layout.u.contig.addr) + FUNC_LEAVE_NOAPI(dset->shared->layout.store.u.contig.addr) } /* end H5D_contig_get_addr() */ @@ -456,7 +456,7 @@ H5D_contig_is_space_alloc(const H5O_layout_t *layout) HDassert(layout); /* Set return value */ - ret_value = (hbool_t)H5F_addr_defined(layout->u.contig.addr); + ret_value = (hbool_t)H5F_addr_defined(layout->store.u.contig.addr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_contig_is_space_alloc() */ @@ -481,7 +481,7 @@ H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *t { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_contig_io_init) - io_info->store->contig.dset_addr = io_info->dset->shared->layout.u.contig.addr; + io_info->store->contig.dset_addr = io_info->dset->shared->layout.store.u.contig.addr; io_info->store->contig.dset_size = io_info->dset->shared->layout.u.contig.size; FUNC_LEAVE_NOAPI(SUCCEED) @@ -1365,8 +1365,8 @@ H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, } /* end if */ /* Loop over copying data */ - addr_src = layout_src->u.contig.addr; - addr_dst = layout_dst->u.contig.addr; + addr_src = layout_src->store.u.contig.addr; + addr_dst = layout_dst->store.u.contig.addr; while(total_src_nbytes > 0) { /* Check if we should reduce the number of bytes to transfer */ if(total_src_nbytes < src_nbytes) { diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index 714c2e3..a7e7fa9 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -115,7 +115,7 @@ H5Ddebug(hid_t dset_id) if(H5D_CHUNKED == dset->shared->layout.type) (void)H5D_chunk_dump_index(dset, H5AC_dxpl_id, stdout); else if(H5D_CONTIGUOUS == dset->shared->layout.type) - HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.u.contig.addr); + HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.store.u.contig.addr); done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 5006223..204b455 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -622,7 +622,7 @@ H5D_earray_idx_depend(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->pline); HDassert(idx_info->layout); HDassert(H5D_CHUNK_IDX_EARRAY == idx_info->layout->u.chunk.idx_type); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)); HDassert(idx_info->layout->u.chunk.u.earray.ea); /* Set up object header location for dataset */ @@ -677,7 +677,7 @@ H5D_earray_idx_undepend(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->pline); HDassert(idx_info->layout); HDassert(H5D_CHUNK_IDX_EARRAY == idx_info->layout->u.chunk.idx_type); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)); HDassert(idx_info->layout->u.chunk.u.earray.ea); /* Set up object header location for dataset */ @@ -735,7 +735,7 @@ H5D_earray_idx_open(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->pline); HDassert(idx_info->layout); HDassert(H5D_CHUNK_IDX_EARRAY == idx_info->layout->u.chunk.idx_type); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)); HDassert(NULL == idx_info->layout->u.chunk.u.earray.ea); /* Set up the user data */ @@ -744,7 +744,7 @@ H5D_earray_idx_open(const H5D_chk_idx_info_t *idx_info) /* Open the extensible array for the chunk index */ cls = (idx_info->pline->nused > 0) ? H5EA_CLS_FILT_CHUNK : H5EA_CLS_CHUNK; - if(NULL == (idx_info->layout->u.chunk.u.earray.ea = H5EA_open(idx_info->f, idx_info->dxpl_id, idx_info->layout->u.chunk.u.earray.addr, cls, &udata))) + if(NULL == (idx_info->layout->u.chunk.u.earray.ea = H5EA_open(idx_info->f, idx_info->dxpl_id, idx_info->layout->store.u.chunk.u.earray.addr, cls, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open extensible array") /* Check for SWMR writes to the file */ @@ -857,7 +857,7 @@ H5D_earray_idx_create(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(!H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)); + HDassert(!H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)); HDassert(NULL == idx_info->layout->u.chunk.u.earray.ea); /* General parameters */ @@ -898,7 +898,7 @@ H5D_earray_idx_create(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create extensible array") /* Get the address of the extensible array in file */ - if(H5EA_get_addr(idx_info->layout->u.chunk.u.earray.ea, &(idx_info->layout->u.chunk.u.earray.addr)) < 0) + if(H5EA_get_addr(idx_info->layout->u.chunk.u.earray.ea, &(idx_info->layout->store.u.chunk.u.earray.addr)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array address") /* Check for SWMR writes to the file */ @@ -935,7 +935,7 @@ H5D_earray_idx_is_space_alloc(const H5O_layout_t *layout) HDassert(layout); /* Set return value */ - ret_value = (hbool_t)H5F_addr_defined(layout->u.chunk.u.earray.addr); + ret_value = (hbool_t)H5F_addr_defined(layout->store.u.chunk.u.earray.addr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_earray_idx_is_space_alloc() */ @@ -967,7 +967,7 @@ H5D_earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)); HDassert(udata); /* Check if the extensible array is open yet */ @@ -1127,7 +1127,7 @@ H5D_earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)); HDassert(udata); /* Check if the extensible array is open yet */ @@ -1258,7 +1258,7 @@ H5D_earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)); HDassert(chunk_cb); HDassert(chunk_udata); @@ -1366,7 +1366,7 @@ H5D_earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)); HDassert(udata); /* Check if the extensible array is open yet */ @@ -1513,7 +1513,7 @@ H5D_earray_idx_delete(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->layout); /* Check if the index data structure has been allocated */ - if(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)) { + if(H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)) { H5D_earray_ud_t udata; /* User data for callback */ /* Initialize user data for callback */ @@ -1530,9 +1530,9 @@ H5D_earray_idx_delete(const H5D_chk_idx_info_t *idx_info) idx_info->layout->u.chunk.u.earray.ea = NULL; /* Delete extensible array */ - if(H5EA_delete(idx_info->f, idx_info->dxpl_id, idx_info->layout->u.chunk.u.earray.addr) < 0) + if(H5EA_delete(idx_info->f, idx_info->dxpl_id, idx_info->layout->store.u.chunk.u.earray.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk extensible array") - idx_info->layout->u.chunk.u.earray.addr = HADDR_UNDEF; + idx_info->layout->store.u.chunk.u.earray.addr = HADDR_UNDEF; } /* end if */ else HDassert(NULL == idx_info->layout->u.chunk.u.earray.ea); @@ -1571,7 +1571,7 @@ H5D_earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(idx_info_dst->f); HDassert(idx_info_dst->pline); HDassert(idx_info_dst->layout); - HDassert(!H5F_addr_defined(idx_info_dst->layout->u.chunk.u.earray.addr)); + HDassert(!H5F_addr_defined(idx_info_dst->layout->store.u.chunk.u.earray.addr)); /* Check if the source extensible array is open yet */ if(NULL == idx_info_src->layout->u.chunk.u.earray.ea) { @@ -1583,7 +1583,7 @@ H5D_earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, /* Create the extensible array that describes chunked storage in the dest. file */ if(H5D_earray_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") - HDassert(H5F_addr_defined(idx_info_dst->layout->u.chunk.u.earray.addr)); + HDassert(H5F_addr_defined(idx_info_dst->layout->store.u.chunk.u.earray.addr)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1656,7 +1656,7 @@ H5D_earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.earray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.earray.addr)); HDassert(index_size); /* Open the extensible array in file */ @@ -1711,7 +1711,7 @@ H5D_earray_idx_reset(H5O_layout_t *layout, hbool_t reset_addr) /* Reset index info */ if(reset_addr) { - layout->u.chunk.u.earray.addr = HADDR_UNDEF; + layout->store.u.chunk.u.earray.addr = HADDR_UNDEF; layout->u.chunk.u.earray.dset_ohdr_addr = HADDR_UNDEF; } /* end if */ layout->u.chunk.u.earray.ea = NULL; @@ -1879,7 +1879,7 @@ H5D_earray_idx_dump(const H5D_chk_idx_info_t *idx_info, FILE *stream) HDassert(idx_info->layout); HDassert(stream); - HDfprintf(stream, " Address: %a\n", idx_info->layout->u.chunk.u.earray.addr); + HDfprintf(stream, " Address: %a\n", idx_info->layout->store.u.chunk.u.earray.addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D_earray_idx_dump() */ diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index b9c5017..f1b3ee1 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -630,7 +630,7 @@ H5D_farray_idx_open(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->pline); HDassert(idx_info->layout); HDassert(H5D_CHUNK_IDX_FARRAY == idx_info->layout->u.chunk.idx_type); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.farray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.farray.addr)); HDassert(NULL == idx_info->layout->u.chunk.u.farray.fa); /* Set up the user data */ @@ -639,7 +639,7 @@ H5D_farray_idx_open(const H5D_chk_idx_info_t *idx_info) /* Open the fixed array for the chunk index */ cls = (idx_info->pline->nused > 0) ? H5FA_CLS_FILT_CHUNK : H5FA_CLS_CHUNK; - if(NULL == (idx_info->layout->u.chunk.u.farray.fa = H5FA_open(idx_info->f, idx_info->dxpl_id, idx_info->layout->u.chunk.u.farray.addr, cls, &udata))) + if(NULL == (idx_info->layout->u.chunk.u.farray.fa = H5FA_open(idx_info->f, idx_info->dxpl_id, idx_info->layout->store.u.chunk.u.farray.addr, cls, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open fixed array") done: @@ -679,7 +679,7 @@ H5D_farray_idx_create(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(!H5F_addr_defined(idx_info->layout->u.chunk.u.farray.addr)); + HDassert(!H5F_addr_defined(idx_info->layout->store.u.chunk.u.farray.addr)); HDassert(NULL == idx_info->layout->u.chunk.u.farray.fa); HDassert(idx_info->layout->u.chunk.nchunks); @@ -714,7 +714,7 @@ H5D_farray_idx_create(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create fixed array") /* Get the address of the fixed array in file */ - if(H5FA_get_addr(idx_info->layout->u.chunk.u.farray.fa, &(idx_info->layout->u.chunk.u.farray.addr)) < 0) + if(H5FA_get_addr(idx_info->layout->u.chunk.u.farray.fa, &(idx_info->layout->store.u.chunk.u.farray.addr)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array address") done: @@ -745,7 +745,7 @@ H5D_farray_idx_is_space_alloc(const H5O_layout_t *layout) HDassert(layout); /* Set return value */ - ret_value = (hbool_t)H5F_addr_defined(layout->u.chunk.u.farray.addr); + ret_value = (hbool_t)H5F_addr_defined(layout->store.u.chunk.u.farray.addr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_farray_idx_is_space_alloc() */ @@ -777,7 +777,7 @@ H5D_farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.farray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.farray.addr)); HDassert(udata); /* Check if the fixed array is open yet */ @@ -922,7 +922,7 @@ H5D_farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.farray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.farray.addr)); HDassert(udata); /* Check if the fixed array is open yet */ @@ -1055,7 +1055,7 @@ H5D_farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.farray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.farray.addr)); HDassert(chunk_cb); HDassert(chunk_udata); @@ -1125,7 +1125,7 @@ H5D_farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.farray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.farray.addr)); HDassert(udata); /* Check if the fixed array is open yet */ @@ -1265,7 +1265,7 @@ H5D_farray_idx_delete(const H5D_chk_idx_info_t *idx_info) HDassert(idx_info->layout); /* Check if the index data structure has been allocated */ - if(H5F_addr_defined(idx_info->layout->u.chunk.u.farray.addr)) { + if(H5F_addr_defined(idx_info->layout->store.u.chunk.u.farray.addr)) { H5FA_t *fa; /* Pointer to fixed array structure */ H5FA_stat_t fa_stat; /* Fixed array statistics */ @@ -1304,9 +1304,9 @@ H5D_farray_idx_delete(const H5D_chk_idx_info_t *idx_info) idx_info->layout->u.chunk.u.farray.fa = NULL; /* Delete fixed array */ - if(H5FA_delete(idx_info->f, idx_info->dxpl_id, idx_info->layout->u.chunk.u.farray.addr) < 0) + if(H5FA_delete(idx_info->f, idx_info->dxpl_id, idx_info->layout->store.u.chunk.u.farray.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk fixed array") - idx_info->layout->u.chunk.u.farray.addr = HADDR_UNDEF; + idx_info->layout->store.u.chunk.u.farray.addr = HADDR_UNDEF; } /* end if */ else HDassert(NULL == idx_info->layout->u.chunk.u.farray.fa); @@ -1345,7 +1345,7 @@ H5D_farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(idx_info_dst->f); HDassert(idx_info_dst->pline); HDassert(idx_info_dst->layout); - HDassert(!H5F_addr_defined(idx_info_dst->layout->u.chunk.u.farray.addr)); + HDassert(!H5F_addr_defined(idx_info_dst->layout->store.u.chunk.u.farray.addr)); /* Check if the source fixed array is open yet */ if(NULL == idx_info_src->layout->u.chunk.u.farray.fa) { @@ -1357,7 +1357,7 @@ H5D_farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, /* Create the fixed array that describes chunked storage in the dest. file */ if(H5D_farray_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") - HDassert(H5F_addr_defined(idx_info_dst->layout->u.chunk.u.farray.addr)); + HDassert(H5F_addr_defined(idx_info_dst->layout->store.u.chunk.u.farray.addr)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1430,7 +1430,7 @@ H5D_farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) HDassert(idx_info->f); HDassert(idx_info->pline); HDassert(idx_info->layout); - HDassert(H5F_addr_defined(idx_info->layout->u.chunk.u.farray.addr)); + HDassert(H5F_addr_defined(idx_info->layout->store.u.chunk.u.farray.addr)); HDassert(index_size); /* Open the fixed array in file */ @@ -1480,7 +1480,7 @@ H5D_farray_idx_reset(H5O_layout_t *layout, hbool_t reset_addr) /* Reset index info */ if(reset_addr) - layout->u.chunk.u.farray.addr = HADDR_UNDEF; + layout->store.u.chunk.u.farray.addr = HADDR_UNDEF; layout->u.chunk.u.farray.fa = NULL; FUNC_LEAVE_NOAPI(SUCCEED) @@ -1510,7 +1510,7 @@ H5D_farray_idx_dump(const H5D_chk_idx_info_t *idx_info, FILE *stream) HDassert(idx_info->layout); HDassert(stream); - HDfprintf(stream, " Address: %a\n", idx_info->layout->u.chunk.u.farray.addr); + HDfprintf(stream, " Address: %a\n", idx_info->layout->store.u.chunk.u.farray.addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D_farray_idx_dump() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 34d69fa..dd28772 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -784,7 +784,7 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) /* Add the dataset's raw data size to the size of the header, if the raw data will be stored as compact */ if(layout->type == H5D_COMPACT) - ohdr_size += layout->u.compact.size; + ohdr_size += layout->store.u.compact.size; /* Create an object header for the dataset */ if(H5O_create(file, dxpl_id, ohdr_size, dset->shared->dcpl_id, oloc/*out*/) < 0) @@ -1407,7 +1407,7 @@ H5D_close(H5D_t *dataset) case H5D_COMPACT: /* Free the buffer for the raw data for compact datasets */ - dataset->shared->layout.u.compact.buf = H5MM_xfree(dataset->shared->layout.u.compact.buf); + dataset->shared->layout.store.u.compact.buf = H5MM_xfree(dataset->shared->layout.store.u.compact.buf); break; default: @@ -1621,14 +1621,14 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al case H5D_COMPACT: /* Check if space is already allocated */ - if(layout->u.compact.buf==NULL) { + if(NULL == layout->store.u.compact.buf) { /* Reserve space in layout header message for the entire array. */ - HDassert(layout->u.compact.size > 0); - if(NULL == (layout->u.compact.buf = H5MM_malloc(layout->u.compact.size))) + HDassert(layout->store.u.compact.size > 0); + if(NULL == (layout->store.u.compact.buf = H5MM_malloc(layout->store.u.compact.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for compact dataset") if(!full_overwrite) - HDmemset(layout->u.compact.buf, 0, layout->u.compact.size); - layout->u.compact.dirty = TRUE; + HDmemset(layout->store.u.compact.buf, 0, layout->store.u.compact.size); + layout->store.u.compact.dirty = TRUE; /* Indicate that we should initialize storage space */ must_init_space = TRUE; @@ -1794,7 +1794,7 @@ H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) break; case H5D_COMPACT: - ret_value = dset->shared->layout.u.compact.size; + ret_value = dset->shared->layout.store.u.compact.size; break; default: @@ -1838,9 +1838,9 @@ H5D_get_offset(const H5D_t *dset) case H5D_CONTIGUOUS: /* If dataspace hasn't been allocated or dataset is stored in * an external file, the value will be HADDR_UNDEF. */ - if(dset->shared->dcpl_cache.efl.nused == 0 || H5F_addr_defined(dset->shared->layout.u.contig.addr)) + if(dset->shared->dcpl_cache.efl.nused == 0 || H5F_addr_defined(dset->shared->layout.store.u.contig.addr)) /* Return the absolute dataset offset from the beginning of file. */ - ret_value = dset->shared->layout.u.contig.addr + H5F_BASE_ADDR(dset->oloc.file); + ret_value = dset->shared->layout.store.u.contig.addr + H5F_BASE_ADDR(dset->oloc.file); break; default: diff --git a/src/H5Olayout.c b/src/H5Olayout.c index bafee40..a456ef5 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -153,13 +153,13 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, /* Address */ if(mesg->type == H5D_CONTIGUOUS) { - H5F_addr_decode(f, &p, &(mesg->u.contig.addr)); + H5F_addr_decode(f, &p, &(mesg->store.u.contig.addr)); /* Set the layout operations */ mesg->ops = H5D_LOPS_CONTIG; } /* end if */ else if(mesg->type == H5D_CHUNKED) { - H5F_addr_decode(f, &p, &(mesg->u.chunk.u.btree.addr)); + H5F_addr_decode(f, &p, &(mesg->store.u.chunk.u.btree.addr)); /* Set the layout operations */ mesg->ops = H5D_LOPS_CHUNK; @@ -198,12 +198,12 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, } /* end if */ if(mesg->type == H5D_COMPACT) { - UINT32DECODE(p, mesg->u.compact.size); - if(mesg->u.compact.size > 0) { - if(NULL == (mesg->u.compact.buf = H5MM_malloc(mesg->u.compact.size))) + UINT32DECODE(p, mesg->store.u.compact.size); + if(mesg->store.u.compact.size > 0) { + if(NULL == (mesg->store.u.compact.buf = H5MM_malloc(mesg->store.u.compact.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for compact data buffer") - HDmemcpy(mesg->u.compact.buf, p, mesg->u.compact.size); - p += mesg->u.compact.size; + HDmemcpy(mesg->store.u.compact.buf, p, mesg->store.u.compact.size); + p += mesg->store.u.compact.size; } /* end if */ } /* end if */ } /* end if */ @@ -214,12 +214,12 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, /* Interpret the rest of the message according to the layout class */ switch(mesg->type) { case H5D_COMPACT: - UINT16DECODE(p, mesg->u.compact.size); - if(mesg->u.compact.size > 0) { - if(NULL == (mesg->u.compact.buf = H5MM_malloc(mesg->u.compact.size))) + UINT16DECODE(p, mesg->store.u.compact.size); + if(mesg->store.u.compact.size > 0) { + if(NULL == (mesg->store.u.compact.buf = H5MM_malloc(mesg->store.u.compact.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for compact data buffer") - HDmemcpy(mesg->u.compact.buf, p, mesg->u.compact.size); - p += mesg->u.compact.size; + HDmemcpy(mesg->store.u.compact.buf, p, mesg->store.u.compact.size); + p += mesg->store.u.compact.size; } /* end if */ /* Set the layout operations */ @@ -227,7 +227,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, break; case H5D_CONTIGUOUS: - H5F_addr_decode(f, &p, &(mesg->u.contig.addr)); + H5F_addr_decode(f, &p, &(mesg->store.u.contig.addr)); H5F_DECODE_LENGTH(f, p, mesg->u.contig.size); /* Set the layout operations */ @@ -242,7 +242,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "dimensionality is too large") /* B-tree address */ - H5F_addr_decode(f, &p, &(mesg->u.chunk.u.btree.addr)); + H5F_addr_decode(f, &p, &(mesg->store.u.chunk.u.btree.addr)); /* Chunk dimensions */ for(u = 0; u < mesg->u.chunk.ndims; u++) @@ -296,7 +296,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, switch(mesg->u.chunk.idx_type) { case H5D_CHUNK_IDX_BTREE: /* Remove this when v2 B-tree indices added */ /* B-tree address */ - H5F_addr_decode(f, &p, &(mesg->u.chunk.u.btree.addr)); + H5F_addr_decode(f, &p, &(mesg->store.u.chunk.u.btree.addr)); /* Set the chunk operations */ mesg->u.chunk.ops = H5D_COPS_BTREE; @@ -309,7 +309,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid fixed array creation parameter") /* Fixed array header address */ - H5F_addr_decode(f, &p, &(mesg->u.chunk.u.farray.addr)); + H5F_addr_decode(f, &p, &(mesg->store.u.chunk.u.farray.addr)); /* Set the chunk operations */ mesg->u.chunk.ops = H5D_COPS_FARRAY; @@ -334,7 +334,7 @@ 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") /* Extensible array header address */ - H5F_addr_decode(f, &p, &(mesg->u.chunk.u.earray.addr)); + H5F_addr_decode(f, &p, &(mesg->store.u.chunk.u.earray.addr)); /* Set the chunk operations */ mesg->u.chunk.ops = H5D_COPS_EARRAY; @@ -425,20 +425,20 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi switch(mesg->type) { case H5D_COMPACT: /* Size of raw data */ - UINT16ENCODE(p, mesg->u.compact.size); + UINT16ENCODE(p, mesg->store.u.compact.size); /* Raw data */ - if(mesg->u.compact.size > 0) { - if(mesg->u.compact.buf) - HDmemcpy(p, mesg->u.compact.buf, mesg->u.compact.size); + if(mesg->store.u.compact.size > 0) { + if(mesg->store.u.compact.buf) + HDmemcpy(p, mesg->store.u.compact.buf, mesg->store.u.compact.size); else - HDmemset(p, 0, mesg->u.compact.size); - p += mesg->u.compact.size; + HDmemset(p, 0, mesg->store.u.compact.size); + p += mesg->store.u.compact.size; } /* end if */ break; case H5D_CONTIGUOUS: - H5F_addr_encode(f, &p, mesg->u.contig.addr); + H5F_addr_encode(f, &p, mesg->store.u.contig.addr); H5F_ENCODE_LENGTH(f, p, mesg->u.contig.size); break; @@ -449,7 +449,7 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi *p++ = (uint8_t)mesg->u.chunk.ndims; /* B-tree address */ - H5F_addr_encode(f, &p, mesg->u.chunk.u.btree.addr); + H5F_addr_encode(f, &p, mesg->store.u.chunk.u.btree.addr); /* Dimension sizes */ for(u = 0; u < mesg->u.chunk.ndims; u++) @@ -477,7 +477,7 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi switch(mesg->u.chunk.idx_type) { case H5D_CHUNK_IDX_BTREE: /* Remove this when v2 B-tree indices added */ /* B-tree address */ - H5F_addr_encode(f, &p, mesg->u.chunk.u.btree.addr); + H5F_addr_encode(f, &p, mesg->store.u.chunk.u.btree.addr); break; case H5D_CHUNK_IDX_FARRAY: @@ -485,7 +485,7 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi *p++ = mesg->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits; /* Fixed array header address */ - H5F_addr_encode(f, &p, mesg->u.chunk.u.farray.addr); + H5F_addr_encode(f, &p, mesg->store.u.chunk.u.farray.addr); break; case H5D_CHUNK_IDX_EARRAY: @@ -497,7 +497,7 @@ 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; /* Extensible array header address */ - H5F_addr_encode(f, &p, mesg->u.chunk.u.earray.addr); + H5F_addr_encode(f, &p, mesg->store.u.chunk.u.earray.addr); break; default: @@ -552,13 +552,13 @@ H5O_layout_copy(const void *_mesg, void *_dest) *dest = *mesg; /* Deep copy the buffer for compact datasets also */ - if(mesg->type == H5D_COMPACT && mesg->u.compact.size > 0) { + if(mesg->type == H5D_COMPACT && mesg->store.u.compact.size > 0) { /* Allocate memory for the raw data */ - if(NULL == (dest->u.compact.buf = H5MM_malloc(dest->u.compact.size))) + if(NULL == (dest->store.u.compact.buf = H5MM_malloc(dest->store.u.compact.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for compact dataset") /* Copy over the raw data */ - HDmemcpy(dest->u.compact.buf, mesg->u.compact.buf, dest->u.compact.size); + HDmemcpy(dest->store.u.compact.buf, mesg->store.u.compact.buf, dest->store.u.compact.size); } /* end if */ /* Reset the pointer of the chunked storage index but not the address */ @@ -602,8 +602,8 @@ H5O_layout_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg HDassert(mesg); ret_value = H5O_layout_meta_size(f, mesg); - if(mesg->type == H5D_COMPACT) - ret_value += mesg->u.compact.size;/* data for compact dataset */ + if(H5D_COMPACT == mesg->type) + ret_value += mesg->store.u.compact.size;/* data for compact dataset */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_layout_size() */ @@ -620,28 +620,26 @@ H5O_layout_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg * Programmer: Quincey Koziol * Friday, September 13, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_layout_reset (void *_mesg) +H5O_layout_reset(void *_mesg) { - H5O_layout_t *mesg = (H5O_layout_t *) _mesg; + H5O_layout_t *mesg = (H5O_layout_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_layout_reset); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_layout_reset) if(mesg) { /* Free the compact storage buffer */ - if(mesg->type==H5D_COMPACT) - mesg->u.compact.buf=H5MM_xfree(mesg->u.compact.buf); + if(H5D_COMPACT == mesg->type) + mesg->store.u.compact.buf = H5MM_xfree(mesg->store.u.compact.buf); /* Reset the message */ - mesg->type=H5D_CONTIGUOUS; + mesg->type = H5D_CONTIGUOUS; } /* end if */ - FUNC_LEAVE_NOAPI(SUCCEED); -} + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_layout_reset() */ /*------------------------------------------------------------------------- @@ -668,8 +666,8 @@ H5O_layout_free(void *_mesg) HDassert(mesg); /* Free the compact storage buffer */ - if(mesg->type == H5D_COMPACT) - mesg->u.compact.buf = H5MM_xfree(mesg->u.compact.buf); + if(H5D_COMPACT == mesg->type) + mesg->store.u.compact.buf = H5MM_xfree(mesg->store.u.compact.buf); (void)H5FL_FREE(H5O_layout_t, mesg); @@ -775,15 +773,15 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, /* Copy the layout type specific information */ switch(layout_src->type) { case H5D_COMPACT: - if(layout_src->u.compact.buf) { - if(NULL == (layout_dst->u.compact.buf = H5MM_malloc(layout_src->u.compact.size))) + if(layout_src->store.u.compact.buf) { + if(NULL == (layout_dst->store.u.compact.buf = H5MM_malloc(layout_src->store.u.compact.size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for compact dataset") /* copy compact raw data */ if(H5D_compact_copy(file_src, layout_src, file_dst, layout_dst, udata->src_dtype, cpy_info, dxpl_id) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to copy chunked storage") - layout_dst->u.compact.dirty = TRUE; + layout_dst->store.u.compact.dirty = TRUE; } /* end if */ break; @@ -796,11 +794,11 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, layout_dst->u.contig.size = H5S_extent_nelem(udata->src_space_extent) * H5T_get_size(udata->src_dtype); - if(H5F_addr_defined(layout_src->u.contig.addr)) { + if(H5F_addr_defined(layout_src->store.u.contig.addr)) { /* create contig layout */ if(H5D_contig_copy(file_src, layout_src, file_dst, layout_dst, udata->src_dtype, cpy_info, dxpl_id) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to copy contiguous storage") - } /* if ( H5F_addr_defined(layout_src->u.contig.addr)) */ + } /* end if */ break; case H5D_CHUNKED: @@ -808,7 +806,7 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, /* Create chunked layout */ if(H5D_chunk_copy(file_src, layout_src, file_dst, layout_dst, udata->src_space_extent, udata->src_dtype, udata->src_pline, cpy_info, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to copy chunked storage") - } /* if ( H5F_addr_defined(layout_srct->u.chunk.addr)) */ + } /* end if */ break; default: @@ -882,21 +880,21 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "v1 B-tree"); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "B-tree address:", mesg->u.chunk.u.btree.addr); + "B-tree address:", mesg->store.u.chunk.u.btree.addr); break; - case H5D_CHUNK_IDX_EARRAY: + case H5D_CHUNK_IDX_FARRAY: HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Index Type:", "Extensible Array"); + "Index Type:", "Fixed Array"); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Extensible Array address:", mesg->u.chunk.u.earray.addr); + "Fixed Array address:", mesg->store.u.chunk.u.farray.addr); break; - case H5D_CHUNK_IDX_FARRAY: + case H5D_CHUNK_IDX_EARRAY: HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Index Type:", "Fixed Array"); + "Index Type:", "Extensible Array"); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Fixed Array address:", mesg->u.chunk.u.farray.addr); + "Extensible Array address:", mesg->store.u.chunk.u.earray.addr); break; default: @@ -910,7 +908,7 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Contiguous"); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Data address:", mesg->u.contig.addr); + "Data address:", mesg->store.u.contig.addr); HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Data Size:", mesg->u.contig.size); break; @@ -919,7 +917,7 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Compact"); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Data Size:", mesg->u.compact.size); + "Data Size:", mesg->store.u.compact.size); break; default: diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 119abb3..49f0b9b 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -321,6 +321,7 @@ typedef struct H5O_efl_t { H5O_efl_entry_t *slot; /*array of external file entries */ } H5O_efl_t; + /* * Data Layout Message. * (Data structure in file) @@ -357,17 +358,69 @@ typedef struct H5O_efl_t { struct H5D_layout_ops_t; /* Defined in H5Dpkg.h */ struct H5D_chunk_ops_t; /* Defined in H5Dpkg.h */ -typedef struct H5O_layout_contig_t { +typedef struct H5O_storage_contig_t { haddr_t addr; /* File address of data */ +} H5O_storage_contig_t; + +typedef struct H5O_storage_chunk_btree_t { + haddr_t addr; /* File address of B-tree */ +} H5O_storage_chunk_btree_t; + +typedef struct H5O_storage_chunk_farray_t { + haddr_t addr; /* File address of fixed array */ +} H5O_storage_chunk_farray_t; + +typedef struct H5O_storage_chunk_earray_t { + haddr_t addr; /* File address of extensible array */ +} H5O_storage_chunk_earray_t; + +typedef struct H5O_storage_chunk_t { + H5D_chunk_index_t idx_type; /* Type of chunk index */ + union { + H5O_storage_chunk_btree_t btree; /* Information for v1 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 */ + } u; +} H5O_storage_chunk_t; + +typedef struct H5O_storage_compact_t { + hbool_t dirty; /* Dirty flag for compact dataset */ + size_t size; /* Size of buffer in bytes */ + void *buf; /* Buffer for compact dataset */ +} H5O_storage_compact_t; + +typedef struct H5O_storage_t { + H5D_layout_t type; /* Type of layout */ + union { + H5O_storage_contig_t contig; /* Information for contiguous storage */ + H5O_storage_chunk_t chunk; /* Information for chunked storage */ + H5O_storage_compact_t compact; /* Information for compact storage */ + } u; +} H5O_storage_t; + +typedef struct H5O_layout_contig_t { hsize_t size; /* Size of data in bytes */ } H5O_layout_contig_t; typedef struct H5O_layout_chunk_btree_t { - haddr_t addr; /* File address of B-tree */ H5RC_t *shared; /* Ref-counted shared info for B-tree nodes */ } H5O_layout_chunk_btree_t; /* Forward declaration of structs used below */ +struct H5FA_t; /* Defined in H5FAprivate.h */ + +typedef struct H5O_layout_chunk_farray_t { + /* Creation parameters for fixed array data structure */ + struct { + uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in a data block page) - + i.e. # of bits needed to store max. # of elements + in a data block page */ + } cparam; + + struct H5FA_t *fa; /* Pointer to fixed index array struct */ +} H5O_layout_chunk_farray_t; + +/* Forward declaration of structs used below */ struct H5EA_t; /* Defined in H5EAprivate.h */ typedef struct H5O_layout_chunk_earray_t { @@ -380,28 +433,12 @@ typedef struct H5O_layout_chunk_earray_t { uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ } cparam; - haddr_t addr; /* File address of extensible array */ haddr_t dset_ohdr_addr; /* File address dataset's object header */ unsigned unlim_dim; /* Rank of unlimited dimension for dataset */ hsize_t swizzled_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled "down" size of number of chunks in each dimension */ struct H5EA_t *ea; /* Pointer to extensible array struct */ } H5O_layout_chunk_earray_t; -/* Forward declaration of structs used below */ -struct H5FA_t; /* Defined in H5FAprivate.h */ - -typedef struct H5O_layout_chunk_farray_t { - /* Creation parameters for fixed array data structure */ - struct { - uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in a data block page) - - i.e. # of bits needed to store max. # of elements - in a data block page */ - } cparam; - - haddr_t addr; /* File address of fixed index array */ - struct H5FA_t *fa; /* Pointer to fixed index array struct */ -} H5O_layout_chunk_farray_t; - typedef struct H5O_layout_chunk_t { H5D_chunk_index_t idx_type; /* Type of chunk index */ unsigned ndims; /* Num dimensions in chunk */ @@ -414,17 +451,11 @@ typedef struct H5O_layout_chunk_t { const struct H5D_chunk_ops_t *ops; /* Pointer to chunked layout operations */ union { H5O_layout_chunk_btree_t btree; /* Information for v1 B-tree index */ - H5O_layout_chunk_earray_t earray; /* Information for extensible array index */ H5O_layout_chunk_farray_t farray; /* Information for fixed array index */ + H5O_layout_chunk_earray_t earray; /* Information for extensible array index */ } u; } H5O_layout_chunk_t; -typedef struct H5O_layout_compact_t { - hbool_t dirty; /* Dirty flag for compact dataset */ - size_t size; /* Size of buffer in bytes */ - void *buf; /* Buffer for compact dataset */ -} H5O_layout_compact_t; - typedef struct H5O_layout_t { H5D_layout_t type; /* Type of layout */ unsigned version; /* Version of message */ @@ -432,8 +463,8 @@ typedef struct H5O_layout_t { union { H5O_layout_contig_t contig; /* Information for contiguous layout */ H5O_layout_chunk_t chunk; /* Information for chunked layout */ - H5O_layout_compact_t compact; /* Information for compact layout */ } u; + H5O_storage_t store; /* Information for storing dataset elements */ } H5O_layout_t; /* Enable reading/writing "bogus" messages */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 18f1f9f..dd9843e 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -49,22 +49,27 @@ /****************/ /* Define default layout information */ -#define H5D_DEF_LAYOUT_COMPACT_INIT {(hbool_t)FALSE, (size_t)0, NULL} -#define H5D_DEF_LAYOUT_CONTIG_INIT {HADDR_UNDEF, (hsize_t)0} -#define H5D_DEF_LAYOUT_CHUNK_INIT {H5D_CHUNK_IDX_BTREE, (unsigned)1, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, (unsigned)0, (uint32_t)0, (hsize_t)0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, NULL, {{HADDR_UNDEF, NULL}}} +#define H5D_DEF_STORAGE_COMPACT_INIT {(hbool_t)FALSE, (size_t)0, NULL} +#define H5D_DEF_STORAGE_CONTIG_INIT {HADDR_UNDEF} +#define H5D_DEF_STORAGE_CHUNK_INIT {H5D_CHUNK_IDX_BTREE, {{HADDR_UNDEF}}} +#define H5D_DEF_LAYOUT_CONTIG_INIT {(hsize_t)0} +#define H5D_DEF_LAYOUT_CHUNK_INIT {H5D_CHUNK_IDX_BTREE, (unsigned)1, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, (unsigned)0, (uint32_t)0, (hsize_t)0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, NULL, {{NULL}}} #ifdef H5_HAVE_C99_DESIGNATED_INITIALIZER -#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, { .compact = H5D_DEF_LAYOUT_COMPACT_INIT }} -#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, { .contig = H5D_DEF_LAYOUT_CONTIG_INIT }} -#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, { .chunk = H5D_DEF_LAYOUT_CHUNK_INIT }} +#define H5D_DEF_STORAGE_COMPACT {H5D_COMPACT, { .compact = H5D_DEF_STORAGE_COMPACT_INIT }} +#define H5D_DEF_STORAGE_CONTIG {H5D_CONTIGUOUS, { .contig = H5D_DEF_STORAGE_CONTIG_INIT }} +#define H5D_DEF_STORAGE_CHUNK {H5D_CHUNKED, { .chunk = H5D_DEF_STORAGE_CHUNK_INIT }} +#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, { .contig = H5D_DEF_LAYOUT_CONTIG_INIT }, H5D_DEF_STORAGE_COMPACT} +#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, { .contig = H5D_DEF_LAYOUT_CONTIG_INIT }, H5D_DEF_STORAGE_CONTIG} +#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, { .chunk = H5D_DEF_LAYOUT_CHUNK_INIT }, H5D_DEF_STORAGE_CHUNK} #else /* H5_HAVE_C99_DESIGNATED_INITIALIZER */ /* Note that the compact & chunked layout initialization values are using the * contiguous layout initialization in the union, because the contiguous * layout is first in the union. These values are overridden in the * H5P_init_def_layout() routine. -QAK */ -#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}} -#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}} -#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}} +#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}} +#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}} +#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}} #endif /* H5_HAVE_C99_DESIGNATED_INITIALIZER */ /* ======== Dataset creation properties ======== */ @@ -269,12 +274,12 @@ H5P_dcrt_copy(hid_t dst_plist_id, hid_t src_plist_id, void UNUSED *copy_data) dst_layout.ops = NULL; switch(dst_layout.type) { case H5D_COMPACT: - dst_layout.u.compact.buf = H5MM_xfree(dst_layout.u.compact.buf); - HDmemset(&dst_layout.u.compact, 0, sizeof(dst_layout.u.compact)); + dst_layout.store.u.compact.buf = H5MM_xfree(dst_layout.store.u.compact.buf); + HDmemset(&dst_layout.store.u.compact, 0, sizeof(dst_layout.store.u.compact)); break; case H5D_CONTIGUOUS: - dst_layout.u.contig.addr = HADDR_UNDEF; + dst_layout.store.u.contig.addr = HADDR_UNDEF; dst_layout.u.contig.size = 0; break; @@ -767,14 +772,18 @@ done: static herr_t H5P_init_def_layout(void) { - const H5O_layout_compact_t def_compact = H5D_DEF_LAYOUT_COMPACT_INIT; - const H5O_layout_chunk_t def_chunk = H5D_DEF_LAYOUT_CHUNK_INIT; + const H5O_layout_compact_t def_layout_compact = H5D_DEF_LAYOUT_COMPACT_INIT; + const H5O_layout_chunk_t def_layout_chunk = H5D_DEF_LAYOUT_CHUNK_INIT; + const H5O_storage_compact_t def_store_compact = H5D_DEF_STORAGE_COMPACT_INIT; + const H5O_storage_chunk_t def_store_chunk = H5D_DEF_STORAGE_CHUNK_INIT; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_init_def_layout) /* Initialize the default layout info for non-contigous layouts */ - H5D_def_layout_compact_g.u.compact = def_compact; + H5D_def_layout_compact_g.u.compact = def_layout_compact; + H5D_def_layout_compact_g.store.u.compact = def_store_compact; H5D_def_layout_chunk_g.u.chunk = def_chunk; + H5D_def_layout_compact_g.store.u.chunk = def_store_chunk; /* Note that we've initialized the default values */ H5P_dcrt_def_layout_init_g = TRUE; |