summaryrefslogtreecommitdiffstats
path: root/src/H5Gnode.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2010-09-21 17:52:12 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2010-09-21 17:52:12 (GMT)
commit2087c6a9e49daa4d160fdbd79230bb3b36e63c30 (patch)
treea3f6011efa1a9369fd33d1fffa09365edc696ac5 /src/H5Gnode.c
parent95bc60ceb48bf6cd508691dd94be071b190fa74a (diff)
downloadhdf5-2087c6a9e49daa4d160fdbd79230bb3b36e63c30.zip
hdf5-2087c6a9e49daa4d160fdbd79230bb3b36e63c30.tar.gz
hdf5-2087c6a9e49daa4d160fdbd79230bb3b36e63c30.tar.bz2
[svn-r19461] Purpose: Fix bug 1864
Description: Library versions 1.6.3 and earlier contain a bug which causes them to be unable to perform certain operations on a group if that group's symbol table information is not cached in the parent group's symbol table. Versions 1.8.0 to 1.8.5 did not cache this information. Modified library to cache this information. Tested: jam, amani, heiwa (h5committest)
Diffstat (limited to 'src/H5Gnode.c')
-rw-r--r--src/H5Gnode.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 2b793a9..5a2d736 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;
@@ -1313,7 +1329,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")
/* Reset metadata tag */