summaryrefslogtreecommitdiffstats
path: root/src/H5Oshared.h
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2011-10-20 22:01:21 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2011-10-20 22:01:21 (GMT)
commit72702153d2e3fe35aa526173f93f5510eb4b65fd (patch)
tree70a4a866edab23ef0c5ec1c6adc57922653e0219 /src/H5Oshared.h
parentcc6ce34d23ab42bcc0df38beb94ad5683f604aaa (diff)
downloadhdf5-72702153d2e3fe35aa526173f93f5510eb4b65fd.zip
hdf5-72702153d2e3fe35aa526173f93f5510eb4b65fd.tar.gz
hdf5-72702153d2e3fe35aa526173f93f5510eb4b65fd.tar.bz2
[svn-r21629] 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)