summaryrefslogtreecommitdiffstats
path: root/src/H5Ocopy.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2010-03-05 17:51:45 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2010-03-05 17:51:45 (GMT)
commit187292532027ed6abdbd8be127381491881d5a59 (patch)
tree44f62304f23b9af8ac0f0b5f86d9acc5c00e8a32 /src/H5Ocopy.c
parent179b54da83f293948a531afd6b59e676df7a60e7 (diff)
downloadhdf5-187292532027ed6abdbd8be127381491881d5a59.zip
hdf5-187292532027ed6abdbd8be127381491881d5a59.tar.gz
hdf5-187292532027ed6abdbd8be127381491881d5a59.tar.bz2
[svn-r18376] Purpose: Fix bug 1733
Description: Support for expanding external links was not implemented in H5Ocopy, even though a flag existed for H5Pset_copy_object to enable this. This patch implements this feature. Tested: jam, amani, linew (h5committest); Fedora
Diffstat (limited to 'src/H5Ocopy.c')
-rw-r--r--src/H5Ocopy.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 1712706..da91782 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -661,12 +661,14 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
/* Insert the address mapping for the new object into the copied list */
/* (Do this here, because "post copy" possibly checks it) */
- addr_map->src_addr = oloc_src->addr;
+ H5F_GET_FILENO(oloc_src->file, addr_map->src_obj_pos.fileno);
+ addr_map->src_obj_pos.addr = oloc_src->addr;
addr_map->dst_addr = oloc_dst->addr;
addr_map->is_locked = TRUE; /* We've locked the object currently */
addr_map->inc_ref_count = 0; /* Start with no additional ref counts to add */
- if(H5SL_insert(cpy_info->map_list, addr_map, &(addr_map->src_addr)) < 0)
+ /* Insert into skip list */
+ if(H5SL_insert(cpy_info->map_list, addr_map, &(addr_map->src_obj_pos)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list")
/* "post copy" loop over messages, to fix up any messages which require a complete
@@ -765,20 +767,27 @@ 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_addr_map_t *addr_map; /* Address mapping of object copied */
+ H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */
+ H5_obj_t src_obj_pos; /* Position of source object */
hbool_t inc_link; /* Whether to increment the link count for the object */
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI(H5O_copy_header_map, FAIL)
/* Sanity check */
HDassert(oloc_src);
+ HDassert(oloc_src->file);
HDassert(oloc_dst);
HDassert(oloc_dst->file);
HDassert(cpy_info);
- /* Look up the address of the object to copy in the skip list */
- addr_map = (H5O_addr_map_t *)H5SL_search(cpy_info->map_list, &(oloc_src->addr));
+ /* Create object "position" struct */
+ H5F_GET_FILENO(oloc_src->file, src_obj_pos.fileno);
+ src_obj_pos.addr = oloc_src->addr;
+
+ /* Search for the object in the skip list of copied objects */
+ addr_map = (H5O_addr_map_t *)H5SL_search(cpy_info->map_list,
+ &src_obj_pos);
/* Check if address is already in list of objects copied */
if(addr_map == NULL) {
@@ -910,7 +919,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
cpy_info.preserve_null = TRUE;
/* Create a skip list to keep track of which objects are copied */
- if((cpy_info.map_list = H5SL_create(H5SL_TYPE_HADDR)) == NULL)
+ if((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 */