summaryrefslogtreecommitdiffstats
path: root/src/H5Ocopy.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/H5Ocopy.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/H5Ocopy.c')
-rw-r--r--src/H5Ocopy.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 597af63..aa2a9e0 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -347,36 +347,8 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
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 */
- void *obj_ptr = NULL; /* Object pointer */
- hid_t tmp_id = -1; /* Object ID */
-
- tmp_loc.oloc = &tmp_oloc;
- tmp_loc.path = &tmp_path;
- tmp_oloc.file = oloc_src->file;
- tmp_oloc.addr = oloc_src->addr;
- tmp_oloc.holding_file = FALSE;
- H5G_name_reset(tmp_loc.path);
-
- /* Get a temporary ID */
- if((tmp_id = obj_class->open(&tmp_loc, H5P_DEFAULT, dxpl_id, FALSE)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to open object")
-
- /* Get object pointer */
- obj_ptr = H5I_object(tmp_id);
-
- /* Flush the object */
- if(obj_class->flush && obj_class->flush(obj_ptr, dxpl_id) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object")
-
- /* Release the temporary ID */
- if(tmp_id != -1 && H5I_dec_app_ref(tmp_id))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close temporary ID")
- } /* end if */
+ /* Set the pointer to the shared struct for the object if opened in the file */
+ cpy_info->shared_fo = H5FO_opened(oloc_src->file, oloc_src->addr);
/* Get source object header */
if(NULL == (oh_src = H5O_protect(oloc_src, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE)))