summaryrefslogtreecommitdiffstats
path: root/src/H5Ocopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Ocopy.c')
-rw-r--r--src/H5Ocopy.c387
1 files changed, 202 insertions, 185 deletions
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index ddf375c..e6865f1 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -5,12 +5,10 @@
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------
@@ -36,6 +34,7 @@
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Aprivate.h" /* Attributes */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free lists */
#include "H5Iprivate.h" /* IDs */
@@ -68,7 +67,6 @@ typedef struct H5O_copy_search_comm_dt_ud_t {
H5SL_t *dst_dt_list; /* Skip list of committed datatypes */
H5G_loc_t *dst_root_loc; /* Starting location for iteration */
H5O_loc_t obj_oloc; /* Object location (for attribute iteration callback) */
- hid_t dxpl_id; /* Dataset transfer property list id */
} H5O_copy_search_comm_dt_ud_t;
@@ -81,23 +79,25 @@ typedef struct H5O_copy_search_comm_dt_ud_t {
/* Local Prototypes */
/********************/
-static herr_t H5O_copy_free_addrmap_cb(void *item, void *key, void *op_data);
-static herr_t H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
- hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata);
-static herr_t H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
- hid_t dxpl_id, hid_t ocpypl_id);
-static herr_t H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc,
- const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id);
-static herr_t H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id,
- H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info);
-static herr_t H5O_copy_free_comm_dt_cb(void *item, void *key, void *op_data);
-static int H5O_copy_comm_dt_cmp(const void *dt1, const void *dt2);
-static herr_t H5O_copy_search_comm_dt_cb(hid_t group, const char *name,
+static herr_t H5O__copy(const H5G_loc_t *loc, const char *src_name,
+ H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id);
+static herr_t H5O__copy_free_addrmap_cb(void *item, void *key, void *op_data);
+static herr_t H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
+ H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata);
+static herr_t H5O__copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
+ hid_t ocpypl_id, hid_t lcpl_id);
+static herr_t H5O__copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc,
+ const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id);
+static herr_t H5O__copy_obj_by_ref(H5O_loc_t *src_oloc, H5O_loc_t *dst_oloc,
+ H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info);
+static herr_t H5O__copy_free_comm_dt_cb(void *item, void *key, void *op_data);
+static int H5O__copy_comm_dt_cmp(const void *dt1, const void *dt2);
+static herr_t H5O__copy_search_comm_dt_cb(hid_t group, const char *name,
const H5L_info_t *linfo, void *udata);
-static htri_t H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src,
- H5O_loc_t *oloc_dst/*in, out*/, hid_t dxpl_id, H5O_copy_t *cpy_info);
-static herr_t H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src,
- H5O_loc_t *oloc_dst, hid_t dxpl_id, H5O_copy_t *cpy_info);
+static htri_t H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src,
+ H5O_loc_t *oloc_dst/*in, out*/, H5O_copy_t *cpy_info);
+static herr_t H5O__copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src,
+ H5O_loc_t *oloc_dst, H5O_copy_t *cpy_info);
/*********************/
@@ -204,19 +204,10 @@ H5FL_DEFINE(haddr_t);
*/
herr_t
H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
- const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id)
+ const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id)
{
H5G_loc_t loc; /* Source group group location */
- H5G_loc_t src_loc; /* Source object group location */
H5G_loc_t dst_loc; /* Destination group location */
-
- /* for opening the destination object */
- H5G_name_t src_path; /* Opened source object hier. path */
- H5O_loc_t src_oloc; /* Opened source object object location */
- htri_t dst_exists; /* Does destination name exist already? */
- hbool_t loc_found = FALSE; /* Location at 'name' found */
- hbool_t obj_open = FALSE; /* Entry at 'name' found */
- hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -233,8 +224,57 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
if(!dst_name || !*dst_name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified")
- /* check if destination name already exists */
- if((dst_exists = H5L_exists_tolerant(&dst_loc, dst_name, H5P_DEFAULT, dxpl_id)) < 0)
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(src_loc_id) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+
+ /* Call internal routine to copy object */
+ if(H5O__copy(&loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Ocopy() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5O__copy
+ *
+ * Purpose: Internal routine to copy an object
+ *
+ * Note: This routine is needed so that there's a non-API routine
+ * that can set up VOL / SWMR info (which need a DXPL).
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Quincey Koziol
+ * December 29, 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc,
+ const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id)
+{
+ H5G_loc_t src_loc; /* Source object group location */
+ H5G_name_t src_path; /* Opened source object hier. path */
+ H5O_loc_t src_oloc; /* Opened source object object location */
+ htri_t dst_exists; /* Does destination name exist already? */
+ hbool_t loc_found = FALSE; /* Location at 'name' found */
+ hbool_t obj_open = FALSE; /* Entry at 'name' found */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC_VOL
+
+ /* Check arguments */
+ HDassert(loc);
+ HDassert(src_name && *src_name);
+ HDassert(dst_loc);
+ HDassert(dst_name && *dst_name);
+
+ /* Check if destination name already exists */
+ if((dst_exists = H5L_exists_tolerant(dst_loc, dst_name)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check if destination name exists")
if(TRUE == dst_exists)
HGOTO_ERROR(H5E_OHDR, H5E_EXISTS, FAIL, "destination object already exists")
@@ -245,7 +285,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
H5G_loc_reset(&src_loc);
/* Find the source object to copy */
- if(H5G_loc_find(&loc, src_name, &src_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0)
+ if(H5G_loc_find(loc, src_name, &src_loc/*out*/) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "source object not found")
loc_found = TRUE;
@@ -256,7 +296,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
/* Get correct property lists */
if(H5P_DEFAULT == lcpl_id) {
- if((lcpl_id = H5L_get_default_lcpl()) < 0)
+ if((lcpl_id = H5P_get_default(H5P_CLS_LCRT)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to get default lcpl")
} /* end if */
else
@@ -264,14 +304,16 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list")
/* Get object copy property list */
- if(H5P_DEFAULT == ocpypl_id)
- ocpypl_id = H5P_OBJECT_COPY_DEFAULT;
+ if(H5P_DEFAULT == ocpypl_id) {
+ if((ocpypl_id = H5P_get_default(H5P_CLS_OCPY)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to get default ocpypl")
+ } /* end if */
else
if(TRUE != H5P_isa_class(ocpypl_id, H5P_OBJECT_COPY))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not object copy property list")
/* Do the actual copying of the object */
- if(H5O_copy_obj(&src_loc, &dst_loc, dst_name, ocpypl_id, lcpl_id, dxpl_id) < 0)
+ if(H5O__copy_obj(&src_loc, dst_loc, dst_name, ocpypl_id, lcpl_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
done:
@@ -280,12 +322,12 @@ done:
if(obj_open && H5O_close(&src_oloc, NULL) < 0)
HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header")
- FUNC_LEAVE_API(ret_value)
-} /* end H5Ocopy() */
+ FUNC_LEAVE_NOAPI_VOL(ret_value)
+} /* end H5O__copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_copy_header_real
+ * Function: H5O__copy_header_real
*
* Purpose: Copy header object from one location to another using
* pre-copy, copy, and post-copy callbacks for each message
@@ -302,19 +344,11 @@ done:
* Programmer: Peter Cao
* May 30, 2005
*
- * Modifications:
- * Vailin Choi; Feb 2012
- * Bug fix for HDFFV-7853
- * When the object is opened, call the object's flush class action
- * to ensure that cached data is flushed so that H5Ocopy will get
- * the correct data.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
- hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type,
- void **udata /*out*/)
+H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
+ H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata /*out*/)
{
H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */
H5O_t *oh_src = NULL; /* Object header for source object */
@@ -337,7 +371,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
size_t msghdr_size;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oloc_src->addr, FAIL)
+ FUNC_ENTER_STATIC_TAG(oloc_src->addr)
HDassert(oloc_src);
HDassert(oloc_src->file);
@@ -346,42 +380,14 @@ 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(NULL == (obj_class = H5O_obj_class(oloc_src, dxpl_id)))
+ if(NULL == (obj_class = H5O__obj_class(oloc_src)))
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)))
+ if(NULL == (oh_src = H5O_protect(oloc_src, H5AC__READ_ONLY_FLAG, FALSE)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header")
/* Retrieve user data for particular type of object to copy */
@@ -406,7 +412,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
else
/* Search for a matching committed datatype, building the list if
* necessary */
- if((merge = H5O_copy_search_comm_dt(oloc_src->file, oh_src, oloc_dst, dxpl_id, cpy_info)) < 0)
+ if((merge = H5O__copy_search_comm_dt(oloc_src->file, oh_src, oloc_dst, cpy_info)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't search for matching committed datatype")
if(merge) {
@@ -445,6 +451,11 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
/* Initialize header information */
oh_dst->version = oh_src->version;
+
+ /* Version bounds check for destination object header */
+ if(oh_dst->version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(oloc_dst->file)])
+ HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "destination object header version out of bounds")
+
oh_dst->flags = oh_src->flags;
oh_dst->link_msgs_seen = oh_src->link_msgs_seen;
oh_dst->attr_msgs_seen = oh_src->attr_msgs_seen;
@@ -518,7 +529,13 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
if(copy_type->pre_copy_file) {
/* Decode the message if necessary. */
- H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL)
+ H5O_LOAD_NATIVE(oloc_src->file, 0, oh_src, mesg_src, FAIL)
+
+ /* Save destination file pointer in cpy_info so that it can be used
+ in the pre_copy_file callback to obtain the destination file's
+ high bound. The high bound is used to index into the corresponding
+ message's array of versions for doing version bounds check. */
+ cpy_info->file_dst = oloc_dst->file;
/* Perform "pre copy" operation on message */
if((copy_type->pre_copy_file)(oloc_src->file, mesg_src->native,
@@ -590,7 +607,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
unsigned mesg_flags; /* Message flags */
/* Decode the message if necessary. */
- H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL)
+ H5O_LOAD_NATIVE(oloc_src->file, 0, oh_src, mesg_src, FAIL)
/* Get destination message flags, and unset shared and shareable
* flags. mesg_dst->flags will contain the original flags for now.
@@ -600,9 +617,9 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
/* Copy the source message */
recompute_size = FALSE;
- if((mesg_dst->native = H5O_msg_copy_file(copy_type, oloc_src->file,
+ if(NULL == (mesg_dst->native = H5O__msg_copy_file(copy_type, oloc_src->file,
mesg_src->native, oloc_dst->file, &recompute_size,
- &mesg_flags, cpy_info, cpy_udata, dxpl_id)) == NULL)
+ &mesg_flags, cpy_info, cpy_udata)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object header message")
/* Check if the sharing state changed, and recompute the size if so
@@ -683,7 +700,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
dst_oh_size += (uint64_t)H5O_SIZEOF_HDR(oh_dst);
/* Allocate space for chunk in destination file */
- if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, dxpl_id, (hsize_t)dst_oh_size)))
+ if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, (hsize_t)dst_oh_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header")
addr_new = oh_dst->chunk[0].addr;
@@ -786,7 +803,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
* the copied datatype into the list of committed datatypes in the target file.
*/
if(cpy_info->merge_comm_dt && obj_class->type == H5O_TYPE_NAMED_DATATYPE)
- if(H5O_copy_insert_comm_dt(oloc_src->file, oh_src, oloc_dst, dxpl_id, cpy_info) < 0)
+ if(H5O__copy_insert_comm_dt(oloc_src->file, oh_src, oloc_dst, cpy_info) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't insert committed datatype into destination list")
/* Allocate space for the address mapping of the object copied */
@@ -851,7 +868,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
/* Perform "post copy" operation on message */
if((copy_type->post_copy_file)(oloc_src, mesg_src->native, oloc_dst,
- mesg_dst->native, &mesg_flags, dxpl_id, cpy_info) < 0)
+ mesg_dst->native, &mesg_flags, cpy_info) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to perform 'post copy' operation on message")
/* Verify that the flags did not change */
@@ -873,16 +890,16 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to re-tag metadata entries")
/* Set metadata tag for destination object's object header */
- H5_BEGIN_TAG(dxpl_id, oloc_dst->addr, FAIL);
+ H5_BEGIN_TAG(oloc_dst->addr);
/* Insert destination object header in cache */
- if(H5AC_insert_entry(oloc_dst->file, dxpl_id, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_insert_entry(oloc_dst->file, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header")
oh_dst = NULL;
inserted = TRUE;
/* Reset metadat tag */
- H5_END_TAG(FAIL);
+ H5_END_TAG
/* Set obj_type and udata, if requested */
if(obj_type) {
@@ -897,19 +914,26 @@ done:
H5MM_free(deleted);
/* Release pointer to source object header and its derived objects */
- if(oh_src && H5O_unprotect(oloc_src, dxpl_id, oh_src, H5AC__NO_FLAGS_SET) < 0)
+ if(oh_src && H5O_unprotect(oloc_src, oh_src, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header")
/* Free destination object header on failure */
- if(ret_value < 0 && oh_dst && !inserted) {
- if(H5O__free(oh_dst) < 0)
- HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
- if(H5O_loc_reset(oloc_dst) < 0)
- HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
- } /* end if */
+ if(ret_value < 0) {
+ if(oh_dst && !inserted) {
+ if(H5O__free(oh_dst) < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
+ if(H5O_loc_reset(oloc_dst) < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data")
+ } /* end if */
+
+ if(addr_map == NULL && cpy_udata) {
+ if(obj_class && obj_class->free_copy_file_udata)
+ obj_class->free_copy_file_udata(cpy_udata);
+ } /* end if */
+ }
- FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
-} /* end H5O_copy_header_real() */
+ FUNC_LEAVE_NOAPI_TAG(ret_value)
+} /* end H5O__copy_header_real() */
/*-------------------------------------------------------------------------
@@ -927,8 +951,8 @@ done:
*/
herr_t
H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
- hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth,
- H5O_type_t *obj_type, void **udata /*out*/)
+ H5O_copy_t *cpy_info, hbool_t inc_depth, H5O_type_t *obj_type,
+ void **udata /*out*/)
{
H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */
H5_obj_t src_obj_pos; /* Position of source object */
@@ -962,8 +986,7 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
cpy_info->curr_depth++;
/* Copy object referred to */
- if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, cpy_info, obj_type,
- udata) < 0)
+ if(H5O__copy_header_real(oloc_src, oloc_dst, cpy_info, obj_type, udata) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
/* Check for incrementing the depth of copy */
@@ -1002,7 +1025,7 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
/* Increment destination object's link count, if allowed */
if(inc_link)
- if(H5O_link(oloc_dst, 1, dxpl_id) < 0)
+ if(H5O_link(oloc_dst, 1) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to increment object link count")
done:
@@ -1012,11 +1035,11 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5O_copy_free_addrmap_cb
+ H5O__copy_free_addrmap_cb
PURPOSE
Internal routine to free address maps from the skip list for copying objects
USAGE
- herr_t H5O_copy_free_addrmap_cb(item, key, op_data)
+ herr_t H5O__copy_free_addrmap_cb(item, key, op_data)
void *item; IN/OUT: Pointer to addr
void *key; IN/OUT: (unused)
void *op_data; IN: (unused)
@@ -1030,11 +1053,11 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data)
+H5O__copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data)
{
H5O_addr_map_t *item = (H5O_addr_map_t *)_item;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(item);
@@ -1049,11 +1072,11 @@ H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNU
item = H5FL_FREE(H5O_addr_map_t, item);
FUNC_LEAVE_NOAPI(0)
-} /* H5O_copy_free_addrmap_cb() */
+} /* H5O__copy_free_addrmap_cb() */
/*-------------------------------------------------------------------------
- * Function: H5O_copy_header
+ * Function: H5O__copy_header
*
* Purpose: copy header object from one location to another.
*
@@ -1065,8 +1088,8 @@ H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNU
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
- hid_t dxpl_id, hid_t ocpypl_id)
+H5O__copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
+ hid_t ocpypl_id, hid_t lcpl_id)
{
H5O_copy_t cpy_info; /* Information for copying object */
H5P_genplist_t *ocpy_plist; /* Object copy property list created */
@@ -1075,7 +1098,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
unsigned cpy_option = 0; /* Copy options */
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(oloc_src);
@@ -1130,26 +1153,29 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
cpy_info.mcdt_cb = cb_info.func;
cpy_info.mcdt_ud = cb_info.user_data;
+ /* Add property lists needed by callbacks */
+ cpy_info.lcpl_id = lcpl_id;
+
/* Create a skip list to keep track of which objects are copied */
if(NULL == (cpy_info.map_list = H5SL_create(H5SL_TYPE_OBJ, NULL)))
HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list")
/* copy the object from the source file to the destination file */
- if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL) < 0)
+ if(H5O__copy_header_real(oloc_src, oloc_dst, &cpy_info, NULL, NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
done:
if(cpy_info.map_list)
- H5SL_destroy(cpy_info.map_list, H5O_copy_free_addrmap_cb, NULL);
+ H5SL_destroy(cpy_info.map_list, H5O__copy_free_addrmap_cb, NULL);
if(cpy_info.dst_dt_list)
- H5SL_destroy(cpy_info.dst_dt_list, H5O_copy_free_comm_dt_cb, NULL);
+ H5SL_destroy(cpy_info.dst_dt_list, H5O__copy_free_comm_dt_cb, NULL);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_copy_header() */
+} /* end H5O__copy_header() */
/*-------------------------------------------------------------------------
- * Function: H5O_copy_obj
+ * Function: H5O__copy_obj
*
* Purpose: Copy an object to destination location
*
@@ -1161,8 +1187,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name,
- hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id)
+H5O__copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name,
+ hid_t ocpypl_id, hid_t lcpl_id)
{
H5G_name_t new_path; /* Copied object group hier. path */
H5O_loc_t new_oloc; /* Copied object object location */
@@ -1171,7 +1197,7 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name,
hbool_t entry_inserted = FALSE; /* Flag to indicate that the new entry was inserted into a group */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
HDassert(src_loc);
HDassert(src_loc->oloc->file);
@@ -1186,12 +1212,12 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name,
new_oloc.file = dst_loc->oloc->file;
/* Make a copy of the destination file, in case the original is changed by
- * H5O_copy_header. If and when oloc's point to the shared file struct,
+ * H5O__copy_header. If and when oloc's point to the shared file struct,
* this will no longer be necessary, so this code can be removed. */
cached_dst_file = dst_loc->oloc->file;
/* Copy the object from the source file to the destination file */
- if(H5O_copy_header(src_loc->oloc, &new_oloc, dxpl_id, ocpypl_id) < 0)
+ if(H5O__copy_header(src_loc->oloc, &new_oloc, ocpypl_id, lcpl_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
/* Patch dst_loc. Again, this can be removed once oloc's point to shared
@@ -1199,7 +1225,7 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name,
dst_loc->oloc->file = cached_dst_file;
/* Insert the new object in the destination file's group */
- if(H5L_link(dst_loc, dst_name, &new_loc, lcpl_id, H5P_DEFAULT, dxpl_id) < 0)
+ if(H5L_link(dst_loc, dst_name, &new_loc, lcpl_id) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to insert link")
entry_inserted = TRUE;
@@ -1209,11 +1235,11 @@ done:
H5G_loc_free(&new_loc);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_copy_obj() */
+} /* end H5O__copy_obj() */
/*-------------------------------------------------------------------------
- * Function: H5O_copy_obj_by_ref
+ * Function: H5O__copy_obj_by_ref
*
* Purpose: Copy the object pointed by _src_ref.
*
@@ -1225,19 +1251,18 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc,
+H5O__copy_obj_by_ref(H5O_loc_t *src_oloc, H5O_loc_t *dst_oloc,
H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
HDassert(src_oloc);
HDassert(dst_oloc);
/* Perform the copy, or look up existing copy */
- if((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, cpy_info,
- FALSE, NULL, NULL)) < 0)
+ if((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, cpy_info, FALSE, NULL, NULL)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
/* Check if a new valid object is copied to the destination */
@@ -1263,7 +1288,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc,
* pass the obj_type and udata fields returned by H5O_copy_header_map.
* This could be changed in the future to slightly improve performance
* --NAF */
- if(H5L_link(dst_root_loc, tmp_obj_name, &new_loc, H5P_DEFAULT, H5P_DEFAULT, dxpl_id) < 0)
+ if(H5L_link(dst_root_loc, tmp_obj_name, &new_loc, cpy_info->lcpl_id) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to insert link")
H5G_loc_free(&new_loc);
@@ -1271,7 +1296,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_copy_obj_by_ref() */
+} /* end H5O__copy_obj_by_ref() */
/*-------------------------------------------------------------------------
@@ -1287,9 +1312,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
- H5F_t *file_dst, void *_dst_ref, size_t ref_count, H5R_type_t ref_type,
- H5O_copy_t *cpy_info)
+H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, H5F_t *file_dst,
+ void *_dst_ref, size_t ref_count, H5R_type_t ref_type, H5O_copy_t *cpy_info)
{
H5O_loc_t dst_oloc; /* Copied object object location */
H5O_loc_t src_oloc; /* Temporary object location for source object */
@@ -1335,7 +1359,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
/* Attempt to copy object from source to destination file */
if(src_oloc.addr != (haddr_t)0) {
- if(H5O_copy_obj_by_ref(&src_oloc, dxpl_id, &dst_oloc, &dst_root_loc, cpy_info) < 0)
+ if(H5O__copy_obj_by_ref(&src_oloc, &dst_oloc, &dst_root_loc, cpy_info) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
} /* end if */
else
@@ -1364,7 +1388,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
if(hobjid.addr != (haddr_t)0) {
/* Get the dataset region from the heap (allocate inside routine) */
- if((buf = (uint8_t *)H5HG_read(src_oloc.file, dxpl_id, &hobjid, NULL, &buf_size)) == NULL)
+ if((buf = (uint8_t *)H5HG_read(src_oloc.file, &hobjid, NULL, &buf_size)) == NULL)
HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information")
/* Get the object oid for the dataset */
@@ -1373,7 +1397,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
dst_oloc.addr = HADDR_UNDEF;
/* copy the object pointed by the ref to the destination */
- if(H5O_copy_obj_by_ref(&src_oloc, dxpl_id, &dst_oloc, &dst_root_loc, cpy_info) < 0) {
+ if(H5O__copy_obj_by_ref(&src_oloc, &dst_oloc, &dst_root_loc, cpy_info) < 0) {
H5MM_xfree(buf);
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
} /* end if */
@@ -1383,7 +1407,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
H5F_addr_encode(dst_oloc.file, &p, dst_oloc.addr);
/* Save the serialized buffer to the destination */
- if(H5HG_insert(dst_oloc.file, dxpl_id, buf_size, buf, &hobjid) < 0) {
+ if(H5HG_insert(dst_oloc.file, buf_size, buf, &hobjid) < 0) {
H5MM_xfree(buf);
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "Unable to write dataset region information")
} /* end if */
@@ -1410,7 +1434,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O_copy_free_comm_dt_cb
+ * Function: H5O__copy_free_comm_dt_cb
*
* Purpose: Frees the merge committed dt skip list key and object.
*
@@ -1422,12 +1446,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data)
+H5O__copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *_op_data)
{
haddr_t *addr = (haddr_t *)item;
H5O_copy_search_comm_dt_key_t *key = (H5O_copy_search_comm_dt_key_t *)_key;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(addr);
HDassert(key);
@@ -1438,11 +1462,11 @@ H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data)
addr = H5FL_FREE(haddr_t, addr);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_copy_free_comm_dt_cb */
+} /* end H5O__copy_free_comm_dt_cb */
/*-------------------------------------------------------------------------
- * Function: H5O_copy_comm_dt_cmp
+ * Function: H5O__copy_comm_dt_cmp
*
* Purpose: Skiplist callback used to compare 2 keys for the merge
* committed dt list. Mostly a wrapper for H5T_cmp.
@@ -1457,13 +1481,13 @@ H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data)
*-------------------------------------------------------------------------
*/
static int
-H5O_copy_comm_dt_cmp(const void *_key1, const void *_key2)
+H5O__copy_comm_dt_cmp(const void *_key1, const void *_key2)
{
const H5O_copy_search_comm_dt_key_t *key1 = (const H5O_copy_search_comm_dt_key_t *)_key1;
const H5O_copy_search_comm_dt_key_t *key2 = (const H5O_copy_search_comm_dt_key_t *)_key2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check fileno. It is unlikely to be different so check if they are equal
* first so only one comparison needs to be made. */
@@ -1478,7 +1502,7 @@ H5O_copy_comm_dt_cmp(const void *_key1, const void *_key2)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_copy_comm_dt_cmp */
+} /* end H5O__copy_comm_dt_cmp */
/*-------------------------------------------------------------------------
@@ -1576,10 +1600,6 @@ done:
* Programmer: Neil Fortner
* Nov 3 2011
*
- * Modifications:
- * Vailin Choi; August 2012
- * Use H5O_obj_class to get object type instead of
- * H5O_get_info(...TRUE....) saving time in traversing metadata.
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1602,7 +1622,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc,
HDassert(udata->dst_root_loc);
/* Get pointer to object class for this object */
- if((obj_class = H5O_obj_class(obj_oloc, udata->dxpl_id)) == NULL)
+ if((obj_class = H5O__obj_class(obj_oloc)) == NULL)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type")
/* Check if the object is a datatype, a dataset using a committed
@@ -1613,7 +1633,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Read the destination datatype */
- if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL, udata->dxpl_id)))
+ if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message")
/* Get destination object fileno */
@@ -1638,7 +1658,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Read the destination datatype */
- if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL, udata->dxpl_id)))
+ if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message")
/* Check if the datatype is committed and search the skip list if so
@@ -1666,8 +1686,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc,
attr_op.u.lib_op = H5O_copy_search_comm_dt_attr_cb;
udata->obj_oloc.file = obj_oloc->file;
udata->obj_oloc.addr = obj_oloc->addr;
- if(H5O_attr_iterate_real((hid_t)-1, obj_oloc, udata->dxpl_id, H5_INDEX_NAME,
- H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, udata) < 0)
+ if(H5O_attr_iterate_real((hid_t)-1, obj_oloc, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, udata) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "error iterating over attributes");
done:
@@ -1689,7 +1708,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O_copy_search_comm_dt_cb
+ * Function: H5O__copy_search_comm_dt_cb
*
* Purpose: H5G_visit callback to add committed datatypes to the merge
* committed dt skiplist. Mostly a wrapper for
@@ -1703,7 +1722,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name,
+H5O__copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name,
const H5L_info_t *linfo, void *_udata)
{
H5O_copy_search_comm_dt_ud_t *udata = (H5O_copy_search_comm_dt_ud_t *)_udata; /* Skip list of dtypes in dest file */
@@ -1713,7 +1732,7 @@ H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name,
hbool_t obj_found = FALSE; /* Object at 'name' found */
herr_t ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(name);
@@ -1730,7 +1749,7 @@ H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name,
H5G_loc_reset(&obj_loc);
/* Find the object */
- if(H5G_loc_find(udata->dst_root_loc, name, &obj_loc/*out*/, H5P_LINK_ACCESS_DEFAULT, udata->dxpl_id) < 0)
+ if(H5G_loc_find(udata->dst_root_loc, name, &obj_loc/*out*/) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found")
obj_found = TRUE;
@@ -1745,11 +1764,11 @@ done:
HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_copy_search_comm_dt_cb */
+} /* end H5O__copy_search_comm_dt_cb */
/*-------------------------------------------------------------------------
- * Function: H5O_copy_search_comm_dt
+ * Function: H5O__copy_search_comm_dt
*
* Purpose: Checks if the committed datatype present in oh_src matches any
* in the destination file, building the destination file
@@ -1766,8 +1785,8 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src,
- H5O_loc_t *oloc_dst/*in, out*/, hid_t dxpl_id, H5O_copy_t *cpy_info)
+H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src,
+ H5O_loc_t *oloc_dst/*in, out*/, H5O_copy_t *cpy_info)
{
H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */
haddr_t *dst_addr; /* Destination datatype address */
@@ -1775,7 +1794,7 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src,
H5O_copy_search_comm_dt_ud_t udata; /* Group iteration user data */
herr_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(oh_src);
@@ -1789,7 +1808,7 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Read the source datatype */
- if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, dxpl_id, oh_src, H5O_DTYPE_ID, NULL)))
+ if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, oh_src, H5O_DTYPE_ID, NULL)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message")
/* Get destination object fileno */
@@ -1798,7 +1817,7 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src,
/* Check if the destination dtype list exists, create it if it does not */
if(!cpy_info->dst_dt_list) {
/* Create the skip list */
- if(NULL == (cpy_info->dst_dt_list = H5SL_create(H5SL_TYPE_GENERIC, H5O_copy_comm_dt_cmp)))
+ if(NULL == (cpy_info->dst_dt_list = H5SL_create(H5SL_TYPE_GENERIC, H5O__copy_comm_dt_cmp)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create skip list for committed datatypes")
/* Add suggested types to list, if they are present */
@@ -1824,12 +1843,11 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src,
udata.dst_root_loc = &dst_root_loc;
udata.obj_oloc.file = NULL;
udata.obj_oloc.addr = HADDR_UNDEF;
- udata.dxpl_id = dxpl_id;
/* Walk through the list of datatype suggestions */
while(suggestion) {
/* Find the object */
- if(H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc/*out*/, H5P_LINK_ACCESS_DEFAULT, dxpl_id) < 0)
+ if(H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc/*out*/) < 0)
/* Ignore errors - i.e. suggestions not present in
* destination file */
H5E_clear_stack(NULL);
@@ -1889,11 +1907,10 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src,
udata.dst_root_loc = &dst_root_loc;
udata.obj_oloc.file = NULL;
udata.obj_oloc.addr = HADDR_UNDEF;
- udata.dxpl_id = dxpl_id;
/* Traverse the destination file, adding committed datatypes to the skip
* list */
- if(H5G_visit(H5F_FILE_ID(oloc_dst->file), "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5O_copy_search_comm_dt_cb, &udata, H5P_LINK_ACCESS_DEFAULT, dxpl_id) < 0)
+ if(H5G_visit(H5F_FILE_ID(oloc_dst->file), "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5O__copy_search_comm_dt_cb, &udata) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed")
cpy_info->dst_dt_list_complete = TRUE;
} /* end if */
@@ -1920,11 +1937,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_copy_search_comm_dt */
+} /* end H5O__copy_search_comm_dt */
/*-------------------------------------------------------------------------
- * Function: H5O_copy_insert_comm_dt
+ * Function: H5O__copy_insert_comm_dt
*
* Purpose: Insert the committed datatype at oloc_dst into the merge committed
* dt skiplist. The datatype must not be present already.
@@ -1937,14 +1954,14 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst,
- hid_t dxpl_id, H5O_copy_t *cpy_info)
+H5O__copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst,
+ H5O_copy_t *cpy_info)
{
H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */
haddr_t *addr = NULL; /* Destination object address */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(oh_src);
@@ -1960,7 +1977,7 @@ H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst,
/* Read the datatype. Read from the source file because the destination
* object could be changed in the post-copy. */
- if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, dxpl_id, oh_src, H5O_DTYPE_ID, NULL)))
+ if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, oh_src, H5O_DTYPE_ID, NULL)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message")
/* Get destination object fileno */
@@ -1987,5 +2004,5 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_copy_insert_comm_dt */
+} /* end H5O__copy_insert_comm_dt */