summaryrefslogtreecommitdiffstats
path: root/src/H5Gtest.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2018-04-05 23:31:18 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2018-04-05 23:31:18 (GMT)
commit048ae59d2970dd21810577c999f756c028b6faaf (patch)
tree72a68a20450d1e60055edb628bdae11ec5bdcf28 /src/H5Gtest.c
parentfbcd6b6fd0e77b99de500984d2e8a3d139eb1773 (diff)
parent01a783dbee8160641a5a682f2116ffbd1ac123fe (diff)
downloadhdf5-048ae59d2970dd21810577c999f756c028b6faaf.zip
hdf5-048ae59d2970dd21810577c999f756c028b6faaf.tar.gz
hdf5-048ae59d2970dd21810577c999f756c028b6faaf.tar.bz2
Merge pull request #991 in HDFFV/hdf5 from merge_func_enter_vol to develop
Commit API context and related changes * commit '01a783dbee8160641a5a682f2116ffbd1ac123fe': Correct errors with non-"instrumented library" builds (production & parallel, generally speaking). Update java error stack tests Revert using H5MF_sect_small_can_shrink and H5MF_sect_small_shrink for the file's free space manager (and add a comment about them). Add comment for the file flush when the file low / high bounds are changed after a file is open. Expanded comments abuot H5CX_t fields. Add an assert to verify that we don't write when between MPI_Barrier() calls during a flush. Add comments for internal structs. Remove redundant 'is_collective' parameter from H5CX_set_loc. Correct typo in comment. Revert some tangential code cleanups. Add API context source files to CMake configuration file. Corrections for parallel I/O & tests. Update handling of reporting for breaking collective I/O when the default DXPL is used. Update encoded DXPLs to reflect changes in properties. Correct typo for error checking malloc return value. Refactor H5CX code to reduce duplication. Cleanup API context function usage. Add API context interface and use it throughout the library.
Diffstat (limited to 'src/H5Gtest.c')
-rw-r--r--src/H5Gtest.c181
1 files changed, 116 insertions, 65 deletions
diff --git a/src/H5Gtest.c b/src/H5Gtest.c
index 7271cdc..f2f3e3a 100644
--- a/src/H5Gtest.c
+++ b/src/H5Gtest.c
@@ -29,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 */
@@ -95,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
@@ -104,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")
@@ -120,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 */
@@ -151,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 */
@@ -160,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 */
@@ -179,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() */
@@ -207,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
@@ -216,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")
@@ -233,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() */
@@ -266,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
@@ -275,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() */
@@ -317,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
@@ -326,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 */
@@ -356,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() */
@@ -388,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
@@ -397,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 */
@@ -421,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 */
@@ -431,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() */
@@ -469,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
@@ -478,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() */
@@ -518,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
@@ -530,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:
@@ -586,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() */
@@ -611,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
@@ -631,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:
@@ -643,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
@@ -663,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;
@@ -675,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.
@@ -684,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
@@ -699,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 */
@@ -708,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 */
@@ -723,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() */
/*-------------------------------------------------------------------------
@@ -768,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
@@ -781,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 */
@@ -795,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)