diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-16 22:17:29 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-16 22:17:29 (GMT) |
commit | db2c4c497abab139485dbf6797e56b1340e4577d (patch) | |
tree | f7dfb321a3643658ed24aaf776ec4c1e48bc76a3 /src/H5Gobj.c | |
parent | 55af47c47c3c0c7bc17266968f5e0e782189e819 (diff) | |
download | hdf5-db2c4c497abab139485dbf6797e56b1340e4577d.zip hdf5-db2c4c497abab139485dbf6797e56b1340e4577d.tar.gz hdf5-db2c4c497abab139485dbf6797e56b1340e4577d.tar.bz2 |
[svn-r15221] Description:
Bring changes from trunk from the time the branch was created (r14280)
up to the 1.8.0 release (r14525) back into the metadata journaling branch.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5Gobj.c')
-rw-r--r-- | src/H5Gobj.c | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 00bac73..8ca8c52 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -533,7 +533,6 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, H5O_linfo_t new_linfo = H5G_CRT_LINK_INFO_DEF; /* Link information */ H5O_ginfo_t new_ginfo = H5G_CRT_GROUP_INFO_DEF; /* Group information */ H5G_obj_stab_it_ud1_t udata; /* User data for iteration */ - H5G_link_iterate_t lnk_op; /* Link operator */ /* Convert group to "new format" group, in order to hold the information */ @@ -549,12 +548,8 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, udata.grp_oloc = grp_oloc; udata.dxpl_id = dxpl_id; - /* Build iterator operator */ - lnk_op.op_type = H5G_LINK_OP_LIB; - lnk_op.u.lib_op = H5G_obj_stab_to_new_cb; - /* Iterate through all links in "old format" group and insert them into new format */ - if(H5G_stab_iterate(grp_oloc, dxpl_id, H5_ITER_NATIVE, (hsize_t)0, NULL, (hid_t)0, &lnk_op, &udata) < 0) + if(H5G_stab_iterate(grp_oloc, dxpl_id, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_obj_stab_to_new_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over old format links") /* Remove the symbol table message from the group */ @@ -636,36 +631,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_iterate(hid_t loc_id, const char *group_name, +H5G_obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id) + H5G_lib_iterate_t op, void *op_data, hid_t dxpl_id) { - H5G_loc_t loc; /* Location of parent for group */ H5O_linfo_t linfo; /* Link info message */ - hid_t gid = -1; /* ID of group to iterate over */ - H5G_t *grp; /* Pointer to group data structure to iterate over */ herr_t ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5G_obj_iterate, FAIL) /* Sanity check */ - HDassert(group_name); - HDassert(last_lnk); - HDassert(lnk_op && lnk_op->u.lib_op); - - /* - * Open the group on which to operate. We also create a group ID which - * we can pass to the application-defined operator. - */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(NULL == (grp = H5G_open_name(&loc, group_name, lapl_id, dxpl_id))) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - if((gid = H5I_register(H5I_GROUP, grp)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + HDassert(grp_oloc); + HDassert(op); /* Attempt to get the link info for this group */ - if(H5G_obj_get_linfo(&(grp->oloc), &linfo, dxpl_id)) { + if(H5G_obj_get_linfo(grp_oloc, &linfo, dxpl_id)) { /* Check for going out of bounds */ if(skip > 0 && (size_t)skip >= linfo.nlinks) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "index out of bound") @@ -679,13 +659,13 @@ H5G_obj_iterate(hid_t loc_id, const char *group_name, if(H5F_addr_defined(linfo.fheap_addr)) { /* Iterate over the links in the group, building a table of the link messages */ - if((ret_value = H5G_dense_iterate(grp->oloc.file, dxpl_id, &linfo, idx_type, order, skip, last_lnk, gid, lnk_op, op_data)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") + if((ret_value = H5G_dense_iterate(grp_oloc->file, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over dense links") } /* end if */ else { /* Get the object's name from the link messages */ - if((ret_value = H5G_compact_iterate(&(grp->oloc), dxpl_id, &linfo, idx_type, order, skip, last_lnk, gid, lnk_op, op_data)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over links") + if((ret_value = H5G_compact_iterate(grp_oloc, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over compact links") } /* end else */ } /* end if */ else { @@ -697,14 +677,11 @@ H5G_obj_iterate(hid_t loc_id, const char *group_name, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Iterate over symbol table */ - if((ret_value = H5G_stab_iterate(&(grp->oloc), dxpl_id, order, skip, last_lnk, gid, lnk_op, op_data)) < 0) + if((ret_value = H5G_stab_iterate(grp_oloc, dxpl_id, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over symbol table") } /* end else */ done: - if(gid > 0) - H5I_dec_ref(gid); /*also closes 'grp'*/ - FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_obj_iterate() */ @@ -904,7 +881,7 @@ H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) if(can_convert) { /* Insert link messages into group */ for(u = 0; u < linfo->nlinks; u++) - if(H5O_msg_append(oloc->file, dxpl_id, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { + if(H5O_msg_append_oh(oloc->file, dxpl_id, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { /* Release object header */ if(H5O_unprotect(oloc, oh) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to unprotect dataset object header") |