diff options
Diffstat (limited to 'src/H5VLiod_link.c')
-rw-r--r-- | src/H5VLiod_link.c | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/src/H5VLiod_link.c b/src/H5VLiod_link.c index 7e22e8e..4495ae7 100644 --- a/src/H5VLiod_link.c +++ b/src/H5VLiod_link.c @@ -67,7 +67,7 @@ H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, does not exist. */ if(H5VL_iod_server_traverse(coh, input->loc_id, input->loc_oh, input->loc_name, wtid, rtid, FALSE, cs_scope, &src_last_comp, &src_id, &src_oh) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + HGOTO_ERROR_FF(FAIL, "can't traverse path"); #if H5_EFF_DEBUG fprintf(stderr, "new link name = %s\n", src_last_comp); @@ -84,67 +84,67 @@ H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, /* Try and open the starting location */ if (iod_obj_open_read(coh, input->target_loc_id, wtid, NULL, &input->target_loc_oh.rd_oh, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open start location"); + HGOTO_ERROR_FF(FAIL, "can't open start location"); opened_locally = TRUE; } /* Traverse Path and open the target object */ if(H5VL_iod_server_open_path(coh, input->target_loc_id, input->target_loc_oh, input->target_name, rtid, cs_scope, &target_id, &target_oh) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); + HGOTO_ERROR_FF(FAIL, "can't open object"); /* add link in parent group to current object */ if(H5VL_iod_insert_new_link(src_oh.wr_oh, wtid, src_last_comp, H5L_TYPE_HARD, &target_id, cs_scope, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR_FF(FAIL, "can't insert KV value"); if(input->target_loc_id != target_id) { /* get scratch pad */ if(iod_obj_get_scratch(target_oh.rd_oh, rtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR_FF(FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(&sp, sp_cs) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR_FF(FAIL, "Scratch Pad failed integrity check"); } /* open the metadata KV */ if (iod_obj_open_read(coh, sp[0], rtid, NULL /*hints*/, &mdkv_oh.rd_oh, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR_FF(FAIL, "can't open scratch pad"); if (iod_obj_open_write(coh, sp[0], rtid, NULL /*hints*/, &mdkv_oh.wr_oh, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR_FF(FAIL, "can't open scratch pad"); } else { /* open the metadata KV */ if (iod_obj_open_read(coh, input->target_mdkv_id, rtid, NULL, &mdkv_oh.rd_oh, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR_FF(FAIL, "can't open scratch pad"); if (iod_obj_open_write(coh, input->target_mdkv_id, rtid, NULL, &mdkv_oh.wr_oh, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR_FF(FAIL, "can't open scratch pad"); } if(H5VL_iod_get_metadata(mdkv_oh.rd_oh, rtid, H5VL_IOD_LINK_COUNT, H5VL_IOD_KEY_OBJ_LINK_COUNT, cs_scope, NULL, &link_count) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); + HGOTO_ERROR_FF(FAIL, "failed to retrieve link count"); link_count ++; /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh.wr_oh, wtid, link_count, cs_scope, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR_FF(FAIL, "can't insert KV value"); /* close the metadata scratch pad */ if(iod_obj_close(mdkv_oh.rd_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR_FF(FAIL, "can't close object"); if(iod_obj_close(mdkv_oh.wr_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR_FF(FAIL, "can't close object"); /* close the target location */ if(TRUE == opened_locally || input->target_loc_oh.rd_oh.cookie != target_oh.rd_oh.cookie) { if(iod_obj_close(target_oh.rd_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR_FF(FAIL, "can't close object"); } } else if(H5VL_LINK_CREATE_SOFT == create_type) { @@ -152,23 +152,23 @@ H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, if(H5VL_iod_insert_new_link(src_oh.wr_oh, wtid, src_last_comp, H5L_TYPE_SOFT, input->link_value, cs_scope, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR_FF(FAIL, "can't insert KV value"); #if H5_EFF_DEBUG fprintf(stderr, "Soft link Value = %s\n", input->link_value); #endif } else - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Invalid Link type"); + HGOTO_ERROR_FF(FAIL, "Invalid Link type"); /* close the source location */ if(input->loc_oh.rd_oh.cookie != src_oh.rd_oh.cookie) { if(iod_obj_close(src_oh.rd_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR_FF(FAIL, "can't close object"); } if(input->loc_oh.wr_oh.cookie != src_oh.wr_oh.cookie) { if(iod_obj_close(src_oh.wr_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR_FF(FAIL, "can't close object"); } done: @@ -235,7 +235,7 @@ H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, if(H5VL_iod_server_traverse(coh, input->src_loc_id, input->src_loc_oh, input->src_loc_name, wtid, rtid, FALSE, cs_scope, &src_last_comp, &src_id, &src_oh) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + HGOTO_ERROR_FF(FAIL, "can't traverse path"); /* the traversal will retrieve the location where the link needs to be moved/copied to. The traversal will fail if an intermediate group @@ -243,25 +243,25 @@ H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, if(H5VL_iod_server_traverse(coh, input->dst_loc_id, input->dst_loc_oh, input->dst_loc_name, wtid, rtid, FALSE, cs_scope, &dst_last_comp, &dst_id, &dst_oh) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + HGOTO_ERROR_FF(FAIL, "can't traverse path"); /* get the link value */ if(H5VL_iod_get_metadata(src_oh.rd_oh, rtid, H5VL_IOD_LINK, src_last_comp, cs_scope, NULL, &iod_link) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link value"); + HGOTO_ERROR_FF(FAIL, "failed to retrieve link value"); /* Insert object in the destination path */ if(H5L_TYPE_HARD == iod_link.link_type) { if(H5VL_iod_insert_new_link(dst_oh.wr_oh, wtid, dst_last_comp, iod_link.link_type, &iod_link.u.iod_id, cs_scope, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR_FF(FAIL, "can't insert KV value"); } else if(H5L_TYPE_SOFT == iod_link.link_type) { if(H5VL_iod_insert_new_link(dst_oh.wr_oh, wtid, dst_last_comp, iod_link.link_type, &iod_link.u.symbolic_name, cs_scope, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR_FF(FAIL, "can't insert KV value"); } /* if the operation type is a Move, remove the KV pair from the source object */ @@ -278,7 +278,7 @@ H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, /* remove link from source object */ if(iod_kv_unlink_keys(src_oh.wr_oh, wtid, NULL, 1, &kvs, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair"); + HGOTO_ERROR_FF(FAIL, "Unable to unlink KV pair"); } /* adjust link count on target object */ @@ -291,44 +291,44 @@ H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, /* open the current group */ if (iod_obj_open_read(coh, iod_link.u.iod_id, rtid, NULL, &target_oh, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + HGOTO_ERROR_FF(FAIL, "can't open current group"); /* get scratch pad */ if(iod_obj_get_scratch(target_oh, rtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR_FF(FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(&sp, sp_cs) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR_FF(FAIL, "Scratch Pad failed integrity check"); } /* open the metadata scratch pad */ if (iod_obj_open_read(coh, sp[0], rtid, NULL /*hints*/, &mdkv_oh.rd_oh, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR_FF(FAIL, "can't open scratch pad"); if (iod_obj_open_write(coh, sp[0], rtid, NULL /*hints*/, &mdkv_oh.wr_oh, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR_FF(FAIL, "can't open scratch pad"); if(H5VL_iod_get_metadata(mdkv_oh.rd_oh, rtid, H5VL_IOD_LINK_COUNT, H5VL_IOD_KEY_OBJ_LINK_COUNT, cs_scope, NULL, &link_count) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); + HGOTO_ERROR_FF(FAIL, "failed to retrieve link count"); link_count ++; /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh.wr_oh, wtid, link_count, cs_scope, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR_FF(FAIL, "can't insert KV value"); /* close the metadata scratch pad */ if(iod_obj_close(mdkv_oh.rd_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR_FF(FAIL, "can't close object"); if(iod_obj_close(mdkv_oh.wr_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR_FF(FAIL, "can't close object"); /* close the target location */ if(iod_obj_close(target_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR_FF(FAIL, "can't close object"); } /* close source group if it is not the location we started the @@ -436,7 +436,7 @@ H5VL_iod_server_link_exists_cb(AXE_engine_t UNUSED axe_engine, } else { if(iod_obj_close(rd_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle"); + HGOTO_ERROR_FF(FAIL, "can't close current object handle"); ret = TRUE; } } @@ -504,7 +504,7 @@ H5VL_iod_server_link_get_info_cb(AXE_engine_t UNUSED axe_engine, to be checked */ if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, rtid, rtid, FALSE, cs_scope, &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + HGOTO_ERROR_FF(FAIL, "can't traverse path"); #if H5_EFF_DEBUG fprintf(stderr, "Link Get_Info on link %s\n", last_comp); @@ -513,7 +513,7 @@ H5VL_iod_server_link_get_info_cb(AXE_engine_t UNUSED axe_engine, /* lookup link information in the current location */ if(H5VL_iod_get_metadata(cur_oh.rd_oh, rtid, H5VL_IOD_LINK, last_comp, cs_scope, NULL, &iod_link) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link value"); + HGOTO_ERROR_FF(FAIL, "failed to retrieve link value"); /* setup link info */ linfo.type = iod_link.link_type; @@ -529,7 +529,7 @@ H5VL_iod_server_link_get_info_cb(AXE_engine_t UNUSED axe_engine, case H5L_TYPE_EXTERNAL: case H5L_TYPE_MAX: default: - HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "unsuppored link type"); + HGOTO_ERROR_FF(FAIL, "unsuppored link type"); } #if H5_EFF_DEBUG @@ -606,7 +606,7 @@ H5VL_iod_server_link_get_val_cb(AXE_engine_t UNUSED axe_engine, to be checked */ if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, rtid, rtid, FALSE, cs_scope, &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + HGOTO_ERROR_FF(FAIL, "can't traverse path"); #if H5_EFF_DEBUG fprintf(stderr, "Link Get_val on link %s\n", last_comp); @@ -615,17 +615,17 @@ H5VL_iod_server_link_get_val_cb(AXE_engine_t UNUSED axe_engine, /* lookup link information in the current location */ if(H5VL_iod_get_metadata(cur_oh.rd_oh, rtid, H5VL_IOD_LINK, last_comp, cs_scope, NULL, &iod_link) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link value"); + HGOTO_ERROR_FF(FAIL, "failed to retrieve link value"); if(H5L_TYPE_SOFT != iod_link.link_type) - HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "link is not SOFT"); + HGOTO_ERROR_FF(FAIL, "link is not SOFT"); output.value.val_size = length; output.value.val = NULL; if(length) { if(NULL == (output.value.val = (void *)malloc (length))) - HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer"); + HGOTO_ERROR_FF(FAIL, "can't allocate value buffer"); memcpy(output.value.val, iod_link.u.symbolic_name, length); } @@ -720,12 +720,12 @@ H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, does not exist. */ if(H5VL_iod_server_traverse(coh, loc_id, loc_oh, loc_name, wtid, rtid, FALSE, cs_scope, &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + HGOTO_ERROR_FF(FAIL, "can't traverse path"); /* lookup object ID in the current location */ if(H5VL_iod_get_metadata(cur_oh.rd_oh, rtid, H5VL_IOD_LINK, last_comp, cs_scope, NULL, &iod_link) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link value"); + HGOTO_ERROR_FF(FAIL, "failed to retrieve link value"); /* unlink object from conainer */ kv.key = last_comp; @@ -734,7 +734,7 @@ H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, kvs.cs = &cs; kvs.ret = &ret; if(iod_kv_unlink_keys(cur_oh.wr_oh, wtid, NULL, 1, &kvs, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink KV pair"); + HGOTO_ERROR_FF(FAIL, "Unable to unlink KV pair"); /* check the metadata information for the object and remove it from the container if this is the last link to it */ @@ -748,32 +748,32 @@ H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, /* open the current group */ if (iod_obj_open_read(coh, obj_id, rtid, NULL, &obj_oh, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + HGOTO_ERROR_FF(FAIL, "can't open current group"); step ++; /* get scratch pad */ if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR_FF(FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(&sp, sp_cs) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR_FF(FAIL, "Scratch Pad failed integrity check"); } /* open the metadata scratch pad */ if (iod_obj_open_read(coh, sp[0], rtid, NULL /*hints*/, &mdkv_oh.rd_oh, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR_FF(FAIL, "can't open scratch pad"); if (iod_obj_open_write(coh, sp[0], rtid, NULL /*hints*/, &mdkv_oh.wr_oh, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR_FF(FAIL, "can't open scratch pad"); step ++; if(H5VL_iod_get_metadata(mdkv_oh.rd_oh, rtid, H5VL_IOD_LINK_COUNT, H5VL_IOD_KEY_OBJ_LINK_COUNT, cs_scope, NULL, &link_count) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); + HGOTO_ERROR_FF(FAIL, "failed to retrieve link count"); link_count --; @@ -782,7 +782,7 @@ H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh.wr_oh, wtid, link_count, cs_scope, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR_FF(FAIL, "can't insert KV value"); } iod_obj_close(mdkv_oh.rd_oh, NULL, NULL); @@ -797,11 +797,11 @@ H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, /* If this was the only link to the object, remove the object */ if(0 == link_count) { if(iod_obj_unlink(coh, obj_id, wtid, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink object"); + HGOTO_ERROR_FF(FAIL, "Unable to unlink object"); if(iod_obj_unlink(coh, sp[0], wtid, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink MDKV object"); + HGOTO_ERROR_FF(FAIL, "Unable to unlink MDKV object"); if(iod_obj_unlink(coh, sp[1], wtid, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTDEC, FAIL, "Unable to unlink ATTRKV object"); + HGOTO_ERROR_FF(FAIL, "Unable to unlink ATTRKV object"); } } |