summaryrefslogtreecommitdiffstats
path: root/src/H5VLiod_util.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2013-11-05 22:58:31 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2013-11-05 22:58:31 (GMT)
commit9ebaa8c59c5ae6710384df79ec9a59c019894631 (patch)
tree1f37c3a47e88d613e36d909219fb90282d07c112 /src/H5VLiod_util.c
parent8a0555c2a20dd63465549eb92022ab678e21c550 (diff)
downloadhdf5-9ebaa8c59c5ae6710384df79ec9a59c019894631.zip
hdf5-9ebaa8c59c5ae6710384df79ec9a59c019894631.tar.gz
hdf5-9ebaa8c59c5ae6710384df79ec9a59c019894631.tar.bz2
[svn-r24407] more integration with IOD
Diffstat (limited to 'src/H5VLiod_util.c')
-rw-r--r--src/H5VLiod_util.c153
1 files changed, 78 insertions, 75 deletions
diff --git a/src/H5VLiod_util.c b/src/H5VLiod_util.c
index c95acf8..06900b1 100644
--- a/src/H5VLiod_util.c
+++ b/src/H5VLiod_util.c
@@ -68,20 +68,21 @@ H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t lo
assert(FALSE == create_interm_grps);
cur_oh.rd_oh.cookie = loc_handle.rd_oh.cookie;
+ cur_oh.wr_oh.cookie = loc_handle.wr_oh.cookie;
cur_id = loc_id;
/* open the current group */
if(cur_oh.rd_oh.cookie == IOD_OH_UNDEFINED) {
if (iod_obj_open_read(coh, loc_id, NULL /*hints*/, &cur_oh.rd_oh, NULL) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
}
/* Wrap the local buffer for serialized header info */
if(NULL == (wb = H5WB_wrap(comp_buf, sizeof(comp_buf))))
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't wrap buffer")
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't wrap buffer")
/* Get a pointer to a buffer that's large enough */
if(NULL == (comp = (char *)H5WB_actual(wb, (HDstrlen(path) + 1))))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't get actual buffer")
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't get actual buffer")
/* Traverse the path */
while((path = H5G__component(path, &nchars)) && *path) {
@@ -116,7 +117,7 @@ H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t lo
/* lookup next object in the current group */
if(H5VL_iod_get_metadata(cur_oh.rd_oh, rtid, H5VL_IOD_LINK,
comp, NULL, NULL, &value) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link value");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link value");
/* if this a soft link, traverse the link value if the ID is undefined */
if(H5L_TYPE_SOFT == value.link_type) {
@@ -127,7 +128,7 @@ H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t lo
/* Traverse Path and open the target object */
if(H5VL_iod_server_open_path(coh, cur_id, cur_oh, value.u.symbolic_name,
rtid, &cur_id, &cur_oh) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object");
free(value.u.symbolic_name);
}
@@ -137,11 +138,11 @@ H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t lo
/* Close previous read handle unless it is the original one */
if(loc_handle.rd_oh.cookie != prev_oh.cookie &&
iod_obj_close(prev_oh, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle");
/* open the current group */
if (iod_obj_open_read(coh, cur_id, NULL, &cur_oh.rd_oh, NULL) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
/* Advance to next component in string */
path += nchars;
@@ -149,7 +150,7 @@ H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t lo
/* Release temporary component buffer */
if(wb && H5WB_unwrap(wb) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't release wrapped buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't release wrapped buffer");
*iod_id = cur_id;
(*iod_oh).rd_oh.cookie = cur_oh.rd_oh.cookie;
@@ -158,7 +159,7 @@ H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t lo
loc_handle.wr_oh.cookie == IOD_OH_UNDEFINED) {
/* open a write handle on the ID. */
if (iod_obj_open_write(coh, cur_id, NULL, &cur_oh.wr_oh, NULL) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
}
(*iod_oh).wr_oh.cookie = cur_oh.wr_oh.cookie;
@@ -205,15 +206,15 @@ H5VL_iod_server_open_path(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t l
if(cur_oh.rd_oh.cookie == IOD_OH_UNDEFINED) {
/* open the current group */
if (iod_obj_open_read(coh, loc_id, NULL /*hints*/, &cur_oh.rd_oh, NULL) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
}
/* Wrap the local buffer for serialized header info */
if(NULL == (wb = H5WB_wrap(comp_buf, sizeof(comp_buf))))
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't wrap buffer")
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't wrap buffer")
/* Get a pointer to a buffer that's large enough */
if(NULL == (comp = (char *)H5WB_actual(wb, (HDstrlen(path) + 1))))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't get actual buffer")
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't get actual buffer")
/* Traverse the path */
while((path = H5G__component(path, &nchars)) && *path) {
@@ -239,7 +240,7 @@ H5VL_iod_server_open_path(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t l
/* lookup next object in the current group */
if(H5VL_iod_get_metadata(cur_oh.rd_oh, rtid, H5VL_IOD_LINK,
comp, NULL, NULL, &value) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link value");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link value");
/* if this a soft link, traverse the link value if the ID is undefined */
if(H5L_TYPE_SOFT == value.link_type) {
@@ -250,7 +251,7 @@ H5VL_iod_server_open_path(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t l
/* Traverse Path and open the target object */
if(H5VL_iod_server_open_path(coh, cur_id, cur_oh, value.u.symbolic_name,
rtid, &cur_id, &cur_oh) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object");
free(value.u.symbolic_name);
}
@@ -260,11 +261,11 @@ H5VL_iod_server_open_path(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t l
/* Close previous handle unless it is the original one */
if(loc_handle.rd_oh.cookie != prev_oh.cookie &&
iod_obj_close(prev_oh, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle");
/* open the current group */
if (iod_obj_open_read(coh, cur_id, NULL, &cur_oh.rd_oh, NULL) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group");
/* Advance to next component in string */
path += nchars;
@@ -272,11 +273,11 @@ H5VL_iod_server_open_path(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t l
/* Release temporary component buffer */
if(wb && H5WB_unwrap(wb) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't release wrapped buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't release wrapped buffer");
*iod_id = cur_id;
(*iod_oh).rd_oh.cookie = cur_oh.rd_oh.cookie;
- (*iod_oh).wr_oh = IOD_HANDLE_INVALID;
+ (*iod_oh).wr_oh.cookie = IOD_OH_UNDEFINED;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -307,7 +308,7 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
/* get the rank of this dataspace */
if((ndims = H5Sget_simple_extent_ndims(space_id)) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataspace dimesnsion");
+ HGOTO_ERROR2(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataspace dimesnsion");
switch(H5Sget_select_type(space_id)) {
case H5S_SEL_NONE:
@@ -323,7 +324,7 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
/* get the dimensions sizes of the dataspace */
if(H5Sget_simple_extent_dims(space_id, dims, NULL) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataspace dimesnsion sizes");
+ HGOTO_ERROR2(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataspace dimesnsion sizes");
/* populate the hyperslab */
for(i=0 ; i<ndims ; i++) {
hslabs[0].start[i] = 0;
@@ -337,7 +338,7 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
{
/* we need a hyperslab element for each point */
if((num_descriptors = H5Sget_select_elem_npoints(space_id)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "invalid point selection");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "invalid point selection");
if(NULL != hslabs) {
hsize_t *points = NULL;
@@ -346,11 +347,11 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
point_count = ndims * num_descriptors * sizeof(hsize_t);
if(NULL == (points = (hsize_t *)malloc(point_count)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate array for points coords");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate array for points coords");
if(H5Sget_select_elem_pointlist(space_id, (hsize_t)0,
(hsize_t)num_descriptors, points) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "Failed to retrieve point coordinates");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "Failed to retrieve point coordinates");
/* populate the hyperslab */
for(n=0 ; n<num_descriptors ; n++) {
@@ -384,13 +385,13 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
hslabs[0].stride,
hslabs[0].count,
hslabs[0].block) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "Failed to retrieve hyperslab selection");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "Failed to retrieve hyperslab selection");
}
}
/* Otherwise populate the hslabs by getting every block */
else {
if((num_descriptors = H5Sget_select_hyper_nblocks(space_id)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "invalid hyperslab selection");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "invalid hyperslab selection");
if(NULL != hslabs) {
hsize_t *blocks = NULL;
@@ -399,13 +400,13 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
block_count = ndims * num_descriptors * sizeof(hsize_t) * 2;
if(NULL == (blocks = (hsize_t *)malloc(block_count)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate array for points coords");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate array for points coords");
fprintf(stderr, "block count = %zu\n", block_count);
if(H5Sget_select_hyper_blocklist(space_id, (hsize_t)0,
(hsize_t)num_descriptors, blocks) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "Failed to retrieve point coordinates");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "Failed to retrieve point coordinates");
/* populate the hyperslab */
for(n=0 ; n<num_descriptors ; n++) {
@@ -429,7 +430,7 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
case H5S_SEL_ERROR:
case H5S_SEL_N:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "Invalid Selection type");
+ HGOTO_ERROR2(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "Invalid Selection type");
}
*count = num_descriptors;
@@ -467,19 +468,19 @@ H5VL_iod_insert_plist(iod_handle_t oh, iod_trans_id_t tid, hid_t plist_id,
/* determine the buffer size needed to store the encoded plist */
if(H5Pencode(plist_id, NULL, &buf_size) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode plist");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode plist");
if(NULL == (value = malloc (buf_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate plist buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate plist buffer");
/* encode plist */
if(H5Pencode(plist_id, value, &buf_size) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode plist");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode plist");
kv.key = (void *)key;
kv.key_len = (iod_size_t)strlen(key);
kv.value = value;
kv.value_len = (iod_size_t)buf_size;
if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
done:
if(key) {
@@ -524,7 +525,7 @@ H5VL_iod_insert_link_count(iod_handle_t oh, iod_trans_id_t tid, uint64_t count,
kv.value_len = sizeof(uint64_t);
if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
done:
if(key) {
@@ -564,7 +565,7 @@ H5VL_iod_insert_object_type(iod_handle_t oh, iod_trans_id_t tid, H5I_type_t obj_
kv.value_len = sizeof(int32_t);
if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
done:
if(key) {
@@ -603,12 +604,12 @@ H5VL_iod_insert_datatype(iod_handle_t oh, iod_trans_id_t tid, hid_t type_id,
/* determine the buffer size needed to store the encoded type */
if(H5Tencode(type_id, NULL, &buf_size) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode type");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode type");
if(NULL == (value = malloc (buf_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer");
/* encode type */
if(H5Tencode(type_id, value, &buf_size) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode type");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode type");
kv.key = (void *)key;
kv.key_len = (iod_size_t)strlen(key);
@@ -616,7 +617,7 @@ H5VL_iod_insert_datatype(iod_handle_t oh, iod_trans_id_t tid, hid_t type_id,
kv.value_len = (iod_size_t)buf_size;
/* insert kv pair into KV */
if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
done:
if(key) {
@@ -657,12 +658,12 @@ H5VL_iod_insert_datatype_with_key(iod_handle_t oh, iod_trans_id_t tid, hid_t typ
/* determine the buffer size needed to store the encoded type */
if(H5Tencode(type_id, NULL, &buf_size) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode type");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode type");
if(NULL == (value = malloc (buf_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer");
/* encode type */
if(H5Tencode(type_id, value, &buf_size) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode type");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode type");
kv.key = (void *)key;
kv.key_len = (iod_size_t)strlen(key);
@@ -670,7 +671,7 @@ H5VL_iod_insert_datatype_with_key(iod_handle_t oh, iod_trans_id_t tid, hid_t typ
kv.value_len = (iod_size_t)buf_size;
/* insert kv pair into KV */
if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
done:
if(value) {
@@ -710,12 +711,12 @@ H5VL_iod_insert_dataspace(iod_handle_t oh, iod_trans_id_t tid, hid_t space_id,
/* determine the buffer size needed to store the encoded space */
if(H5Sencode(space_id, NULL, &buf_size) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode space");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode space");
if(NULL == (value = malloc (buf_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate space buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate space buffer");
/* encode space */
if(H5Sencode(space_id, value, &buf_size) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode space");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode space");
kv.key = (void *)key;
kv.key_len = (iod_size_t)strlen(key);
@@ -723,7 +724,7 @@ H5VL_iod_insert_dataspace(iod_handle_t oh, iod_trans_id_t tid, hid_t space_id,
kv.value_len = (iod_size_t)buf_size;
/* insert kv pair into KV */
if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
done:
if(key) {
@@ -792,16 +793,17 @@ H5VL_iod_insert_new_link(iod_handle_t oh, iod_trans_id_t tid, const char *link_n
case H5L_TYPE_EXTERNAL:
case H5L_TYPE_MAX:
default:
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unsupported link type");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unsupported link type");
}
+ fprintf(stderr, "inserting Key %s in %"PRIu64" \n", link_name, oh);
kv.key = (void *)link_name;
kv.key_len = (iod_size_t)strlen(link_name);
kv.value = value;
kv.value_len = value_len;
if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent");
done:
@@ -840,38 +842,38 @@ H5VL_iod_get_metadata(iod_handle_t oh, iod_trans_id_t tid, H5VL_iod_metadata_t m
hid_t plist_id = *((hid_t *)ret);
if(iod_kv_get_value(oh, tid, key, key_size, NULL, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
if(NULL == (value = malloc((size_t)val_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer");
if(iod_kv_get_value(oh, tid, key, key_size, value, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
if((plist_id = H5Pdecode(value)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "failed to decode gcpl");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTDECODE, FAIL, "failed to decode gcpl");
break;
}
case H5VL_IOD_LINK_COUNT:
val_size = sizeof(uint64_t);
if(iod_kv_get_value(oh, tid, key, key_size, ret, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "link_count lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "link_count lookup failed");
break;
case H5VL_IOD_DATATYPE:
{
hid_t type_id = *((hid_t *)ret);
if(iod_kv_get_value(oh, tid, key, key_size, NULL, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
if(NULL == (value = malloc((size_t)val_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer");
if(iod_kv_get_value(oh, tid, key, key_size, value, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
if((type_id = H5Tdecode(value)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "failed to decode gcpl");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTDECODE, FAIL, "failed to decode gcpl");
break;
}
case H5VL_IOD_DATASPACE:
@@ -879,36 +881,37 @@ H5VL_iod_get_metadata(iod_handle_t oh, iod_trans_id_t tid, H5VL_iod_metadata_t m
hid_t space_id = *((hid_t *)ret);
if(iod_kv_get_value(oh, tid, key, key_size, NULL, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
if(NULL == (value = malloc((size_t)val_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer");
if(iod_kv_get_value(oh, tid, key, key_size, value, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
if((space_id = H5Tdecode(value)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "failed to decode gcpl");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTDECODE, FAIL, "failed to decode gcpl");
break;
}
case H5VL_IOD_OBJECT_TYPE:
val_size = sizeof(int32_t);
if(iod_kv_get_value(oh, tid, key, key_size, ret, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "link_count lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "link_count lookup failed");
break;
case H5VL_IOD_LINK:
{
H5VL_iod_link_t *iod_link = (H5VL_iod_link_t *)ret;
uint8_t *val_ptr;
+ fprintf(stderr, "Looking up Key %s in %"PRIu64" \n", key, oh);
if(iod_kv_get_value(oh, tid, key, key_size, NULL, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
if(NULL == (value = malloc((size_t)val_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer");
if(iod_kv_get_value(oh, tid, key, key_size, value, &val_size, cs, event) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed");
val_ptr = (uint8_t *)value;
@@ -926,12 +929,12 @@ H5VL_iod_get_metadata(iod_handle_t oh, iod_trans_id_t tid, H5VL_iod_metadata_t m
case H5L_TYPE_EXTERNAL:
case H5L_TYPE_MAX:
default:
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unsupported link type");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unsupported link type");
}
break;
}
default:
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "invalide metadata type");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "invalide metadata type");
}
done:
if(value) {
@@ -999,7 +1002,7 @@ H5VL__iod_server_adjust_buffer(hid_t mem_type_id, hid_t dset_type_id, size_t nel
buf_size = dset_type_size * nelmts;
if(NULL == (*buf = realloc(*buf, (size_t)buf_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "Can't adjust buffer for DT conversion");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "Can't adjust buffer for DT conversion");
#if H5VL_IOD_DEBUG
fprintf(stderr, "Adjusted Buffer size for dt conversion from %zu to %lld\n",
size, buf_size);
@@ -1008,7 +1011,7 @@ H5VL__iod_server_adjust_buffer(hid_t mem_type_id, hid_t dset_type_id, size_t nel
else {
buf_size = mem_type_size * nelmts;
if(buf_size != size)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Incoming data size is not equal to expected size");
+ HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Incoming data size is not equal to expected size");
}
*_buf_size = buf_size;
@@ -1020,7 +1023,7 @@ H5VL__iod_server_adjust_buffer(hid_t mem_type_id, hid_t dset_type_id, size_t nel
*_buf_size = size;
break;
default:
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "unsupported datatype");
+ HGOTO_ERROR2(H5E_ARGS, H5E_CANTINIT, FAIL, "unsupported datatype");
}
done:
@@ -1069,11 +1072,11 @@ H5VL_iod_map_type_convert(hid_t src_id, hid_t dst_id, void *buf, size_t buf_size
class = H5Tget_class(src_id);
if(H5T_VLEN == class || (H5T_STRING == class && H5Tis_variable_str(src_id)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Can't convert VL or string types");
+ HGOTO_ERROR2(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Can't convert VL or string types");
class = H5Tget_class(dset_id);
if(H5T_VLEN == class || (H5T_STRING == class && H5Tis_variable_str(dst_id)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Can't convert VL or string types");
+ HGOTO_ERROR2(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Can't convert VL or string types");
/* Check (and do) Type conversion on the Key */
src_size = H5Tget_size(src_id);
@@ -1083,18 +1086,18 @@ H5VL_iod_map_type_convert(hid_t src_id, hid_t dst_id, void *buf, size_t buf_size
if(src_size < dst_size) {
new_size = dst_size;
if(NULL == (*buf = realloc(*buf, new_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "Can't adjust buffer for DT conversion");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "Can't adjust buffer for DT conversion");
}
else {
new_size = src_size;
}
if(NULL == (key_buf = malloc((size_t)key_size)))
- HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate buffer");
+ HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate buffer");
memcpy(key_buf, key.buf, src_size);
if(H5Tconvert(src_id, dst_id, 1, key_buf, NULL, dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed")
+ HGOTO_ERROR2(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed")
done:
FUNC_LEAVE_NOAPI(ret_value)