summaryrefslogtreecommitdiffstats
path: root/src/H5Oshared.h
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2011-10-20 22:20:00 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2011-10-20 22:20:00 (GMT)
commitc36a79fd91206a67cc159e6881cb1b9fce2d2b83 (patch)
tree3733581c711178e6cd0f23ee0fdfa9959e1896f5 /src/H5Oshared.h
parentfd619754ac6c01025528e878497aae032b9a5b78 (diff)
downloadhdf5-c36a79fd91206a67cc159e6881cb1b9fce2d2b83.zip
hdf5-c36a79fd91206a67cc159e6881cb1b9fce2d2b83.tar.gz
hdf5-c36a79fd91206a67cc159e6881cb1b9fce2d2b83.tar.bz2
[svn-r21631] Port revisions 21629 and 21630 to 1.8 branch
Purpose: Update fix committed in r21556 Description: An old patch was mistakenly committed in r21556. Replaced this fix with the latest. Tested: jam, koala, heiwa (h5committest)
Diffstat (limited to 'src/H5Oshared.h')
-rw-r--r--src/H5Oshared.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/H5Oshared.h b/src/H5Oshared.h
index 569889d..70b54dc 100644
--- a/src/H5Oshared.h
+++ b/src/H5Oshared.h
@@ -385,8 +385,9 @@ static H5_inline herr_t
H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src,
H5O_loc_t *oloc_dst, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info)
{
- const H5O_shared_t *shared_dst = (const H5O_shared_t *)mesg_dst; /* Alias to shared info in native source */
- herr_t ret_value = SUCCEED; /* Return value */
+ const H5O_shared_t *shared_src = (const H5O_shared_t *)mesg_src; /* Alias to shared info in native source */
+ H5O_shared_t *shared_dst = (H5O_shared_t *)mesg_dst; /* Alias to shared info in native destination */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5O_SHARED_POST_COPY_FILE)
@@ -394,6 +395,7 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src,
HDassert(oloc_dst->file);
HDassert(mesg_src);
HDassert(mesg_dst);
+ HDassert(cpy_info);
#ifndef H5O_SHARED_TYPE
#error "Need to define H5O_SHARED_TYPE macro!"
@@ -408,14 +410,17 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src,
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy native message to another file")
#endif /* H5O_SHARED_POST_COPY_FILE_REAL */
- /* Update only shared message after the post copy. Do not update committed
- * messages as they have already been dealt with in the copy pass.
- * (Move copy of target of committed messages to post copy? -NAF) */
- if(shared_dst->type == H5O_SHARE_TYPE_SOHM
- || shared_dst->type == H5O_SHARE_TYPE_HERE) {
- if(H5O_shared_post_copy_file(oloc_dst->file, dxpl_id, cpy_info->oh_dst, mesg_dst) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to fix shared message in post copy")
- } /* end if */
+ /* Update shared message after the post copy - will short circuit in
+ * production if the DEFER pass determined it will not be shared; debug mode
+ * verifies that it is indeed the case */
+ if(H5O_shared_post_copy_file(oloc_dst->file, H5O_SHARED_TYPE,
+ shared_src, shared_dst, dxpl_id, cpy_info) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to fix shared message in post copy")
+
+ /* Make sure that if the the source or destination is committed, both are
+ * committed */
+ HDassert((shared_src->type == H5O_SHARE_TYPE_COMMITTED)
+ == (shared_dst->type == H5O_SHARE_TYPE_COMMITTED));
done:
FUNC_LEAVE_NOAPI(ret_value)