summaryrefslogtreecommitdiffstats
path: root/src/H5Dcompact.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-06-11 00:40:19 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-06-11 00:40:19 (GMT)
commit980d5b4266133490192ceb10ea13e320532c6f03 (patch)
tree2ef40c1ef7ae5eacb5bcea67b0c5dac4b313f7c4 /src/H5Dcompact.c
parent7a25041caf6dced2ad2480bb39eb2bc98721e51f (diff)
downloadhdf5-980d5b4266133490192ceb10ea13e320532c6f03.zip
hdf5-980d5b4266133490192ceb10ea13e320532c6f03.tar.gz
hdf5-980d5b4266133490192ceb10ea13e320532c6f03.tar.bz2
Fix for HDFFV-7853 H5Ocopy doesn't work with open identifiers
Changes made so that raw data for dataset objects are copied from cached info when possible instead of flushing objects to file and read them back in again.
Diffstat (limited to 'src/H5Dcompact.c')
-rw-r--r--src/H5Dcompact.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index 99a25b6..041d28f 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -420,7 +420,7 @@ H5D__compact_dest(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst,
+H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_dst,
H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info,
hid_t dxpl_id)
{
@@ -431,6 +431,8 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst
void *bkg = NULL; /* Temporary buffer for copying data */
void *reclaim_buf = NULL; /* Buffer for reclaiming data */
hid_t buf_sid = -1; /* ID for buffer dataspace */
+ H5D_shared_t *shared_fo = cpy_info->shared_fo; /* Pointer to the shared struct for dataset object */
+ H5O_storage_compact_t *storage_src = _storage_src; /* Pointer to storage_src */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -443,6 +445,10 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst
HDassert(storage_dst->buf);
HDassert(dt_src);
+ /* If the dataset is open in the file, point to "layout" in the shared struct */
+ if(shared_fo != NULL)
+ storage_src = &(shared_fo->layout.storage.u.compact);
+
/* Create datatype ID for src datatype, so it gets freed */
if((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register source file datatype")