summaryrefslogtreecommitdiffstats
path: root/src/H5Gtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Gtest.c')
-rw-r--r--src/H5Gtest.c191
1 files changed, 120 insertions, 71 deletions
diff --git a/src/H5Gtest.c b/src/H5Gtest.c
index 0e0a897..f2f3e3a 100644
--- a/src/H5Gtest.c
+++ b/src/H5Gtest.c
@@ -5,12 +5,10 @@
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
@@ -31,6 +29,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gpkg.h" /* Groups */
@@ -97,7 +96,7 @@ H5G__is_empty_test(hid_t gid)
H5G_t *grp = NULL; /* Pointer to group */
htri_t msg_exists = FALSE; /* Indicate that a header message is present */
htri_t linfo_exists = FALSE;/* Indicate that the 'link info' message is present */
- hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_PACKAGE
@@ -106,14 +105,19 @@ H5G__is_empty_test(hid_t gid)
if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+ /* Set API context */
+ if(H5CX_push() < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context")
+ api_ctx_pushed = TRUE;
+
/* "New format" checks */
/* Check if the group has any link messages */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0) {
/* Sanity check that new group format shouldn't have old messages */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found")
@@ -122,19 +126,19 @@ H5G__is_empty_test(hid_t gid)
} /* end if */
/* Check for a link info message */
- if((linfo_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id)) < 0)
+ if((linfo_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(linfo_exists > 0) {
H5O_linfo_t linfo; /* Link info message */
/* Sanity check that new group format shouldn't have old messages */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link info messages found")
/* Get the link info */
- if(H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id) < 0)
+ if(H5G__obj_get_linfo(&(grp->oloc), &linfo) < 0)
HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info")
/* Check for 'dense' link storage file addresses being defined */
@@ -153,7 +157,7 @@ H5G__is_empty_test(hid_t gid)
/* "Old format" checks */
/* Check if the group has a symbol table message */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0) {
H5O_stab_t stab; /* Info about local heap & B-tree */
@@ -162,17 +166,17 @@ H5G__is_empty_test(hid_t gid)
/* Sanity check that old group format shouldn't have new messages */
if(linfo_exists > 0)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link info messages found")
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and group info messages found")
/* Get the B-tree & local heap info */
- if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab, dxpl_id))
+ if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab))
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol table message")
/* Get the count of links in the group */
- if(H5G__stab_count(&(grp->oloc), &nlinks, dxpl_id) < 0)
+ if(H5G__stab_count(&(grp->oloc), &nlinks) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to count links")
/* Check for link count */
@@ -181,6 +185,9 @@ H5G__is_empty_test(hid_t gid)
} /* end if */
done:
+ if(api_ctx_pushed && H5CX_pop() < 0)
+ HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5G__is_empty_test() */
@@ -209,7 +216,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs)
{
H5G_t *grp = NULL; /* Pointer to group */
htri_t msg_exists = 0; /* Indicate that a header message is present */
- hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_PACKAGE
@@ -218,14 +225,19 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs)
if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+ /* Set API context */
+ if(H5CX_push() < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context")
+ api_ctx_pushed = TRUE;
+
/* Check if the group has any link messages */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists == 0)
HGOTO_DONE(FALSE)
/* Check if the group has a symbol table message */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found")
@@ -235,12 +247,15 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs)
int msg_count; /* Number of messages of a type */
/* Check how many link messages there are */
- if((msg_count = H5O_msg_count(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0)
+ if((msg_count = H5O_msg_count(&(grp->oloc), H5O_LINK_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to count link messages")
*nmsgs = (unsigned)msg_count;
} /* end if */
done:
+ if(api_ctx_pushed && H5CX_pop() < 0)
+ HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5G__has_links_test() */
@@ -268,7 +283,7 @@ H5G__has_stab_test(hid_t gid)
{
H5G_t *grp = NULL; /* Pointer to group */
htri_t msg_exists = 0; /* Indicate that a header message is present */
- hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_PACKAGE
@@ -277,19 +292,27 @@ H5G__has_stab_test(hid_t gid)
if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+ /* Set API context */
+ if(H5CX_push() < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context")
+ api_ctx_pushed = TRUE;
+
/* Check if the group has a symbol table message */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists == 0)
HGOTO_DONE(FALSE)
/* Check if the group has any link messages */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found")
done:
+ if(api_ctx_pushed && H5CX_pop() < 0)
+ HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5G__has_stab_test() */
@@ -319,7 +342,7 @@ H5G__is_new_dense_test(hid_t gid)
{
H5G_t *grp = NULL; /* Pointer to group */
htri_t msg_exists = 0; /* Indicate that a header message is present */
- hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_PACKAGE
@@ -328,26 +351,31 @@ H5G__is_new_dense_test(hid_t gid)
if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+ /* Set API context */
+ if(H5CX_push() < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context")
+ api_ctx_pushed = TRUE;
+
/* Check if the group has a symbol table message */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0)
HGOTO_DONE(FALSE)
/* Check if the group has any link messages */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0)
HGOTO_DONE(FALSE)
/* Check if the group has link info message */
- if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id)) < 0)
+ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
if(msg_exists > 0) {
H5O_linfo_t linfo; /* Link info message */
/* Get the link info */
- if(H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id) < 0)
+ if(H5G__obj_get_linfo(&(grp->oloc), &linfo) < 0)
HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info")
/* Check for 'dense' link storage file addresses being defined */
@@ -358,6 +386,9 @@ H5G__is_new_dense_test(hid_t gid)
} /* end if */
done:
+ if(api_ctx_pushed && H5CX_pop() < 0)
+ HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5G__is_new_dense_test() */
@@ -390,7 +421,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count)
H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */
H5O_linfo_t linfo; /* Link info message */
H5G_t *grp = NULL; /* Pointer to group */
- hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -399,21 +430,26 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count)
if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
- /* Set metadata tag in dxpl_id */
- H5_BEGIN_TAG(dxpl_id, grp->oloc.addr, FAIL);
+ /* Set API context */
+ if(H5CX_push() < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context")
+ api_ctx_pushed = TRUE;
+
+ /* Set metadata tag in API context */
+ H5_BEGIN_TAG(grp->oloc.addr);
/* Get the link info */
- if(H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id) < 0)
+ if(H5G__obj_get_linfo(&(grp->oloc), &linfo) < 0)
HGOTO_ERROR_TAG(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info")
/* Check for 'dense' link storage file addresses being defined */
if(!H5F_addr_defined(linfo.fheap_addr))
- HGOTO_DONE_TAG(FAIL, FAIL)
+ HGOTO_DONE_TAG(FAIL)
if(!H5F_addr_defined(linfo.name_bt2_addr))
- HGOTO_DONE_TAG(FAIL, FAIL)
+ HGOTO_DONE_TAG(FAIL)
/* 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_TAG(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index")
/* Retrieve # of records in name index */
@@ -423,7 +459,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count)
/* Check if there is a creation order index */
if(H5F_addr_defined(linfo.corder_bt2_addr)) {
/* Open the creation order index v2 B-tree */
- if(NULL == (bt2_corder = H5B2_open(grp->oloc.file, dxpl_id, linfo.corder_bt2_addr, NULL)))
+ if(NULL == (bt2_corder = H5B2_open(grp->oloc.file, linfo.corder_bt2_addr, NULL)))
HGOTO_ERROR_TAG(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index")
/* Retrieve # of records in creation order index */
@@ -433,15 +469,17 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count)
else
*corder_count = 0;
- /* Reset metadata tag in dxpl_id */
- H5_END_TAG(FAIL);
+ /* Reset metadata tag in API context */
+ H5_END_TAG
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_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index")
- if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0)
+ if(bt2_corder && H5B2_close(bt2_corder) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index")
+ if(api_ctx_pushed && H5CX_pop() < 0)
+ HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context")
FUNC_LEAVE_NOAPI(ret_value)
} /* H5G__new_dense_info_test() */
@@ -471,7 +509,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size)
{
H5G_t *grp = NULL; /* Pointer to group */
H5O_stab_t stab; /* Symbol table message */
- hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -480,15 +518,23 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size)
if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+ /* Set API context */
+ if(H5CX_push() < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context")
+ api_ctx_pushed = TRUE;
+
/* Make certain the group has a symbol table message */
- if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab, dxpl_id))
+ if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab))
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read symbol table message")
/* Check the size of the local heap for the group */
- if(H5HL_get_size(grp->oloc.file, dxpl_id, stab.heap_addr, lheap_size) < 0)
+ if(H5HL_get_size(grp->oloc.file, stab.heap_addr, lheap_size) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't query local heap size")
done:
+ if(api_ctx_pushed && H5CX_pop() < 0)
+ HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5G__lheap_size_test() */
@@ -520,6 +566,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign
{
void *obj_ptr; /* Pointer to object for ID */
H5G_name_t *obj_path; /* Pointer to group hier. path for obj */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -532,6 +579,11 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign
if(NULL == (obj_ptr = H5I_object(obj_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get object for ID")
+ /* Set API context */
+ if(H5CX_push() < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context")
+ api_ctx_pushed = TRUE;
+
/* Get the symbol table entry */
switch(H5I_get_type(obj_id)) {
case H5I_GROUP:
@@ -588,6 +640,9 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign
} /* end else */
done:
+ if(api_ctx_pushed && H5CX_pop() < 0)
+ HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5G__user_path_test() */
@@ -613,17 +668,16 @@ H5G__verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent)
{
H5O_stab_t stab; /* Symbol table */
H5HL_t *heap = NULL; /* Pointer to local heap */
- hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL)
+ FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr)
/* Verify that stab info is cached in ent */
if(ent->type != H5G_CACHED_STAB)
HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "symbol table information is not cached")
/* Read the symbol table message from the group */
- if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id))
+ if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab))
HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message")
/* Verify that the cached symbol table info matches the symbol table message
@@ -633,11 +687,11 @@ H5G__verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "cached stab info does not match object header")
/* Verify that the btree address is valid */
- if(H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr) < 0)
+ if(H5B_valid(grp_oloc->file, H5B_SNODE, stab.btree_addr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "b-tree address is invalid")
/* Verify that the heap address is valid */
- if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG)))
+ if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG)))
HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "heap address is invalid")
done:
@@ -645,12 +699,12 @@ done:
if(heap && H5HL_unprotect(heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
- FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
+ FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5G__verify_cached_stab_test() */
/*-------------------------------------------------------------------------
- * Function: H5G_verify_cached_stabs_test_cb
+ * Function: H5G__verify_cached_stabs_test_cb
*
* Purpose: Verify that all entries in this node contain cached symbol
* table information if and only if the entry refers to a
@@ -665,9 +719,8 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id,
- const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key,
- void H5_ATTR_UNUSED *udata)
+H5G__verify_cached_stabs_test_cb(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key,
+ haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void H5_ATTR_UNUSED *udata)
{
H5G_node_t *sn = NULL;
H5O_loc_t targ_oloc;
@@ -677,7 +730,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id,
unsigned i;
int ret_value = H5_ITER_CONT;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -686,7 +739,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id,
HDassert(H5F_addr_defined(addr));
/* Load the node */
- if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG)))
+ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node")
/* Check each target object to see if its stab message (if present) matches
@@ -701,7 +754,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id,
targ_oloc.addr = sn->entry[i].header;
/* Load target object header */
- if(NULL == (targ_oh = H5O_protect(&targ_oloc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE)))
+ if(NULL == (targ_oh = H5O_protect(&targ_oloc, H5AC__READ_ONLY_FLAG, FALSE)))
HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to protect target object header")
/* Check if a symbol table message exists */
@@ -710,7 +763,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id,
if(stab_exists) {
/* Read symbol table message */
- if(NULL == H5O_msg_read_oh(f, dxpl_id, targ_oh, H5O_STAB_ID, &stab))
+ if(NULL == H5O_msg_read_oh(f, targ_oh, H5O_STAB_ID, &stab))
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to read STAB message")
/* Check if the stab matches the cached stab info */
@@ -725,23 +778,23 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id,
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, H5_ITER_ERROR, "nonexistent STAB message is cached")
/* Unprotect target object */
- if(H5O_unprotect(&targ_oloc, dxpl_id, targ_oh, H5AC__NO_FLAGS_SET) < 0)
+ if(H5O_unprotect(&targ_oloc, targ_oh, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release object header");
targ_oh = NULL;
} /* end for */
done:
- if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0)
+ if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header")
if(targ_oh) {
HDassert(ret_value == H5_ITER_ERROR);
- if(H5O_unprotect(&targ_oloc, dxpl_id, targ_oh, H5AC__NO_FLAGS_SET) < 0)
+ if(H5O_unprotect(&targ_oloc, targ_oh, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release object header");
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_verify_cached_stabs_test_cb() */
+} /* end H5G__verify_cached_stabs_test_cb() */
/*-------------------------------------------------------------------------
@@ -770,7 +823,6 @@ H5G__verify_cached_stabs_test(hid_t gid)
H5O_stab_t stab; /* Symbol table message */
H5G_bt_common_t udata = {NULL, NULL}; /* Dummy udata so H5B_iterate doesn't freak out */
haddr_t prev_tag = HADDR_UNDEF; /* Previous metadata tag */
- hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -783,13 +835,11 @@ H5G__verify_cached_stabs_test(hid_t gid)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
/* Set up metadata tagging */
- if(H5AC_tag(dxpl_id, grp->oloc.addr, &prev_tag) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to apply metadata tag")
+ H5AC_tag(grp->oloc.addr, &prev_tag);
/* Check for group having a symbol table message */
/* Check for the group having a group info message */
- if((stab_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID,
- dxpl_id)) < 0)
+ if((stab_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header")
/* No need to check anything if the symbol table doesn't exist */
@@ -797,17 +847,16 @@ H5G__verify_cached_stabs_test(hid_t gid)
HGOTO_DONE(SUCCEED);
/* Read the stab */
- if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab, dxpl_id))
+ if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab))
HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get symbol table info")
/* Iterate over the b-tree, checking validity of cached information */
- if((ret_value = H5B_iterate(grp->oloc.file, dxpl_id, H5B_SNODE,
- stab.btree_addr, H5G_verify_cached_stabs_test_cb, &udata)) < 0)
+ if((ret_value = H5B_iterate(grp->oloc.file, H5B_SNODE, stab.btree_addr,
+ H5G__verify_cached_stabs_test_cb, &udata)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "iteration operator failed");
/* Reset metadata tagging */
- if(H5AC_tag(dxpl_id, prev_tag, NULL) < 0)
- HDONE_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to apply metadata tag")
+ H5AC_tag(prev_tag, NULL);
done:
FUNC_LEAVE_NOAPI(ret_value)