summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-12-13 05:42:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-12-13 05:42:36 (GMT)
commite78db67c621a2ce04d95c1c6b2b4b3c23682abfb (patch)
tree56a0b2364c3416c82e2fdcdb0c245b9c07d9c149 /src
parentaa4fc58ac985ba354525056428d79f918f95d119 (diff)
downloadhdf5-e78db67c621a2ce04d95c1c6b2b4b3c23682abfb.zip
hdf5-e78db67c621a2ce04d95c1c6b2b4b3c23682abfb.tar.gz
hdf5-e78db67c621a2ce04d95c1c6b2b4b3c23682abfb.tar.bz2
[svn-r28606] Description:
Revisions to normalize revise chunks vs. trunk, plus push dataset metadata changes into the cache immediately (instead of holding them within the dataset data structures). Tested on: MacOSX/64 10.11.2 (amazon) w/serial & parallel (h5committest not required on this branch)
Diffstat (limited to 'src')
-rw-r--r--src/H5Dbtree.c15
-rw-r--r--src/H5Dchunk.c101
-rw-r--r--src/H5Dint.c79
-rw-r--r--src/H5Doh.c34
-rw-r--r--src/H5Dpkg.h6
-rw-r--r--src/H5Dvirtual.c9
-rw-r--r--src/H5Goh.c20
-rw-r--r--src/H5O.c2
-rw-r--r--src/H5Ocopy.c12
-rw-r--r--src/H5Oefl.c4
-rw-r--r--src/H5Olayout.c166
-rw-r--r--src/H5Opkg.h4
-rw-r--r--src/H5Oprivate.h6
-rw-r--r--src/H5Otest.c4
-rw-r--r--src/H5Pdcpl.c26
-rw-r--r--src/H5Pfapl.c6
-rw-r--r--src/H5Pint.c14
-rw-r--r--src/H5Ppublic.h1
-rw-r--r--src/H5Ptest.c2
-rw-r--r--src/H5SMcache.c2
-rw-r--r--src/H5Shyper.c2
-rw-r--r--src/H5T.c18
-rw-r--r--src/H5VMprivate.h4
-rw-r--r--src/H5trace.c3
24 files changed, 267 insertions, 273 deletions
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index ea98d6e8..30c3a28 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -1348,9 +1348,8 @@ done:
static herr_t
H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
{
- H5D_chunk_common_ud_t udata; /* User-data for loading B-tree nodes */
+ H5D_chunk_common_ud_t udata; /* User-data for loading B-tree nodes */
H5B_info_t bt_info; /* B-tree info */
- hbool_t shared_init = FALSE; /* Whether shared B-tree info is initialized */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1363,11 +1362,6 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
HDassert(idx_info->storage);
HDassert(index_size);
- /* Initialize the shared info for the B-tree traversal */
- if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
- shared_init = TRUE;
-
/* Initialize B-tree node user-data */
HDmemset(&udata, 0, sizeof udata);
udata.layout = idx_info->layout;
@@ -1381,13 +1375,6 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
*index_size = bt_info.size;
done:
- if(shared_init) {
- if(NULL == idx_info->storage->u.btree.shared)
- HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil")
- if(H5UC_DEC(idx_info->storage->u.btree.shared) < 0)
- HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")
- } /* end if */
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__btree_idx_size() */
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 7e73a4a..4b33ebd 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -4120,9 +4120,9 @@ done:
herr_t
H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
{
- hsize_t min_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Scaled offset of first chunk to modify in each dimension */
- hsize_t max_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk to modify in each dimension */
- hssize_t max_fill_chunk_off[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk that might be filled in each dimension */
+ hsize_t min_mod_chunk_sc[H5O_LAYOUT_NDIMS]; /* Scaled offset of first chunk to modify in each dimension */
+ hsize_t max_mod_chunk_sc[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk to modify in each dimension */
+ hssize_t max_fill_chunk_sc[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk that might be filled in each dimension */
hbool_t fill_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of edge chunks in this dimension needs to be filled */
H5D_chk_idx_info_t idx_info; /* Chunked index info */
H5D_io_info_t chk_io_info; /* Chunked I/O info object */
@@ -4226,19 +4226,19 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
/*
* Determine the chunks which need to be filled or removed
*/
- HDmemset(min_mod_chunk_off, 0, sizeof(min_mod_chunk_off));
- HDmemset(max_mod_chunk_off, 0, sizeof(max_mod_chunk_off));
+ HDmemset(min_mod_chunk_sc, 0, sizeof(min_mod_chunk_sc));
+ HDmemset(max_mod_chunk_sc, 0, sizeof(max_mod_chunk_sc));
for(op_dim = 0; op_dim < (unsigned)space_ndims; op_dim++) {
/* Calculate the largest offset of chunks that might need to be
* modified in this dimension */
- max_mod_chunk_off[op_dim] = (old_dim[op_dim] - 1) / chunk_dim[op_dim];
+ max_mod_chunk_sc[op_dim] = (old_dim[op_dim] - 1) / chunk_dim[op_dim];
/* Calculate the largest offset of chunks that might need to be
* filled in this dimension */
if(0 == space_dim[op_dim])
- max_fill_chunk_off[op_dim] = -1;
+ max_fill_chunk_sc[op_dim] = -1;
else
- max_fill_chunk_off[op_dim] = (hssize_t)(((MIN(space_dim[op_dim], old_dim[op_dim]) - 1)
+ max_fill_chunk_sc[op_dim] = (hssize_t)(((MIN(space_dim[op_dim], old_dim[op_dim]) - 1)
/ chunk_dim[op_dim]));
if(shrunk_dim[op_dim]) {
@@ -4246,10 +4246,10 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
* modified in this dimension. Note that this array contains
* garbage for all dimensions which are not shrunk. These locations
* must not be read from! */
- min_mod_chunk_off[op_dim] = space_dim[op_dim] / chunk_dim[op_dim];
+ min_mod_chunk_sc[op_dim] = space_dim[op_dim] / chunk_dim[op_dim];
/* Determine if we need to fill chunks in this dimension */
- if((hssize_t)min_mod_chunk_off[op_dim] == max_fill_chunk_off[op_dim])
+ if((hssize_t)min_mod_chunk_sc[op_dim] == max_fill_chunk_sc[op_dim])
fill_dim[op_dim] = TRUE;
else
fill_dim[op_dim] = FALSE;
@@ -4268,16 +4268,16 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
if(!shrunk_dim[op_dim])
continue;
else {
- HDassert(max_mod_chunk_off[op_dim] >= min_mod_chunk_off[op_dim]);
+ HDassert(max_mod_chunk_sc[op_dim] >= min_mod_chunk_sc[op_dim]);
/* Reset the chunk offset indices */
HDmemset(scaled, 0, (space_ndims * sizeof(scaled[0])));
- scaled[op_dim] = min_mod_chunk_off[op_dim];
+ scaled[op_dim] = min_mod_chunk_sc[op_dim];
/* Initialize "dims_outside_fill" array */
ndims_outside_fill = 0;
for(u = 0; u < space_ndims; u++)
- if((hssize_t)scaled[u] > max_fill_chunk_off[u]) {
+ if((hssize_t)scaled[u] > max_fill_chunk_sc[u]) {
dims_outside_fill[u] = TRUE;
ndims_outside_fill++;
} /* end if */
@@ -4291,7 +4291,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
if(0 == ndims_outside_fill) {
HDassert(fill_dim[op_dim]);
- HDassert(scaled[op_dim] == min_mod_chunk_off[op_dim]);
+ HDassert(scaled[op_dim] == min_mod_chunk_sc[op_dim]);
/* Fill the unused parts of the chunk */
if(H5D__chunk_prune_fill(&udata) < 0)
@@ -4339,11 +4339,11 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
carry = TRUE;
for(i = (int)(space_ndims - 1); i >= 0; --i) {
scaled[i]++;
- if(scaled[i] > max_mod_chunk_off[i]) {
+ if(scaled[i] > max_mod_chunk_sc[i]) {
/* Left maximum dimensions, "wrap around" and check if this
* dimension is no longer outside the fill dimension */
if((unsigned)i == op_dim) {
- scaled[i] = min_mod_chunk_off[i];
+ scaled[i] = min_mod_chunk_sc[i];
if(dims_outside_fill[i] && fill_dim[i]) {
dims_outside_fill[i] = FALSE;
ndims_outside_fill--;
@@ -4351,7 +4351,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
} /* end if */
else {
scaled[i] = 0;
- if(dims_outside_fill[i] && max_fill_chunk_off[i] >= 0) {
+ if(dims_outside_fill[i] && max_fill_chunk_sc[i] >= 0) {
dims_outside_fill[i] = FALSE;
ndims_outside_fill--;
} /* end if */
@@ -4359,7 +4359,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
} /* end if */
else {
/* Check if we just went outside the fill dimension */
- if(!dims_outside_fill[i] && (hssize_t)scaled[i] > max_fill_chunk_off[i]) {
+ if(!dims_outside_fill[i] && (hssize_t)scaled[i] > max_fill_chunk_sc[i]) {
dims_outside_fill[i] = TRUE;
ndims_outside_fill++;
} /* end if */
@@ -4371,13 +4371,13 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
} /* end for */
} /* end while(!carry) */
- /* Adjust max_mod_chunk_off so we don't modify the same chunk twice.
+ /* Adjust max_mod_chunk_sc so we don't modify the same chunk twice.
* Also check if this dimension started from 0 (and hence removed all
* of the chunks). */
- if(min_mod_chunk_off[op_dim] == 0)
+ if(min_mod_chunk_sc[op_dim] == 0)
break;
else
- max_mod_chunk_off[op_dim] = min_mod_chunk_off[op_dim] - 1;
+ max_mod_chunk_sc[op_dim] = min_mod_chunk_sc[op_dim] - 1;
} /* end for(op_dim=0...) */
/* Reset any cached chunk info for this dataset */
@@ -4677,7 +4677,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
const H5O_pline_t *pline = udata->pline; /* I/O pipeline for applying filters */
/* needed for commpressed variable length data */
- hbool_t has_filters = FALSE; /* Whether chunk has filters */
+ hbool_t must_filter = FALSE; /* Whether chunk must be filtered during copy */
size_t nbytes; /* Size of chunk in file (in bytes) */
H5Z_cb_t cb_struct; /* Filter failure callback struct */
@@ -4699,8 +4699,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
} /* end if */
/* Check for filtered chunks */
- if(pline && pline->nused) {
- has_filters = TRUE;
+ if((is_vlen || fix_ref) && pline && pline->nused) {
+ must_filter = TRUE;
cb_struct.func = NULL; /* no callback function when failed */
} /* end if */
@@ -4731,7 +4731,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk")
/* Need to uncompress variable-length & reference data elements */
- if(has_filters && (is_vlen || fix_ref)) {
+ if(must_filter) {
unsigned filter_mask = chunk_rec->filter_mask;
if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0)
@@ -4795,7 +4795,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
udata_dst.filter_mask = chunk_rec->filter_mask;
/* Need to compress variable-length & reference data elements before writing to file */
- if(has_filters && (is_vlen || fix_ref)) {
+ if(must_filter) {
if(H5Z_pipeline(pline, 0, &(udata_dst.filter_mask), H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed")
#if H5_SIZEOF_SIZE_T > 4
@@ -5104,32 +5104,67 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D__chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout,
- const H5O_pline_t *pline, hsize_t *index_size)
+H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5O_layout_t *layout,
+ hsize_t *index_size)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
+ H5S_t *space = NULL; /* Dataset's dataspace */
+ H5O_pline_t pline; /* I/O pipeline message */
+ htri_t exists; /* Flag if header message of interest exists */
+ hbool_t idx_info_init = FALSE; /* Whether the chunk index info has been initialized */
+ hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
/* Check args */
- HDassert(f);
+ HDassert(loc);
+ HDassert(loc->file);
+ HDassert(H5F_addr_defined(loc->addr));
HDassert(layout);
- HDassert(pline);
HDassert(index_size);
+ /* Check for I/O pipeline message */
+ if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read object header")
+ else if(exists) {
+ if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_PLINE_ID, &pline))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't find I/O pipeline message")
+ pline_read = TRUE;
+ } /* end else if */
+ else
+ HDmemset(&pline, 0, sizeof(pline));
+
/* Compose chunked index info struct */
- idx_info.f = f;
+ idx_info.f = loc->file;
idx_info.dxpl_id = dxpl_id;
- idx_info.pline = pline;
+ idx_info.pline = &pline;
idx_info.layout = &layout->u.chunk;
idx_info.storage = &layout->storage.u.chunk;
+ /* Get the dataspace for the dataset */
+ if(NULL == (space = H5S_read(loc, dxpl_id)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header")
+
+ /* Allocate any indexing structures */
+ if(layout->storage.u.chunk.ops->init && (layout->storage.u.chunk.ops->init)(&idx_info, space, loc->addr) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information")
+ idx_info_init = TRUE;
+
/* Get size of index structure */
- if((layout->storage.u.chunk.ops->size)(&idx_info, index_size) < 0)
+ if(layout->storage.u.chunk.ops->size && (layout->storage.u.chunk.ops->size)(&idx_info, index_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve chunk index info")
done:
+ /* Free resources, if they've been initialized */
+ if(idx_info_init && layout->storage.u.chunk.ops->dest &&
+ (layout->storage.u.chunk.ops->dest)(&idx_info) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
+ if(pline_read && H5O_msg_reset(H5O_PLINE_ID, &pline) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline message")
+ if(space && H5S_close(space) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_bh_info() */
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 891805b..b9899c8 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -2566,7 +2566,6 @@ done:
herr_t
H5D__flush_real(H5D_t *dataset, hid_t dxpl_id)
{
- H5O_t *oh = NULL; /* Pointer to dataset's object header */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL)
@@ -2577,38 +2576,6 @@ H5D__flush_real(H5D_t *dataset, hid_t dxpl_id)
/* Avoid flushing the dataset (again) if it's closing */
if(!dataset->shared->closing) {
- /* Check for metadata changes that will require updating the object's modification time */
- if(dataset->shared->layout_dirty || dataset->shared->space_dirty) {
- unsigned update_flags = H5O_UPDATE_TIME; /* Modification time flag */
-
- /* Pin the object header */
- if(NULL == (oh = H5O_pin(&dataset->oloc, dxpl_id)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTPIN, FAIL, "unable to pin dataset object header")
-
- /* Update the layout on disk, if it's been changed */
- if(dataset->shared->layout_dirty) {
- if(H5D__layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout/pline/efl info")
- dataset->shared->layout_dirty = FALSE;
-
- /* Reset the "update the modification time" flag, so we only do it once */
- update_flags = 0;
- } /* end if */
-
- /* Update the dataspace on disk, if it's been changed */
- if(dataset->shared->space_dirty) {
- if(H5S_write(dataset->oloc.file, dxpl_id, oh, update_flags, dataset->shared->space) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace")
- dataset->shared->space_dirty = FALSE;
-
- /* Reset the "update the modification time" flag, so we only do it once */
- update_flags = 0;
- } /* end if */
-
- /* _Somebody_ should have update the modification time! */
- HDassert(update_flags == 0);
- } /* end if */
-
/* Flush cached raw data for each kind of dataset layout */
if(dataset->shared->layout.ops->flush &&
(dataset->shared->layout.ops->flush)(dataset, dxpl_id) < 0)
@@ -2616,11 +2583,6 @@ H5D__flush_real(H5D_t *dataset, hid_t dxpl_id)
} /* end if */
done:
- /* Release pointer to object header */
- if(oh != NULL)
- if(H5O_unpin(oh) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTUNPIN, FAIL, "unable to unpin dataset object header")
-
FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
} /* end H5D__flush_real() */
@@ -2641,19 +2603,50 @@ done:
herr_t
H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags)
{
+ H5O_t *oh = NULL; /* Pointer to dataset's object header */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_PACKAGE
/* Check args */
HDassert(dataset);
HDassert(!(flags & (unsigned)~(H5D_MARK_SPACE | H5D_MARK_LAYOUT)));
/* Mark aspects of the dataset as dirty */
- if(flags & H5D_MARK_SPACE)
- dataset->shared->space_dirty = TRUE;
- if(flags & H5D_MARK_LAYOUT)
- dataset->shared->layout_dirty = TRUE;
+ if(flags) {
+ unsigned update_flags = H5O_UPDATE_TIME; /* Modification time flag */
+
+ /* Pin the object header */
+ if(NULL == (oh = H5O_pin(&dataset->oloc, dxpl_id)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTPIN, FAIL, "unable to pin dataset object header")
+
+ /* Update the layout on disk, if it's been changed */
+ if(flags & H5D_MARK_LAYOUT) {
+ if(H5D__layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout/pline/efl info")
+
+ /* Reset the "update the modification time" flag, so we only do it once */
+ update_flags = 0;
+ } /* end if */
+
+ /* Update the dataspace on disk, if it's been changed */
+ if(flags & H5D_MARK_SPACE) {
+ if(H5S_write(dataset->oloc.file, dxpl_id, oh, update_flags, dataset->shared->space) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace")
+
+ /* Reset the "update the modification time" flag, so we only do it once */
+ update_flags = 0;
+ } /* end if */
+
+ /* _Somebody_ should have update the modification time! */
+ HDassert(update_flags == 0);
+ } /* end if */
+
+done:
+ /* Release pointer to object header */
+ if(oh != NULL)
+ if(H5O_unpin(oh) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTUNPIN, FAIL, "unable to unpin dataset object header")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__mark() */
diff --git a/src/H5Doh.c b/src/H5Doh.c
index db65479..8b70362 100644
--- a/src/H5Doh.c
+++ b/src/H5Doh.c
@@ -53,7 +53,7 @@ static hid_t H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id,
static void *H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc,
hid_t dxpl_id);
static H5O_loc_t *H5O__dset_get_oloc(hid_t obj_id);
-static herr_t H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
+static herr_t H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh,
H5_ih_info_t *bh_info);
static herr_t H5O__dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id);
@@ -359,13 +359,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
+H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
{
H5O_layout_t layout; /* Data storage layout message */
- H5O_pline_t pline; /* I/O pipeline message */
H5O_efl_t efl; /* External File List message */
hbool_t layout_read = FALSE; /* Whether the layout message was read */
- hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read */
hbool_t efl_read = FALSE; /* Whether the external file list message was read */
htri_t exists; /* Flag if header message of interest exists */
herr_t ret_value = SUCCEED; /* Return value */
@@ -373,29 +371,21 @@ H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
FUNC_ENTER_STATIC
/* Sanity check */
- HDassert(f);
+ HDassert(loc);
+ HDassert(loc->file);
+ HDassert(H5F_addr_defined(loc->addr));
HDassert(oh);
HDassert(bh_info);
/* Get the layout message from the object header */
- if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, &layout))
+ if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LAYOUT_ID, &layout))
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message")
layout_read = TRUE;
/* Check for chunked dataset storage */
if(layout.type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&layout.storage)) {
- /* Check for I/O pipeline message */
- if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read object header")
- else if(exists) {
- if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_PLINE_ID, &pline))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find I/O pipeline message")
- pline_read = TRUE;
- } /* end else if */
- else
- HDmemset(&pline, 0, sizeof(pline));
-
- if(H5D__chunk_bh_info(f, dxpl_id, &layout, &pline, &(bh_info->index_size)) < 0)
+ /* Get size of chunk index */
+ if(H5D__chunk_bh_info(loc, dxpl_id, oh, &layout, &(bh_info->index_size)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine chunked dataset btree info")
} /* end if */
else if(layout.type == H5D_VIRTUAL
@@ -403,7 +393,7 @@ H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
size_t virtual_heap_size;
/* Get size of global heap object for virtual dataset */
- if(H5HG_get_obj_size(f, dxpl_id, &(layout.storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0)
+ if(H5HG_get_obj_size(loc->file, dxpl_id, &(layout.storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get global heap size for virtual dataset mapping")
/* Return heap size */
@@ -419,12 +409,12 @@ H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
HDmemset(&efl, 0, sizeof(efl));
/* Get External File List message from the object header */
- if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_EFL_ID, &efl))
+ if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_EFL_ID, &efl))
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find EFL message")
efl_read = TRUE;
/* Get size of local heap for EFL message's file list */
- if(H5D__efl_bh_info(f, dxpl_id, &efl, &(bh_info->heap_size)) < 0)
+ if(H5D__efl_bh_info(loc->file, dxpl_id, &efl, &(bh_info->heap_size)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine EFL heap info")
} /* end if */
@@ -432,8 +422,6 @@ done:
/* Free messages, if they've been read in */
if(layout_read && H5O_msg_reset(H5O_LAYOUT_ID, &layout) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset data storage layout message")
- if(pline_read && H5O_msg_reset(H5O_PLINE_ID, &pline) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline message")
if(efl_read && H5O_msg_reset(H5O_EFL_ID, &efl) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset external file list message")
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 552c61b..f391e8c 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -414,8 +414,6 @@ typedef struct H5D_shared_t {
hid_t type_id; /* ID for dataset's datatype */
H5T_t *type; /* Datatype for this dataset */
H5S_t *space; /* Dataspace of this dataset */
- hbool_t space_dirty; /* Whether the dataspace info needs to be flushed to the file */
- hbool_t layout_dirty; /* Whether the layout info needs to be flushed to the file */
hid_t dcpl_id; /* Dataset creation property id */
H5D_dcpl_cache_t dcpl_cache; /* Cached DCPL values */
H5O_layout_t layout; /* Data layout */
@@ -636,8 +634,8 @@ H5_DLL herr_t H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src,
H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst,
const H5S_extent_t *ds_extent_src, const H5T_t *dt_src,
const H5O_pline_t *pline_src, H5O_copy_t *cpy_info, hid_t dxpl_id);
-H5_DLL herr_t H5D__chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout,
- const H5O_pline_t *pline, hsize_t *btree_size);
+H5_DLL herr_t H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh,
+ H5O_layout_t *layout, hsize_t *btree_size);
H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream);
H5_DLL herr_t H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
H5O_storage_t *store);
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index 7aceb2b..7c5186d 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -654,11 +654,10 @@ H5D__virtual_copy(H5F_t H5_ATTR_UNUSED *f_dst, H5O_layout_t *layout_dst,
{
herr_t ret_value = SUCCEED;
+#ifdef NOT_YET
FUNC_ENTER_PACKAGE
-
- /* Copy message in memory */
- if(H5D__virtual_copy_layout(layout_dst) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy virtual layout")
+#endif /* NOT_YET */
+ FUNC_ENTER_PACKAGE_NOERR
#ifdef NOT_YET
/* Check for copy to the same file */
@@ -676,7 +675,9 @@ H5D__virtual_copy(H5F_t H5_ATTR_UNUSED *f_dst, H5O_layout_t *layout_dst,
layout_dst->storage.u.virt.serial_list_hobjid.idx = (size_t)0;
} /* end block/else */
+#ifdef NOT_YET
done:
+#endif /* NOT_YET */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__virtual_copy() */
diff --git a/src/H5Goh.c b/src/H5Goh.c
index c516713..bde540c 100644
--- a/src/H5Goh.c
+++ b/src/H5Goh.c
@@ -53,7 +53,7 @@ static hid_t H5O_group_open(const H5G_loc_t *obj_loc, hid_t lapl_id,
static void *H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc,
hid_t dxpl_id);
static H5O_loc_t *H5O_group_get_oloc(hid_t obj_id);
-static herr_t H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
+static herr_t H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh,
H5_ih_info_t *bh_info);
@@ -333,7 +333,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
+H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
{
htri_t exists; /* Flag if header message of interest exists */
H5HF_t *fheap = NULL; /* Fractal heap handle */
@@ -344,7 +344,9 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oh->cache_info.addr, FAIL)
/* Sanity check */
- HDassert(f);
+ HDassert(loc);
+ HDassert(loc->file);
+ HDassert(H5F_addr_defined(loc->addr));
HDassert(oh);
HDassert(bh_info);
@@ -355,13 +357,13 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
H5O_linfo_t linfo; /* Link info message */
/* Get "new style" group info */
- if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LINFO_ID, &linfo))
+ if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LINFO_ID, &linfo))
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't read LINFO message")
/* Check if name index available */
if(H5F_addr_defined(linfo.name_bt2_addr)) {
/* Open the name index v2 B-tree */
- if(NULL == (bt2_name = H5B2_open(f, dxpl_id, linfo.name_bt2_addr, NULL)))
+ if(NULL == (bt2_name = H5B2_open(loc->file, dxpl_id, linfo.name_bt2_addr, NULL)))
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index")
/* Get name index B-tree size */
@@ -372,7 +374,7 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
/* Check if creation order index available */
if(H5F_addr_defined(linfo.corder_bt2_addr)) {
/* Open the creation order index v2 B-tree */
- if(NULL == (bt2_corder = H5B2_open(f, dxpl_id, linfo.corder_bt2_addr, NULL)))
+ if(NULL == (bt2_corder = H5B2_open(loc->file, dxpl_id, linfo.corder_bt2_addr, NULL)))
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index")
/* Get creation order index B-tree size */
@@ -383,7 +385,7 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
/* Get fractal heap size, if available */
if(H5F_addr_defined(linfo.fheap_addr)) {
/* Open the fractal heap for links */
- if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo.fheap_addr)))
+ if(NULL == (fheap = H5HF_open(loc->file, dxpl_id, linfo.fheap_addr)))
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap")
/* Get heap storage size */
@@ -395,11 +397,11 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
H5O_stab_t stab; /* Info about symbol table */
/* Must be "old style" group, get symbol table message */
- if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_STAB_ID, &stab))
+ if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_STAB_ID, &stab))
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't find LINFO nor STAB messages")
/* Get symbol table size info */
- if(H5G__stab_bh_size(f, dxpl_id, &stab, bh_info) < 0)
+ if(H5G__stab_bh_size(loc->file, dxpl_id, &stab, bh_info) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve symbol table size info")
} /* end else */
diff --git a/src/H5O.c b/src/H5O.c
index 6478f34..34fe498 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -2874,7 +2874,7 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info,
/* Check for 'bh_info' callback for this type of object */
if(obj_class->bh_info) {
/* Call the object's class 'bh_info' routine */
- if((obj_class->bh_info)(loc->file, dxpl_id, oh, &oinfo->meta_size.obj) < 0)
+ if((obj_class->bh_info)(loc, dxpl_id, oh, &oinfo->meta_size.obj) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object's btree & heap info")
} /* end if */
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index e641d70..02c72e7 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -337,7 +337,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
size_t null_msgs; /* Number of NULL messages found in each loop */
size_t orig_dst_msgs; /* Original # of messages in dest. object */
H5O_mesg_t *mesg_src; /* Message in source object header */
- H5O_mesg_t *mesg_dst; /* Message in source object header */
+ H5O_mesg_t *mesg_dst; /* Message in destination object header */
const H5O_msg_class_t *copy_type; /* Type of message to use for copying */
const H5O_obj_class_t *obj_class = NULL; /* Type of object we are copying */
void *cpy_udata = NULL; /* User data for passing to message callbacks */
@@ -357,12 +357,11 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
HDassert(cpy_info);
/* Get pointer to object class for this object */
- if((obj_class = H5O_obj_class(oloc_src, dxpl_id)) == NULL)
+ if(NULL == (obj_class = H5O_obj_class(oloc_src, dxpl_id)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type")
/* Check if the object at the address is already open in the file */
if(H5FO_opened(oloc_src->file, oloc_src->addr) != NULL) {
-
H5G_loc_t tmp_loc; /* Location of object */
H5O_loc_t tmp_oloc; /* Location of object */
H5G_name_t tmp_path; /* Object's path */
@@ -377,15 +376,14 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
/* Flush the object of this class */
if(obj_class->flush && obj_class->flush(&tmp_loc, dxpl_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object")
- }
+ } /* end if */
/* Get source object header */
if(NULL == (oh_src = H5O_protect(oloc_src, dxpl_id, H5AC__READ_ONLY_FLAG)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header")
/* Retrieve user data for particular type of object to copy */
- if(obj_class->get_copy_file_udata &&
- (NULL == (cpy_udata = (obj_class->get_copy_file_udata)())))
+ if(obj_class->get_copy_file_udata && (NULL == (cpy_udata = (obj_class->get_copy_file_udata)())))
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to retrieve copy user data")
/* If we are merging committed datatypes, check for a match in the destination
@@ -468,7 +466,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
oh_dst->alloc_nchunks = oh_dst->nchunks = 0;
/* Allocate memory for the chunk array - always start with 1 chunk */
- if(NULL == (oh_dst->chunk = H5FL_SEQ_MALLOC(H5O_chunk_t, 1)))
+ if(NULL == (oh_dst->chunk = H5FL_SEQ_MALLOC(H5O_chunk_t, (size_t)1)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Update number of allocated chunks. There are still no chunks used. */
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index 25ab753..149c8b2 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -476,7 +476,7 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds
HGOTO_ERROR(H5E_EFL, H5E_PROTECT, NULL, "unable to protect EFL file name heap")
/* Insert "empty" name first */
- if((size_t)(-1) == (name_offset = H5HL_insert(file_dst, dxpl_id, heap, (size_t)1, "")))
+ if(UFAIL == (name_offset = H5HL_insert(file_dst, dxpl_id, heap, (size_t)1, "")))
HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap")
HDassert(0 == name_offset);
@@ -493,7 +493,7 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds
/* copy the name from the source */
for(idx = 0; idx < efl_src->nused; idx++) {
efl_dst->slot[idx].name = H5MM_xstrdup(efl_src->slot[idx].name);
- if((size_t)(-1) == (efl_dst->slot[idx].name_offset = H5HL_insert(file_dst, dxpl_id, heap,
+ if(UFAIL == (efl_dst->slot[idx].name_offset = H5HL_insert(file_dst, dxpl_id, heap,
HDstrlen(efl_dst->slot[idx].name) + 1, efl_dst->slot[idx].name)))
HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap")
} /* end for */
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index daffe48..0c13498 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -40,19 +40,19 @@
/* PRIVATE PROTOTYPES */
-static void *H5O_layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
+static void *H5O__layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
-static herr_t H5O_layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void *H5O_layout_copy(const void *_mesg, void *_dest);
-static size_t H5O_layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
-static herr_t H5O_layout_reset(void *_mesg);
-static herr_t H5O_layout_free(void *_mesg);
-static herr_t H5O_layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
+static herr_t H5O__layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void *H5O__layout_copy(const void *_mesg, void *_dest);
+static size_t H5O__layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__layout_reset(void *_mesg);
+static herr_t H5O__layout_free(void *_mesg);
+static herr_t H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
void *_mesg);
-static void *H5O_layout_copy_file(H5F_t *file_src, void *mesg_src,
+static void *H5O__layout_copy_file(H5F_t *file_src, void *mesg_src,
H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags,
H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id);
-static herr_t H5O_layout_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream,
+static herr_t H5O__layout_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream,
int indent, int fwidth);
/* This message derives from H5O message class */
@@ -61,22 +61,22 @@ const H5O_msg_class_t H5O_MSG_LAYOUT[1] = {{
"layout", /*message name for debugging */
sizeof(H5O_layout_t), /*native message size */
0, /* messages are sharable? */
- H5O_layout_decode, /*decode message */
- H5O_layout_encode, /*encode message */
- H5O_layout_copy, /*copy the native value */
- H5O_layout_size, /*size of message on disk */
- H5O_layout_reset, /*reset method */
- H5O_layout_free, /*free the struct */
- H5O_layout_delete, /* file delete method */
+ H5O__layout_decode, /*decode message */
+ H5O__layout_encode, /*encode message */
+ H5O__layout_copy, /*copy the native value */
+ H5O__layout_size, /*size of message on disk */
+ H5O__layout_reset, /*reset method */
+ H5O__layout_free, /*free the struct */
+ H5O__layout_delete, /* file delete method */
NULL, /* link method */
NULL, /*set share method */
NULL, /*can share method */
NULL, /* pre copy native value to file */
- H5O_layout_copy_file, /* copy native value to file */
+ H5O__layout_copy_file, /* copy native value to file */
NULL, /* post copy native value to file */
NULL, /* get creation index */
NULL, /* set creation index */
- H5O_layout_debug /*debug the message */
+ H5O__layout_debug /*debug the message */
}};
@@ -85,7 +85,7 @@ H5FL_DEFINE(H5O_layout_t);
/*-------------------------------------------------------------------------
- * Function: H5O_layout_decode
+ * Function: H5O__layout_decode
*
* Purpose: Decode an data layout message and return a pointer to a
* new one created with malloc().
@@ -100,7 +100,7 @@ H5FL_DEFINE(H5O_layout_t);
*-------------------------------------------------------------------------
*/
static void *
-H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
+H5O__layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
{
H5O_layout_t *mesg = NULL;
@@ -108,7 +108,7 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *
unsigned u;
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(f);
@@ -117,6 +117,7 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *
/* decode */
if(NULL == (mesg = H5FL_CALLOC(H5O_layout_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ mesg->storage.type = H5D_LAYOUT_ERROR;
mesg->version = *p++;
if(mesg->version < H5O_LAYOUT_VERSION_1 || mesg->version > H5O_LAYOUT_VERSION_4)
@@ -134,6 +135,9 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *
mesg->type = (H5D_layout_t)*p++;
HDassert(H5D_CONTIGUOUS == mesg->type || H5D_CHUNKED == mesg->type || H5D_COMPACT == mesg->type);
+ /* Set the storage type */
+ mesg->storage.type = mesg->type;
+
/* Reserved bytes */
p += 5;
@@ -194,16 +198,21 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *
} /* end if */
} /* end if */
else {
- /* Layout class */
+ /* Layout & storage class */
mesg->type = mesg->storage.type = (H5D_layout_t)*p++;
/* Interpret the rest of the message according to the layout class */
switch(mesg->type) {
case H5D_COMPACT:
+ /* Compact data size */
UINT16DECODE(p, mesg->storage.u.compact.size);
+
if(mesg->storage.u.compact.size > 0) {
+ /* Allocate space for compact data */
if(NULL == (mesg->storage.u.compact.buf = H5MM_malloc(mesg->storage.u.compact.size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for compact data buffer")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed for compact data buffer")
+
+ /* Compact data */
HDmemcpy(mesg->storage.u.compact.buf, p, mesg->storage.u.compact.size);
p += mesg->storage.u.compact.size;
} /* end if */
@@ -213,7 +222,10 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *
break;
case H5D_CONTIGUOUS:
+ /* Contiguous storage address */
H5F_addr_decode(f, &p, &(mesg->storage.u.contig.addr));
+
+ /* Contiguous storage size */
H5F_DECODE_LENGTH(f, p, mesg->storage.u.contig.size);
/* Set the layout operations */
@@ -409,11 +421,11 @@ done:
heap_block = (uint8_t *)H5MM_xfree(heap_block);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_layout_decode() */
+} /* end H5O__layout_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_layout_encode
+ * Function: H5O__layout_encode
*
* Purpose: Encodes a message.
*
@@ -426,24 +438,10 @@ done:
* Quincey Koziol, 2004-5-21
* We write out version 3 messages by default now.
*
- * Modifications:
- * Robb Matzke, 1998-07-20
- * Rearranged the message to add a version number at the beginning.
- *
- * Raymond Lu, 2002-2-26
- * Added version number 2 case depends on if space has been allocated
- * at the moment when layout header message is updated.
- *
- * Quincey Koziol, 2004-5-21
- * Added version number 3 case to straighten out problems with contiguous
- * layout's sizes (was encoding them as 4-byte values when they were
- * really n-byte values (where n usually is 8)) and additionally clean up
- * the information written out.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
uint8_t *heap_block = NULL;
@@ -451,7 +449,7 @@ H5O_layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
unsigned u;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(f);
@@ -482,7 +480,10 @@ H5O_layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
break;
case H5D_CONTIGUOUS:
+ /* Contiguous storage address */
H5F_addr_encode(f, &p, mesg->storage.u.contig.addr);
+
+ /* Contiguous storage size */
H5F_ENCODE_LENGTH(f, p, mesg->storage.u.contig.size);
break;
@@ -613,11 +614,11 @@ done:
str_size = (size_t *)H5MM_xfree(str_size);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_layout_encode() */
+} /* end H5O__layout_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_layout_copy
+ * Function: H5O__layout_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -632,13 +633,13 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5O_layout_copy(const void *_mesg, void *_dest)
+H5O__layout_copy(const void *_mesg, void *_dest)
{
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
H5O_layout_t *dest = (H5O_layout_t *) _dest;
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(mesg);
@@ -665,6 +666,8 @@ H5O_layout_copy(const void *_mesg, void *_dest)
/* Copy over the raw data */
HDmemcpy(dest->storage.u.compact.buf, mesg->storage.u.compact.buf, dest->storage.u.compact.size);
} /* end if */
+ else
+ HDassert(dest->storage.u.compact.buf == NULL);
break;
case H5D_CONTIGUOUS:
@@ -697,11 +700,11 @@ done:
dest = H5FL_FREE(H5O_layout_t, dest);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_layout_copy() */
+} /* end H5O__layout_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_layout_size
+ * Function: H5O__layout_size
*
* Purpose: Returns the size of the raw message in bytes. If it's
* compact dataset, the data part is also included.
@@ -717,12 +720,12 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O__layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -733,11 +736,11 @@ H5O_layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi
ret_value = H5D__layout_meta_size(f, mesg, TRUE);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_layout_size() */
+} /* end H5O__layout_size() */
/*-------------------------------------------------------------------------
- * Function: H5O_layout_reset
+ * Function: H5O__layout_reset
*
* Purpose: Frees resources within a data type message, but doesn't free
* the message itself.
@@ -750,12 +753,12 @@ H5O_layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_layout_reset(void *_mesg)
+H5O__layout_reset(void *_mesg)
{
H5O_layout_t *mesg = (H5O_layout_t *)_mesg;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if(mesg) {
/* Free the compact storage buffer */
@@ -768,15 +771,16 @@ H5O_layout_reset(void *_mesg)
/* Reset the message */
mesg->type = H5D_CONTIGUOUS;
+ mesg->version = H5O_LAYOUT_VERSION_DEFAULT;
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_layout_reset() */
+} /* end H5O__layout_reset() */
/*-------------------------------------------------------------------------
- * Function: H5O_layout_free
+ * Function: H5O__layout_free
*
* Purpose: Free's the message
*
@@ -788,28 +792,25 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_layout_free(void *_mesg)
+H5O__layout_free(void *_mesg)
{
H5O_layout_t *mesg = (H5O_layout_t *) _mesg;
- herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC_NOERR
HDassert(mesg);
/* Free resources within the message */
- if(H5O_layout_reset(mesg) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free message resources")
+ H5O__layout_reset(mesg);
- mesg = H5FL_FREE(H5O_layout_t, mesg);
+ (void)H5FL_FREE(H5O_layout_t, mesg);
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_layout_free() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5O__layout_free() */
/*-------------------------------------------------------------------------
- * Function: H5O_layout_delete
+ * Function: H5O__layout_delete
*
* Purpose: Free file space referenced by message
*
@@ -821,12 +822,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg)
+H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg)
{
H5O_layout_t *mesg = (H5O_layout_t *) _mesg;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(f);
@@ -865,11 +866,11 @@ H5O_layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_layout_delete() */
+} /* end H5O__layout_delete() */
/*-------------------------------------------------------------------------
- * Function: H5O_layout_copy_file
+ * Function: H5O__layout_copy_file
*
* Purpose: Copies a message from _MESG to _DEST in file
*
@@ -883,7 +884,7 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
+H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags,
H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id)
{
@@ -893,29 +894,26 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
hbool_t copied = FALSE; /* Whether the data was copied */
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(file_src);
HDassert(layout_src);
HDassert(file_dst);
- /* Allocate space for the destination layout */
- if(NULL == (layout_dst = H5FL_MALLOC(H5O_layout_t)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed")
-
- /* Copy the "top level" information */
- *layout_dst = *layout_src;
+ /* Copy the layout information */
+ if(NULL == (layout_dst = (H5O_layout_t *)H5O__layout_copy(layout_src, NULL)))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy layout")
/* Copy the layout type specific information */
switch(layout_src->type) {
case H5D_COMPACT:
- if(layout_src->storage.u.compact.buf) {
+ if(layout_src->storage.u.compact.buf) {
/* copy compact raw data */
if(H5D__compact_copy(file_src, &layout_src->storage.u.compact, file_dst, &layout_dst->storage.u.compact, udata->src_dtype, cpy_info, dxpl_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage")
copied = TRUE;
- } /* end if */
+ } /* end if */
break;
case H5D_CONTIGUOUS:
@@ -970,11 +968,11 @@ done:
layout_dst = H5FL_FREE(H5O_layout_t, layout_dst);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_layout_copy_file() */
+} /* end H5O__layout_copy_file() */
/*-------------------------------------------------------------------------
- * Function: H5O_layout_debug
+ * Function: H5O__layout_debug
*
* Purpose: Prints debugging info for a message.
*
@@ -986,13 +984,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_layout_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg,
+H5O__layout_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg,
FILE * stream, int indent, int fwidth)
{
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
size_t u;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -1079,5 +1077,5 @@ H5O_layout_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const vo
} /* end switch */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_layout_debug() */
+} /* end H5O__layout_debug() */
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index ddcdb10..642e938 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -324,8 +324,8 @@ typedef struct H5O_obj_class_t {
hid_t (*open)(const H5G_loc_t *, hid_t, hid_t, hbool_t ); /*open an object of this class */
void *(*create)(H5F_t *, void *, H5G_loc_t *, hid_t ); /*create an object of this class */
H5O_loc_t *(*get_oloc)(hid_t ); /*get the object header location for an object */
- herr_t (*bh_info)(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info); /*get the index & heap info for an object */
- herr_t (*flush)(H5G_loc_t *loc, hid_t dxpl_id); /*flush an opened object of this class */
+ herr_t (*bh_info)(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info); /*get the index & heap info for an object */
+ herr_t (*flush)(H5G_loc_t *loc, hid_t dxpl_id); /*flush an opened object of this class */
} H5O_obj_class_t;
/* Node in skip list to map addresses from one file to another during object header copy */
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 4586adb..0d77a83 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -382,11 +382,13 @@ typedef struct H5O_efl_t {
*/
#define H5O_LAYOUT_VERSION_4 4
+/* The default version of the format. (Earlier versions had bugs) */
+#define H5O_LAYOUT_VERSION_DEFAULT H5O_LAYOUT_VERSION_3
+
/* The latest version of the format. Look through the 'encode'
* and 'size' callbacks for places to change when updating this. */
#define H5O_LAYOUT_VERSION_LATEST H5O_LAYOUT_VERSION_4
-
/* Forward declaration of structs used below */
struct H5D_layout_ops_t; /* Defined in H5Dpkg.h */
struct H5D_chunk_ops_t; /* Defined in H5Dpkg.h */
@@ -406,7 +408,7 @@ typedef struct H5O_storage_chunk_t {
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_btree_t btree; /* Information for v1 B-tree index */
} u;
} H5O_storage_chunk_t;
diff --git a/src/H5Otest.c b/src/H5Otest.c
index b5f728a..1c149e3 100644
--- a/src/H5Otest.c
+++ b/src/H5Otest.c
@@ -253,9 +253,9 @@ herr_t
H5O_num_attrs_test(hid_t oid, hsize_t *nattrs)
{
H5O_t *oh = NULL; /* Object header */
- H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */
+ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */
H5O_ainfo_t ainfo; /* Attribute information for object */
- H5O_loc_t *loc; /* Pointer to object's location */
+ H5O_loc_t *loc; /* Pointer to object's location */
hsize_t obj_nattrs; /* Number of attributes */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 0677517..afef06b 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -769,12 +769,16 @@ H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2,
HDassert(size == sizeof(H5O_layout_t));
/* Check for different layout type */
- if(layout1->type < layout2->type) HGOTO_DONE(-1)
- if(layout1->type > layout2->type) HGOTO_DONE(1)
+ if(layout1->type < layout2->type)
+ HGOTO_DONE(-1)
+ if(layout1->type > layout2->type)
+ HGOTO_DONE(1)
/* Check for different layout version */
- if(layout1->version < layout2->version) HGOTO_DONE(-1)
- if(layout1->version > layout2->version) HGOTO_DONE(1)
+ if(layout1->version < layout2->version)
+ HGOTO_DONE(-1)
+ if(layout1->version > layout2->version)
+ HGOTO_DONE(1)
/* Compare non-dataset-specific fields in layout info */
switch(layout1->type) {
@@ -787,13 +791,17 @@ H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2,
unsigned u; /* Local index variable */
/* Check the number of dimensions */
- if(layout1->u.chunk.ndims < layout2->u.chunk.ndims) HGOTO_DONE(-1)
- if(layout1->u.chunk.ndims > layout2->u.chunk.ndims) HGOTO_DONE(1)
+ if(layout1->u.chunk.ndims < layout2->u.chunk.ndims)
+ HGOTO_DONE(-1)
+ if(layout1->u.chunk.ndims > layout2->u.chunk.ndims)
+ HGOTO_DONE(1)
/* Compare the chunk dims */
for(u = 0; u < layout1->u.chunk.ndims - 1; u++) {
- if(layout1->u.chunk.dim[u] < layout2->u.chunk.dim[u]) HGOTO_DONE(-1)
- if(layout1->u.chunk.dim[u] > layout2->u.chunk.dim[u]) HGOTO_DONE(1)
+ if(layout1->u.chunk.dim[u] < layout2->u.chunk.dim[u])
+ HGOTO_DONE(-1)
+ if(layout1->u.chunk.dim[u] > layout2->u.chunk.dim[u])
+ HGOTO_DONE(1)
} /* end for */
} /* end case */
break;
@@ -2133,7 +2141,6 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
H5O_storage_virtual_ent_t *old_list = NULL; /* List pointer previously on property list */
H5O_storage_virtual_ent_t *ent = NULL; /* Convenience pointer to new VDS entry */
hbool_t retrieved_layout = FALSE; /* Whether the layout has been retrieved */
- hbool_t adding_entry = FALSE; /* Whether we are in the middle of adding an entry */
hbool_t free_list = FALSE; /* Whether to free the list of virtual entries */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2207,7 +2214,6 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
HDmemset(ent, 0, sizeof(H5O_storage_virtual_ent_t)); /* Clear before starting to set up */
if(NULL == (ent->source_dset.virtual_select = H5S_copy(vspace, FALSE, TRUE)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection")
- adding_entry = TRUE;
if(NULL == (ent->source_file_name = HDstrdup(src_file_name)))
HGOTO_ERROR(H5E_PLIST, H5E_RESOURCE, FAIL, "can't duplicate source file name")
if(NULL == (ent->source_dset_name = HDstrdup(src_dset_name)))
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 319dc77..14e1c91 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1230,7 +1230,7 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset)
/* Get value */
if(offset) {
if(H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, offset) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set offset for family file")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set offset for family file")
} /* end if */
done:
@@ -1310,7 +1310,7 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type)
/* Get value */
if(type) {
if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get type for multi driver")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get type for multi driver")
} /* end if */
done:
@@ -3016,7 +3016,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
H5_ENCODE_UNSIGNED(*pp, config->close_trace_file);
- HDmemcpy(*pp, (const uint8_t *)(config->trace_file_name), H5AC__MAX_TRACE_FILE_NAME_LEN + 1);
+ HDmemcpy(*pp, (const uint8_t *)(config->trace_file_name), (size_t)(H5AC__MAX_TRACE_FILE_NAME_LEN + 1));
*pp += H5AC__MAX_TRACE_FILE_NAME_LEN + 1;
H5_ENCODE_UNSIGNED(*pp, config->evictions_enabled);
diff --git a/src/H5Pint.c b/src/H5Pint.c
index 26431eb..69b2791 100644
--- a/src/H5Pint.c
+++ b/src/H5Pint.c
@@ -556,12 +556,12 @@ H5P_term_package(void)
/*--------------------------------------------------------------------------
NAME
- H5P_do_prop_cb1
+ H5P__do_prop_cb1
PURPOSE
Internal routine to call a property list callback routine and update
the property list accordingly.
USAGE
- herr_t H5P_do_prop_cb1(slist,prop,cb)
+ herr_t H5P__do_prop_cb1(slist,prop,cb)
H5SL_t *slist; IN/OUT: Skip list to hold changed properties
H5P_genprop_t *prop; IN: Property to call callback for
H5P_prp_cb1_t *cb; IN: Callback routine to call
@@ -577,13 +577,13 @@ H5P_term_package(void)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5P_do_prop_cb1(H5SL_t *slist, H5P_genprop_t *prop, H5P_prp_cb1_t cb)
+H5P__do_prop_cb1(H5SL_t *slist, H5P_genprop_t *prop, H5P_prp_cb1_t cb)
{
void *tmp_value = NULL; /* Temporary value buffer */
H5P_genprop_t *pcopy = NULL; /* Copy of property to insert into skip list */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(slist);
@@ -622,7 +622,7 @@ done:
H5P_free_prop(pcopy);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_do_prop_cb1() */
+} /* end H5P__do_prop_cb1() */
/*--------------------------------------------------------------------------
@@ -848,7 +848,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
/* Call property copy callback, if it exists */
if(tmp->copy) {
/* Call the callback & insert changed value into skip list (if necessary) */
- if(H5P_do_prop_cb1(new_plist->props,tmp,tmp->copy) < 0)
+ if(H5P__do_prop_cb1(new_plist->props, tmp, tmp->copy) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL,"Can't create property")
} /* end if */
@@ -1701,7 +1701,7 @@ H5P_create(H5P_genclass_t *pclass)
/* Call property creation callback, if it exists */
if(tmp->create) {
/* Call the callback & insert changed value into skip list (if necessary) */
- if(H5P_do_prop_cb1(plist->props,tmp,tmp->create) < 0)
+ if(H5P__do_prop_cb1(plist->props, tmp, tmp->create) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, NULL,"Can't create property")
} /* end if */
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 4929621..932472c 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -345,7 +345,6 @@ H5_DLL herr_t H5Pset_file_image_callbacks(hid_t fapl_id,
H5FD_file_image_callbacks_t *callbacks_ptr);
H5_DLL herr_t H5Pget_file_image_callbacks(hid_t fapl_id,
H5FD_file_image_callbacks_t *callbacks_ptr);
-
H5_DLL herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size);
H5_DLL herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size);
diff --git a/src/H5Ptest.c b/src/H5Ptest.c
index 30a98a4..8240f6a 100644
--- a/src/H5Ptest.c
+++ b/src/H5Ptest.c
@@ -165,7 +165,7 @@ H5P_reset_external_file_test(hid_t dcpl_id)
/* set external file list */
if(H5P_poke(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file list")
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index c66fd0a..bbd7e87 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -256,7 +256,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t len, void *_udata,
/* Address of the index's heap */
H5F_addr_decode(f, &image, &(table->indexes[u].heap_addr));
- /* Compute the size of a list index for this SOHM index */
+ /* Compute the size of a list index for this SOHM index */
table->indexes[u].list_size = H5SM_LIST_SIZE(f, table->indexes[u].list_max);
} /* end for */
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 28cabf0..fe013a7 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -2038,7 +2038,7 @@ H5S_hyper_serialize_helper(const H5S_hyper_span_info_t *spans,
uint8_t *pp = (*p); /* Local pointer for decoding */
hsize_t u; /* Index variable */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity checks */
HDassert(spans);
diff --git a/src/H5T.c b/src/H5T.c
index 21d6fcf..fd362eb 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -3597,25 +3597,12 @@ done:
* Programmer: Robb Matzke
* Monday, December 8, 1997
*
- * Modifications:
- * Robb Matzke, 1999-04-27
- * This function fails if the datatype state is IMMUTABLE.
- *
- * Robb Matzke, 1999-05-20
- * Closes opaque types also.
- *
- * Pedro Vicente, <pvn@ncsa.uiuc.edu> 22 Aug 2002
- * Added "ID to name" support
- *
- * Quincey Koziol, 2003-01-06
- * Moved "guts" of function to H5T__free()
- *
*-------------------------------------------------------------------------
*/
herr_t
H5T_close(H5T_t *dt)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -3629,7 +3616,8 @@ H5T_close(H5T_t *dt)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype");
dt->shared = H5FL_FREE(H5T_shared_t, dt->shared);
- } else {
+ } /* end if */
+ else {
/*
* If a named type is being closed then close the object header and
* remove from the list of open objects in the file.
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index bf4e3ca..7d3361b 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -403,7 +403,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] =
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE unsigned H5_ATTR_UNUSED
+static H5_INLINE H5_ATTR_PURE unsigned
H5VM_log2_of2(uint32_t n)
{
#ifndef NDEBUG
@@ -424,7 +424,7 @@ H5VM_log2_of2(uint32_t n)
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE hsize_t H5_ATTR_UNUSED
+static H5_INLINE H5_ATTR_CONST hsize_t
H5VM_power2up(hsize_t n)
{
hsize_t ret_value = 1; /* Return value */
diff --git a/src/H5trace.c b/src/H5trace.c
index f212bef..3b29cda 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -155,8 +155,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
} /* end if */
/* Get time for event */
- if(HDfabs(first_time.etime) < 0.0000000001F)
- /* That is == 0.0, but direct comparison between floats is bad */
+ if(H5_DBL_ABS_EQUAL(first_time.etime, H5_DOUBLE(0.0)))
H5_timer_begin(&first_time);
if(H5_debug_g.ttimes)
H5_timer_begin(&event_time);