diff options
Diffstat (limited to 'src/H5Gnode.c')
-rw-r--r-- | src/H5Gnode.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 2d84980..45b469d 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -640,7 +640,8 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, idx += cmp > 0 ? 1 : 0; /* Convert link information & name to symbol table entry */ - if(H5G_ent_convert(f, dxpl_id, udata->common.heap, udata->common.name, udata->lnk, &ent) < 0) + if(H5G_ent_convert(f, dxpl_id, udata->common.heap, udata->common.name, + udata->lnk, udata->obj_type, udata->crt_info, &ent) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_INS_ERROR, "unable to convert link") /* Determine where to place entry in node */ @@ -1238,6 +1239,9 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, H5O_link_t lnk; /* Link to insert */ const char *name; /* Name of source object */ H5G_entry_t tmp_src_ent; /* Temperary copy. Change will not affect the cache */ + H5O_type_t obj_type; /* Target object type */ + H5G_copy_file_ud_t *cpy_udata; /* Copy file udata */ + H5G_obj_create_t gcrt_info; /* Group creation info */ /* expand soft link */ if(H5G_CACHED_SLINK == src_ent->type && cpy_info->expand_soft_link) { @@ -1281,15 +1285,27 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, tmp_src_oloc.addr = src_ent->header; /* Copy the shared object from source to destination */ - if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, cpy_info, TRUE) < 0) + if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, + cpy_info, TRUE, &obj_type, (void **)&cpy_udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy object") + /* Set up object creation info for symbol table insertion. Only + * case so far is for inserting old-style groups (for caching stab + * info). */ + if(obj_type == H5O_TYPE_GROUP) { + gcrt_info.gcpl_id = H5P_DEFAULT; + gcrt_info.cache_type = cpy_udata->cache_type; + gcrt_info.cache = cpy_udata->cache; + } /* end if */ + /* Construct link information for eventual insertion */ lnk.type = H5L_TYPE_HARD; lnk.u.hard.addr = new_dst_oloc.addr; } /* ( H5F_addr_defined(src_ent->header)) */ else if(H5G_CACHED_SLINK == src_ent->type) { /* it is a soft link */ + /* Set object type to unknown */ + obj_type = H5O_TYPE_UNKNOWN; /* Construct link information for eventual insertion */ lnk.type = H5L_TYPE_SOFT; @@ -1310,7 +1326,9 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, /* Insert the new object in the destination file's group */ /* (Don't increment the link count - that's already done above for hard links) */ - if(H5G_stab_insert_real(udata->dst_file, udata->dst_stab, name, &lnk, dxpl_id) < 0) + if(H5G_stab_insert_real(udata->dst_file, udata->dst_stab, name, &lnk, + obj_type, (obj_type == H5O_TYPE_GROUP ? &gcrt_info : NULL), + dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") } /* end of for (i=0; i<sn->nsyms; i++) */ |