diff options
Diffstat (limited to 'src/H5Gobj.c')
-rw-r--r-- | src/H5Gobj.c | 227 |
1 files changed, 107 insertions, 120 deletions
diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 5f9bdc8..af0e72c 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -58,7 +58,6 @@ typedef struct { H5F_t *f; /* Pointer to file for insertion */ haddr_t oh_addr; /* Address of the object header */ - hid_t dxpl_id; /* DXPL during insertion */ H5O_linfo_t *linfo; /* Pointer to link info */ } H5G_obj_oh_it_ud1_t; @@ -76,7 +75,6 @@ typedef struct { */ typedef struct { const H5O_loc_t *grp_oloc; /* Pointer to group for insertion */ - hid_t dxpl_id; /* DXPL during insertion */ } H5G_obj_stab_it_ud1_t; @@ -90,8 +88,7 @@ typedef struct { /********************/ static herr_t H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned idx, void *_udata); -static herr_t H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, - hid_t dxpl_id); +static herr_t H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo); /*********************/ @@ -124,8 +121,7 @@ static herr_t H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *li *------------------------------------------------------------------------- */ herr_t -H5G__obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, - H5O_loc_t *oloc/*out*/) +H5G__obj_create(H5F_t *f, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { H5P_genplist_t *gc_plist; /* Group creation property list */ H5O_ginfo_t ginfo; /* Group info */ @@ -158,7 +154,7 @@ H5G__obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get group info") /* Call the "real" group creation routine now */ - if(H5G__obj_create_real(f, dxpl_id, &ginfo, &linfo, &pline, gcrt_info, oloc) < 0) + if(H5G__obj_create_real(f, &ginfo, &linfo, &pline, gcrt_info, oloc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "unable to create group") done: @@ -180,7 +176,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, +H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linfo, const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { @@ -260,32 +256,32 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, * since nothing refers to it yet. The link count will be * incremented if the object is added to the group directed graph. */ - if(H5O_create(f, dxpl_id, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") + if(H5O_create(f, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") /* Check for format of group to create */ if(use_at_least_v18) { /* Insert link info message */ /* (Casting away const OK - QAK) */ - if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo, dxpl_id) < 0) + if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert group info message */ /* (Casting away const OK - QAK) */ - if(H5O_msg_create(oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)ginfo, dxpl_id) < 0) + if(H5O_msg_create(oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)ginfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert pipeline message */ if(pline && pline->nused) /* (Casting away const OK - QAK) */ - if(H5O_msg_create(oloc, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)pline, dxpl_id) < 0) + if(H5O_msg_create(oloc, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") } /* end if */ else { H5O_stab_t stab; /* Symbol table message */ /* The group doesn't currently have a 'stab' message, go create one */ - if(H5G__stab_create(oloc, dxpl_id, ginfo, &stab) < 0) + if(H5G__stab_create(oloc, ginfo, &stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create symbol table") /* Cache the symbol table information */ @@ -315,23 +311,23 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) +H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo) { H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ HDassert(grp_oloc); HDassert(linfo); /* Check for the group having a link info message */ - if((ret_value = H5O_msg_exists(grp_oloc, H5O_LINFO_ID, dxpl_id)) < 0) + if((ret_value = H5O_msg_exists(grp_oloc, H5O_LINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(ret_value) { /* Retrieve the "link info" structure */ - if(NULL == H5O_msg_read(grp_oloc, H5O_LINFO_ID, linfo, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_LINFO_ID, linfo)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "link info message not present") /* Check if we don't know how many links there are */ @@ -339,7 +335,7 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) /* Check if we are using "dense" link storage */ if(H5F_addr_defined(linfo->fheap_addr)) { /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(grp_oloc->file, dxpl_id, linfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(grp_oloc->file, linfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in "name" B-tree */ @@ -349,7 +345,7 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) } /* end if */ else { /* Retrieve # of links from object header */ - if(H5O_get_nlinks(grp_oloc, dxpl_id, &linfo->nlinks) < 0) + if(H5O_get_nlinks(grp_oloc, &linfo->nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve # of links for object") } /* end if */ } /* end if */ @@ -357,10 +353,10 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__obj_get_linfo() */ @@ -385,18 +381,18 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void H5G_obj_oh_it_ud1_t *udata = (H5G_obj_oh_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(udata->dxpl_id, udata->oh_addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(udata->oh_addr) /* check arguments */ HDassert(lnk); HDassert(udata); /* Insert link into dense link storage */ - if(H5G__dense_insert(udata->f, udata->dxpl_id, udata->linfo, lnk) < 0) + if(H5G__dense_insert(udata->f, udata->linfo, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_compact_to_dense_cb() */ @@ -428,8 +424,7 @@ H5G_obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) /* Insert link into group */ /* (Casting away const OK - QAK) */ - if(H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, FALSE, - H5O_TYPE_UNKNOWN, NULL, udata->dxpl_id) < 0) + if(H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, FALSE, H5O_TYPE_UNKNOWN, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5_ITER_ERROR, "can't insert link into group") done: @@ -456,7 +451,7 @@ done: */ herr_t H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, - hbool_t adj_link, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) + hbool_t adj_link, H5O_type_t obj_type, const void *crt_info) { H5O_pline_t tmp_pline; /* Pipeline message */ H5O_pline_t *pline = NULL; /* Pointer to pipeline message */ @@ -466,7 +461,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, hbool_t use_new_dense = FALSE; /* Whether to use "dense" form of 'new format' group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -475,7 +470,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Check if we have information about the number of objects in this group */ /* (by attempting to get the link info message for this group) */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { H5O_ginfo_t ginfo; /* Group info message */ @@ -499,7 +494,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size") /* Get the group info */ - if(NULL == H5O_msg_read(grp_oloc, H5O_GINFO_ID, &ginfo, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_GINFO_ID, &ginfo)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") /* If there's still a small enough number of links, use the 'link' message */ @@ -516,32 +511,31 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, H5O_mesg_operator_t op; /* Message operator */ /* Get the pipeline message, if it exists */ - if((pline_exists = H5O_msg_exists(grp_oloc, H5O_PLINE_ID, dxpl_id)) < 0) + if((pline_exists = H5O_msg_exists(grp_oloc, H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(pline_exists) { - if(NULL == H5O_msg_read(grp_oloc, H5O_PLINE_ID, &tmp_pline, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_PLINE_ID, &tmp_pline)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link pipeline") pline = &tmp_pline; } /* end if */ /* The group doesn't currently have "dense" storage for links */ - if(H5G__dense_create(grp_oloc->file, dxpl_id, &linfo, pline) < 0) + if(H5G__dense_create(grp_oloc->file, &linfo, pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create 'dense' form of new format group") /* Set up user data for object header message iteration */ udata.f = grp_oloc->file; udata.oh_addr = grp_oloc->addr; - udata.dxpl_id = dxpl_id; udata.linfo = &linfo; /* Iterate over the 'link' messages, inserting them into the dense link storage */ op.op_type = H5O_MESG_OP_APP; op.u.app_op = H5G_obj_compact_to_dense_cb; - if(H5O_msg_iterate(grp_oloc, H5O_LINK_ID, &op, &udata, dxpl_id) < 0) + if(H5O_msg_iterate(grp_oloc, H5O_LINK_ID, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links") /* Remove all the 'link' messages */ - if(H5O_msg_remove(grp_oloc, H5O_LINK_ID, H5O_ALL, FALSE, dxpl_id) < 0) + if(H5O_msg_remove(grp_oloc, H5O_LINK_ID, H5O_ALL, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link messages") use_new_dense = TRUE; @@ -557,31 +551,29 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Convert group to "new format" group, in order to hold the information */ /* Insert link info message */ - if(H5O_msg_create(grp_oloc, H5O_LINFO_ID, 0, 0, &new_linfo, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_LINFO_ID, 0, 0, &new_linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert group info message */ - if(H5O_msg_create(grp_oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, H5O_UPDATE_TIME, &new_ginfo, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, H5O_UPDATE_TIME, &new_ginfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Set up user data for iteration */ udata.grp_oloc = grp_oloc; - udata.dxpl_id = dxpl_id; /* 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, H5G_obj_stab_to_new_cb, &udata) < 0) + if(H5G__stab_iterate(grp_oloc, 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 */ - if(H5O_msg_remove(grp_oloc, H5O_STAB_ID, 0, FALSE, dxpl_id) < 0) + if(H5O_msg_remove(grp_oloc, H5O_STAB_ID, 0, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete old format link storage") /* Recursively call this routine to insert the new link, since the * group is in the "new format" now and the link info should be * set up, etc. */ - if(H5G_obj_insert(grp_oloc, name, obj_lnk, adj_link, obj_type, - crt_info, dxpl_id) < 0) + if(H5G_obj_insert(grp_oloc, name, obj_lnk, adj_link, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into group") /* Done with insertion now */ @@ -594,19 +586,18 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Insert into symbol table or "dense" storage */ if(use_old_format) { /* Insert into symbol table */ - if(H5G__stab_insert(grp_oloc, name, obj_lnk, obj_type, crt_info, dxpl_id) - < 0) + if(H5G__stab_insert(grp_oloc, name, obj_lnk, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry into symbol table") } /* end if */ else { if(use_new_dense) { /* Insert into dense link storage */ - if(H5G__dense_insert(grp_oloc->file, dxpl_id, &linfo, obj_lnk) < 0) + if(H5G__dense_insert(grp_oloc->file, &linfo, obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") } /* end if */ else { /* Insert with link message */ - if(H5G__compact_insert(grp_oloc, obj_lnk, dxpl_id) < 0) + if(H5G__compact_insert(grp_oloc, obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link as link message") } /* end else */ } /* end else */ @@ -614,7 +605,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Increment the number of objects in this group */ if(!use_old_format) { linfo.nlinks++; - if(H5O_msg_write(grp_oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, &linfo, dxpl_id) < 0) + if(H5O_msg_write(grp_oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, &linfo) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update link info message") } /* end if */ @@ -628,7 +619,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, obj_oloc.addr = obj_lnk->u.hard.addr; /* Increment reference count for object */ - if(H5O_link(&obj_oloc, 1, dxpl_id) < 0) + if(H5O_link(&obj_oloc, 1) < 0) HGOTO_ERROR(H5E_SYM, H5E_LINKCOUNT, FAIL, "unable to increment hard link count") } /* end if */ @@ -637,7 +628,7 @@ done: if(pline && H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "can't release pipeline") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_insert() */ @@ -657,22 +648,22 @@ done: *------------------------------------------------------------------------- */ herr_t -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_lib_iterate_t op, void *op_data, hid_t dxpl_id) +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_lib_iterate_t op, + void *op_data) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* Sanity check */ HDassert(grp_oloc); HDassert(op); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for going out of bounds */ @@ -688,12 +679,12 @@ H5G__obj_iterate(const H5O_loc_t *grp_oloc, 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, op, op_data)) < 0) + if((ret_value = H5G__dense_iterate(grp_oloc->file, &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, op, op_data)) < 0) + if((ret_value = H5G__compact_iterate(grp_oloc, &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 */ @@ -703,12 +694,12 @@ H5G__obj_iterate(const H5O_loc_t *grp_oloc, 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, op, op_data)) < 0) + if((ret_value = H5G__stab_iterate(grp_oloc, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over symbol table") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__obj_iterate() */ @@ -726,7 +717,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) +H5G__obj_info(const H5O_loc_t *oloc, H5G_info_t *grp_info) { H5G_t *grp = NULL; /* Group to query */ H5G_loc_t grp_loc; /* Entry of group to be queried */ @@ -748,18 +739,18 @@ H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) H5G_loc_reset(&grp_loc); /* Deep copy (duplicate) of the group location object */ - if(H5O_loc_copy(&grp_oloc, oloc, H5_COPY_DEEP) < 0) + if(H5O_loc_copy(&grp_oloc, (H5O_loc_t *)oloc, H5_COPY_DEEP) < 0) /* (Casting away const OK - QAK) */ HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "can't copy object location") /* Open the group */ - if(NULL == (grp = H5G_open(&grp_loc, dxpl_id))) + if(NULL == (grp = H5G_open(&grp_loc))) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point not found") /* Get information from the group */ grp_info->mounted = H5G_MOUNTED(grp); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Retrieve the information about the links */ @@ -774,7 +765,7 @@ H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) } /* end if */ else { /* Get the number of objects in this group by iterating over symbol table */ - if(H5G__stab_count(oloc, &grp_info->nlinks, dxpl_id) < 0) + if(H5G__stab_count(oloc, &grp_info->nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't count objects") /* Set the other information about the group */ @@ -806,19 +797,19 @@ done: */ ssize_t H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id) + H5_iter_order_t order, hsize_t n, char* name, size_t size) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL) /* Sanity check */ HDassert(oloc && oloc->file); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -831,12 +822,12 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's name from the dense link storage */ - if((ret_value = H5G__dense_get_name_by_idx(oloc->file, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) + if((ret_value = H5G__dense_get_name_by_idx(oloc->file, &linfo, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end if */ else { /* Get the object's name from the link messages */ - if((ret_value = H5G__compact_get_name_by_idx(oloc, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) + if((ret_value = H5G__compact_get_name_by_idx(oloc, &linfo, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end else */ } /* end if */ @@ -846,17 +837,17 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Get the object's name from the symbol table */ - if((ret_value = H5G__stab_get_name_by_idx(oloc, order, n, name, size, dxpl_id)) < 0) + if((ret_value = H5G__stab_get_name_by_idx(oloc, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_get_name_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_remove_update_linfo + * Function: H5G__obj_remove_update_linfo * * Purpose: Update the link info after removing a link from a group * @@ -869,11 +860,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) +H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(oloc); @@ -891,7 +882,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp /* Check if there's no more links */ if(linfo->nlinks == 0) { /* Delete the dense storage */ - if(H5G__dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) + if(H5G__dense_delete(oloc->file, linfo, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage") } /* end if */ /* Check for switching back to compact storage */ @@ -899,7 +890,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp H5O_ginfo_t ginfo; /* Group info message */ /* Get the group info */ - if(NULL == H5O_msg_read(oloc, H5O_GINFO_ID, &ginfo, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_GINFO_ID, &ginfo)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") /* Check if we should switch from dense storage back to link messages */ @@ -910,11 +901,11 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp size_t u; /* Local index */ /* Build the table of links for this group */ - if(H5G__dense_build_table(oloc->file, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, <able) < 0) + if(H5G__dense_build_table(oloc->file, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Pin the object header */ - if(NULL == (oh = H5O_pin(oloc, dxpl_id))) + if(NULL == (oh = H5O_pin(oloc))) HGOTO_ERROR(H5E_SYM, H5E_CANTPIN, FAIL, "unable to pin group object header") /* Inspect links in table for ones that can't be converted back @@ -931,7 +922,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp if(can_convert) { /* Insert link messages into group */ for(u = 0; u < linfo->nlinks; u++) - if(H5O_msg_append_oh(oloc->file, dxpl_id, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { + if(H5O_msg_append_oh(oloc->file, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { /* Release object header */ if(H5O_unpin(oh) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPIN, FAIL, "unable to unpin group object header") @@ -940,7 +931,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp } /* end if */ /* Remove the dense storage */ - if(H5G__dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) + if(H5G__dense_delete(oloc->file, linfo, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage") } /* end if */ @@ -956,12 +947,12 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp } /* end if */ /* Update link info in the object header */ - if(H5O_msg_write(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, linfo, dxpl_id) < 0) + if(H5O_msg_write(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, linfo) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update link info message") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_obj_remove_update_linfo() */ +} /* end H5G__obj_remove_update_linfo() */ /*------------------------------------------------------------------------- @@ -978,21 +969,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name, hid_t dxpl_id) +H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL) /* Sanity check */ HDassert(oloc); HDassert(name && *name); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Using the new format for groups */ @@ -1001,31 +992,30 @@ H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *n /* Check for dense or compact storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Remove object from the dense link storage */ - if(H5G__dense_remove(oloc->file, dxpl_id, &linfo, grp_full_path_r, name) < 0) + if(H5G__dense_remove(oloc->file, &linfo, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end if */ - else { + else /* Remove object from the link messages */ - if(H5G__compact_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) + if(H5G__compact_remove(oloc, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") - } /* end else */ } /* end if */ else { /* Using the old format for groups */ use_old_format = TRUE; /* Remove object from the symbol table */ - if(H5G__stab_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) + if(H5G__stab_remove(oloc, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ /* Update link info for a new-style group */ if(!use_old_format) - if(H5G_obj_remove_update_linfo(oloc, &linfo, dxpl_id) < 0) + if(H5G__obj_remove_update_linfo(oloc, &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUPDATE, FAIL, "unable to update link info") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_remove() */ @@ -1044,20 +1034,20 @@ done: */ herr_t H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id) + H5_index_t idx_type, H5_iter_order_t order, hsize_t n) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* Sanity check */ HDassert(grp_oloc && grp_oloc->file); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1073,12 +1063,12 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, /* Check for dense or compact storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Remove object from the dense link storage */ - if(H5G__dense_remove_by_idx(grp_oloc->file, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) + if(H5G__dense_remove_by_idx(grp_oloc->file, &linfo, grp_full_path_r, idx_type, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end if */ else { /* Remove object from compact link storage */ - if(H5G__compact_remove_by_idx(grp_oloc, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) + if(H5G__compact_remove_by_idx(grp_oloc, &linfo, grp_full_path_r, idx_type, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ } /* end if */ @@ -1091,18 +1081,17 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, use_old_format = TRUE; /* Remove object from the symbol table */ - if(H5G__stab_remove_by_idx(grp_oloc, dxpl_id, grp_full_path_r, order, n) < 0) + if(H5G__stab_remove_by_idx(grp_oloc, grp_full_path_r, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ /* Update link info for a new-style group */ - if(!use_old_format) { - if(H5G_obj_remove_update_linfo(grp_oloc, &linfo, dxpl_id) < 0) + if(!use_old_format) + if(H5G__obj_remove_update_linfo(grp_oloc, &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUPDATE, FAIL, "unable to update link info") - } /* end if */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_remove() */ @@ -1120,43 +1109,41 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, - hid_t dxpl_id) +H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); HDassert(name && *name); /* Attempt to get the link info message for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's info from the dense link storage */ - if((ret_value = H5G__dense_lookup(grp_oloc->file, dxpl_id, &linfo, name, lnk)) < 0) + if((ret_value = H5G__dense_lookup(grp_oloc->file, &linfo, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end if */ else { /* Get the object's info from the link messages */ - if((ret_value = H5G__compact_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) + if((ret_value = H5G__compact_lookup(grp_oloc, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ } /* end if */ - else { + else /* Get the object's info from the symbol table */ - if((ret_value = H5G__stab_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) + if((ret_value = H5G__stab_lookup(grp_oloc, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") - } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__obj_lookup() */ @@ -1176,19 +1163,19 @@ done: */ herr_t H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, H5O_link_t *lnk, hid_t dxpl_id) + H5_iter_order_t order, hsize_t n, H5O_link_t *lnk) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); /* Attempt to get the link info message for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1201,12 +1188,12 @@ H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the link from the dense storage */ - if(H5G__dense_lookup_by_idx(grp_oloc->file, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) + if(H5G__dense_lookup_by_idx(grp_oloc->file, &linfo, idx_type, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end if */ else { /* Get the link from the link messages */ - if(H5G__compact_lookup_by_idx(grp_oloc, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) + if(H5G__compact_lookup_by_idx(grp_oloc, &linfo, idx_type, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ } /* end if */ @@ -1216,11 +1203,11 @@ H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Get the object's info from the symbol table */ - if(H5G__stab_lookup_by_idx(grp_oloc, order, n, lnk, dxpl_id) < 0) + if(H5G__stab_lookup_by_idx(grp_oloc, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_lookup_by_idx() */ |