diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-30 21:32:14 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-30 21:32:14 (GMT) |
commit | 3d0e4d65273e73c4647667327eb553cd4a552b68 (patch) | |
tree | ed2a8d14458315114a8dda6d2a1cb53fe06cf298 /src | |
parent | a82b4fdc1180fd5704372d48580fb23121baf529 (diff) | |
download | hdf5-3d0e4d65273e73c4647667327eb553cd4a552b68.zip hdf5-3d0e4d65273e73c4647667327eb553cd4a552b68.tar.gz hdf5-3d0e4d65273e73c4647667327eb553cd4a552b68.tar.bz2 |
[svn-r24667] more data integrity integration.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5VLiod_attr.c | 10 | ||||
-rw-r--r-- | src/H5VLiod_dset.c | 16 | ||||
-rw-r--r-- | src/H5VLiod_dtype.c | 8 | ||||
-rw-r--r-- | src/H5VLiod_file.c | 33 | ||||
-rw-r--r-- | src/H5VLiod_group.c | 10 | ||||
-rw-r--r-- | src/H5VLiod_link.c | 14 | ||||
-rw-r--r-- | src/H5VLiod_map.c | 12 | ||||
-rw-r--r-- | src/H5VLiod_obj.c | 2 | ||||
-rw-r--r-- | src/H5VLiod_server.h | 16 | ||||
-rw-r--r-- | src/H5VLiod_util.c | 159 |
10 files changed, 194 insertions, 86 deletions
diff --git a/src/H5VLiod_attr.c b/src/H5VLiod_attr.c index d14b7c0..6c00fdc 100644 --- a/src/H5VLiod_attr.c +++ b/src/H5VLiod_attr.c @@ -148,18 +148,18 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine, HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); /* insert object type metadata */ - if(H5VL_iod_insert_object_type(mdkv_oh, wtid, H5I_ATTR, NULL, NULL, NULL) < 0) + if(H5VL_iod_insert_object_type(mdkv_oh, wtid, H5I_ATTR, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* MSC - need to check size of datatype if it fits in entry otherwise create a BLOB */ /* insert datatype metadata */ - if(H5VL_iod_insert_datatype(mdkv_oh, wtid, input->type_id, NULL, NULL, NULL) < 0) + if(H5VL_iod_insert_datatype(mdkv_oh, wtid, input->type_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert dataspace metadata */ - if(H5VL_iod_insert_dataspace(mdkv_oh, wtid, input->space_id, NULL, NULL, NULL) < 0) + if(H5VL_iod_insert_dataspace(mdkv_oh, wtid, input->space_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* if the starting location is not the last component, need to @@ -188,7 +188,7 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine, /* insert new attribute in scratch pad of current object */ if(H5VL_iod_insert_new_link(attr_kv_oh, wtid, attr_name, - H5L_TYPE_HARD, &attr_id, NULL, NULL, NULL) < 0) + H5L_TYPE_HARD, &attr_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); output.iod_oh.rd_oh.cookie = attr_oh.rd_oh.cookie; @@ -991,7 +991,7 @@ H5VL_iod_server_attr_rename_cb(AXE_engine_t UNUSED axe_engine, /* insert attribute with new name */ if(H5VL_iod_insert_new_link(attr_kv_oh.wr_oh, wtid, new_name, - H5L_TYPE_HARD, &attr_id, NULL, NULL, NULL) < 0) + H5L_TYPE_HARD, &attr_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close the Attribute KV object */ diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c index fe2b363..9891090 100644 --- a/src/H5VLiod_dset.c +++ b/src/H5VLiod_dset.c @@ -272,17 +272,17 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, /* insert plist metadata */ if(H5VL_iod_insert_plist(mdkv_oh, wtid, dcpl_id, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh, wtid, (uint64_t)1, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert object type metadata */ if(H5VL_iod_insert_object_type(mdkv_oh, wtid, H5I_DATASET, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* MSC - need to check size of datatype if it fits in @@ -290,12 +290,12 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, /* insert datatype metadata */ if(H5VL_iod_insert_datatype(mdkv_oh, wtid, input->type_id, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert dataspace metadata */ if(H5VL_iod_insert_dataspace(mdkv_oh, wtid, space_id, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close the Metadata KV object */ @@ -306,7 +306,7 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, /* add link in parent group to current object */ if(H5VL_iod_insert_new_link(cur_oh.wr_oh, wtid, last_comp, - H5L_TYPE_HARD, &dset_id, NULL, NULL, NULL) < 0) + H5L_TYPE_HARD, &dset_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); @@ -1125,7 +1125,7 @@ H5VL_iod_server_dset_set_extent_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t iod_id = input->iod_id; iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; - //uint32_t cs_scope = input->cs_scope; + uint32_t cs_scope = input->cs_scope; iod_obj_id_t mdkv_id = input->mdkv_id; /* The ID of the metadata KV object */ /* int rank = input->dims.rank; rank of dataset */ hbool_t opened_locally = FALSE; @@ -1174,7 +1174,7 @@ H5VL_iod_server_dset_set_extent_cb(AXE_engine_t UNUSED axe_engine, /* insert dataspace metadata */ if(H5VL_iod_insert_dataspace(mdkv_oh, wtid, space_id, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close the metadata scratch pad */ diff --git a/src/H5VLiod_dtype.c b/src/H5VLiod_dtype.c index 8139cc9..29962ec 100644 --- a/src/H5VLiod_dtype.c +++ b/src/H5VLiod_dtype.c @@ -200,15 +200,15 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, free(file_desc); /* insert plist metadata */ - if(H5VL_iod_insert_plist(mdkv_oh, wtid, tcpl_id, NULL, NULL, NULL) < 0) + if(H5VL_iod_insert_plist(mdkv_oh, wtid, tcpl_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert link count metadata */ - if(H5VL_iod_insert_link_count(mdkv_oh, wtid, (uint64_t)1, NULL, NULL, NULL) < 0) + if(H5VL_iod_insert_link_count(mdkv_oh, wtid, (uint64_t)1, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert object type metadata */ - if(H5VL_iod_insert_object_type(mdkv_oh, wtid, H5I_DATATYPE, NULL, NULL, NULL) < 0) + if(H5VL_iod_insert_object_type(mdkv_oh, wtid, H5I_DATATYPE, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* store the datatype size */ @@ -233,7 +233,7 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, /* add link in parent group to current object */ if(H5VL_iod_insert_new_link(cur_oh.wr_oh, wtid, last_comp, - H5L_TYPE_HARD, &dtype_id, NULL, NULL, NULL) < 0) + H5L_TYPE_HARD, &dtype_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); output.iod_oh.rd_oh.cookie = dtype_oh.rd_oh.cookie; diff --git a/src/H5VLiod_file.c b/src/H5VLiod_file.c index edb91bc..119bbf8 100644 --- a/src/H5VLiod_file.c +++ b/src/H5VLiod_file.c @@ -67,21 +67,6 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, FUNC_ENTER_NOAPI_NOINIT - if(H5P_DEFAULT == input->fcpl_id) - input->fcpl_id = H5Pcopy(H5P_FILE_CREATE_DEFAULT); - fcpl_id = input->fcpl_id; - - /* get the scope for data integrity checks */ - if(H5Pget_ocpl_enable_checksum(fcpl_id, &enable_checksum) < 0) - HGOTO_ERROR2(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); - - if((cs_scope & H5_CHECKSUM_IOD) && enable_checksum) { - obj_create_hint = (iod_hint_list_t *)malloc(sizeof(iod_hint_list_t) + sizeof(iod_hint_t)); - obj_create_hint->num_hint = 1; - obj_create_hint->hint[0].key = "iod_obj_enable_checksum"; - obj_create_hint->hint[0].value = "iod_obj_enable_checksum"; - } - #if H5VL_IOD_DEBUG fprintf(stderr, "Start file create %s ", input->name); fprintf(stderr, "with MDKV %"PRIx64" ", mdkv_id), @@ -94,15 +79,31 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, if (input->flags&H5F_ACC_CREAT) mode |= IOD_CONT_CREATE; + if(H5P_DEFAULT == input->fcpl_id) + input->fcpl_id = H5Pcopy(H5P_FILE_CREATE_DEFAULT); + fcpl_id = input->fcpl_id; + if(H5Pget_metadata_integrity_scope(input->fapl_id, &cs_scope) < 0) HGOTO_ERROR2(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + if(H5Pget_ocpl_enable_checksum(fcpl_id, &enable_checksum) < 0) + HGOTO_ERROR2(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + + /* scratch pad integrity in the container */ if(cs_scope & H5_CHECKSUM_IOD) { con_open_hint = (iod_hint_list_t *)malloc(sizeof(iod_hint_list_t) + sizeof(iod_hint_t)); con_open_hint->num_hint = 1; con_open_hint->hint[0].key = "iod_con_scratch_cksum"; } + /* root group integrity */ + if((cs_scope & H5_CHECKSUM_IOD) && enable_checksum) { + obj_create_hint = (iod_hint_list_t *)malloc(sizeof(iod_hint_list_t) + sizeof(iod_hint_t)); + obj_create_hint->num_hint = 1; + obj_create_hint->hint[0].key = "iod_obj_enable_checksum"; + obj_create_hint->hint[0].value = "iod_obj_enable_checksum"; + } + /* Create the Container */ ret = iod_container_open(input->name, con_open_hint, mode, &coh, NULL); if(ret < 0) @@ -181,7 +182,7 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, HGOTO_ERROR_IOD(ret, FAIL, "can't open metadata KV"); /* insert plist metadata */ - if(H5VL_iod_insert_plist(mdkv_oh, first_tid, fcpl_id, NULL, NULL, NULL) < 0) + if(H5VL_iod_insert_plist(mdkv_oh, first_tid, fcpl_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTSET, FAIL, "can't insert link count KV value"); kv.value = &value; diff --git a/src/H5VLiod_group.c b/src/H5VLiod_group.c index 54a8a04..c604033 100644 --- a/src/H5VLiod_group.c +++ b/src/H5VLiod_group.c @@ -161,17 +161,17 @@ H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, /* insert plist metadata */ if(H5VL_iod_insert_plist(mdkv_oh, wtid, gcpl_id, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh, wtid, (uint64_t)1, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert object type metadata */ if(H5VL_iod_insert_object_type(mdkv_oh, wtid, H5I_GROUP, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close Metadata KV object */ @@ -181,8 +181,8 @@ H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, step --; /* add link in parent group to current object */ - if(H5VL_iod_insert_new_link(cur_oh.wr_oh, wtid, last_comp, - H5L_TYPE_HARD, &grp_id, NULL, NULL, NULL) < 0) + if(H5VL_iod_insert_new_link(cur_oh.wr_oh, wtid, last_comp, H5L_TYPE_HARD, + &grp_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); #if H5VL_IOD_DEBUG diff --git a/src/H5VLiod_link.c b/src/H5VLiod_link.c index 89d08d1..0e37c36 100644 --- a/src/H5VLiod_link.c +++ b/src/H5VLiod_link.c @@ -96,7 +96,7 @@ H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, /* 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, NULL, NULL, NULL) < 0) + H5L_TYPE_HARD, &target_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); if(input->target_loc_id != target_id) { @@ -133,7 +133,7 @@ H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh.wr_oh, wtid, link_count, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close the metadata scratch pad */ @@ -153,7 +153,7 @@ H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, /* add link in parent group to the source location */ if(H5VL_iod_insert_new_link(src_oh.wr_oh, wtid, src_last_comp, H5L_TYPE_SOFT, input->link_value, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); #if H5VL_IOD_DEBUG @@ -259,13 +259,13 @@ H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, 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, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, 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, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); } @@ -322,7 +322,7 @@ H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh.wr_oh, wtid, link_count, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close the metadata scratch pad */ @@ -798,7 +798,7 @@ H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, if(0 != link_count) { /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh.wr_oh, wtid, link_count, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); } diff --git a/src/H5VLiod_map.c b/src/H5VLiod_map.c index f451f12..b0c6257 100644 --- a/src/H5VLiod_map.c +++ b/src/H5VLiod_map.c @@ -160,27 +160,27 @@ H5VL_iod_server_map_create_cb(AXE_engine_t UNUSED axe_engine, /* insert plist metadata */ if(H5VL_iod_insert_plist(mdkv_oh, wtid, mcpl_id, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh, wtid, (uint64_t)1, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert object type metadata */ if(H5VL_iod_insert_object_type(mdkv_oh, wtid, H5I_MAP, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert Key datatype metadata */ if(H5VL_iod_insert_datatype_with_key(mdkv_oh, wtid, keytype, H5VL_IOD_KEY_MAP_KEY_TYPE, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert Value datatype metadata */ if(H5VL_iod_insert_datatype_with_key(mdkv_oh, wtid, valtype, H5VL_IOD_KEY_MAP_VALUE_TYPE, - NULL, NULL, NULL) < 0) + cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close MD KV object */ @@ -191,7 +191,7 @@ H5VL_iod_server_map_create_cb(AXE_engine_t UNUSED axe_engine, /* add link in parent group to current object */ if(H5VL_iod_insert_new_link(cur_oh.wr_oh, wtid, last_comp, - H5L_TYPE_HARD, &map_id, NULL, NULL, NULL) < 0) + H5L_TYPE_HARD, &map_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); #if H5VL_IOD_DEBUG diff --git a/src/H5VLiod_obj.c b/src/H5VLiod_obj.c index d5d171d..72b7f56 100644 --- a/src/H5VLiod_obj.c +++ b/src/H5VLiod_obj.c @@ -449,7 +449,7 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, /* Insert object in the destination path */ if(H5VL_iod_insert_new_link(dst_oh, wtid, new_name, - H5L_TYPE_HARD, &obj_id, NULL, NULL, NULL) < 0) + H5L_TYPE_HARD, &obj_id, cs_scope, NULL, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close dst group if it is not the location we started the diff --git a/src/H5VLiod_server.h b/src/H5VLiod_server.h index 1b004de..8af9ee3 100644 --- a/src/H5VLiod_server.h +++ b/src/H5VLiod_server.h @@ -394,21 +394,21 @@ H5_DLL herr_t H5VL_iod_server_open_path(iod_handle_t coh, iod_obj_id_t loc_id, /*out*/iod_handles_t *iod_oh); H5_DLL herr_t H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs); H5_DLL herr_t H5VL_iod_insert_plist(iod_handle_t oh, iod_trans_id_t tid, hid_t plist_id, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event); + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event); H5_DLL herr_t H5VL_iod_insert_link_count(iod_handle_t oh, iod_trans_id_t tid, uint64_t count, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event); + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event); H5_DLL herr_t H5VL_iod_insert_object_type(iod_handle_t oh, iod_trans_id_t tid, H5I_type_t obj_type, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event); + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event); H5_DLL herr_t H5VL_iod_insert_datatype(iod_handle_t oh, iod_trans_id_t tid, hid_t type_id, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event); + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event); H5_DLL herr_t H5VL_iod_insert_datatype_with_key(iod_handle_t oh, iod_trans_id_t tid, hid_t type_id, - const char *key, iod_hint_list_t *hints, - iod_checksum_t *cs, iod_event_t *event); + const char *key, uint32_t cs_scope, + iod_hint_list_t *hints, iod_event_t *event); H5_DLL herr_t H5VL_iod_insert_dataspace(iod_handle_t oh, iod_trans_id_t tid, hid_t space_id, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event); + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event); H5_DLL herr_t H5VL_iod_insert_new_link(iod_handle_t oh, iod_trans_id_t tid, const char *link_name, H5L_type_t link_type, const void *link_val, - iod_hint_list_t *hints, iod_checksum_t *cs, + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event); H5_DLL herr_t H5VL_iod_get_metadata(iod_handle_t oh, iod_trans_id_t tid, H5VL_iod_metadata_t md_type, const char *key, iod_checksum_t *cs, iod_event_t *event, void *ret); diff --git a/src/H5VLiod_util.c b/src/H5VLiod_util.c index df86b7f..9a30448 100644 --- a/src/H5VLiod_util.c +++ b/src/H5VLiod_util.c @@ -464,7 +464,7 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs) */ herr_t H5VL_iod_insert_plist(iod_handle_t oh, iod_trans_id_t tid, hid_t plist_id, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event) + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event) { char *key = NULL; void *value = NULL; @@ -490,8 +490,24 @@ H5VL_iod_insert_plist(iod_handle_t oh, iod_trans_id_t tid, hid_t plist_id, 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_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t cs[2]; + + cs[0] = H5_checksum_crc64(kv.key, kv.key_len); + cs[1] = H5_checksum_crc64(kv.value, kv.value_len); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "PLIST Checksums key = %016lX value = %016lX\n", cs[0], cs[1]); +#endif + + if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } + else { + if (iod_kv_set(oh, tid, hints, &kv, NULL, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } done: if(key) { @@ -520,7 +536,7 @@ done: */ herr_t H5VL_iod_insert_link_count(iod_handle_t oh, iod_trans_id_t tid, uint64_t count, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event) + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event) { char *key = NULL; iod_kv_t kv; @@ -535,8 +551,23 @@ H5VL_iod_insert_link_count(iod_handle_t oh, iod_trans_id_t tid, uint64_t count, kv.value = &count; kv.value_len = sizeof(uint64_t); - if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t cs[2]; + + cs[0] = H5_checksum_crc64(kv.key, kv.key_len); + cs[1] = H5_checksum_crc64(kv.value, kv.value_len); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Link Count Checksums key = %016lX value = %016lX\n", cs[0], cs[1]); +#endif + + if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } + else { + if (iod_kv_set(oh, tid, hints, &kv, NULL, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } done: if(key) { @@ -560,7 +591,7 @@ done: */ herr_t H5VL_iod_insert_object_type(iod_handle_t oh, iod_trans_id_t tid, H5I_type_t obj_type, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event) + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event) { char *key = NULL; iod_kv_t kv; @@ -575,8 +606,23 @@ H5VL_iod_insert_object_type(iod_handle_t oh, iod_trans_id_t tid, H5I_type_t obj_ kv.value = &obj_type; kv.value_len = sizeof(int32_t); - if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t cs[2]; + + cs[0] = H5_checksum_crc64(kv.key, kv.key_len); + cs[1] = H5_checksum_crc64(kv.value, kv.value_len); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Object Type Checksums key = %016lX value = %016lX\n", cs[0], cs[1]); +#endif + + if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } + else { + if (iod_kv_set(oh, tid, hints, &kv, NULL, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } done: if(key) { @@ -600,7 +646,7 @@ done: */ herr_t H5VL_iod_insert_datatype(iod_handle_t oh, iod_trans_id_t tid, hid_t type_id, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event) + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event) { char *key = NULL; void *value = NULL; @@ -626,9 +672,24 @@ H5VL_iod_insert_datatype(iod_handle_t oh, iod_trans_id_t tid, hid_t type_id, kv.key_len = (iod_size_t)strlen(key); kv.value = value; 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_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t cs[2]; + + cs[0] = H5_checksum_crc64(kv.key, kv.key_len); + cs[1] = H5_checksum_crc64(kv.value, kv.value_len); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Datatype Checksums key = %016lX value = %016lX\n", cs[0], cs[1]); +#endif + + if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } + else { + if (iod_kv_set(oh, tid, hints, &kv, NULL, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } done: if(key) { @@ -657,8 +718,8 @@ done: */ herr_t H5VL_iod_insert_datatype_with_key(iod_handle_t oh, iod_trans_id_t tid, hid_t type_id, - const char *key, iod_hint_list_t *hints, - iod_checksum_t *cs, iod_event_t *event) + const char *key, uint32_t cs_scope, iod_hint_list_t *hints, + iod_event_t *event) { void *value = NULL; iod_kv_t kv; @@ -680,9 +741,24 @@ H5VL_iod_insert_datatype_with_key(iod_handle_t oh, iod_trans_id_t tid, hid_t typ kv.key_len = (iod_size_t)strlen(key); kv.value = value; 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_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t cs[2]; + + cs[0] = H5_checksum_crc64(kv.key, kv.key_len); + cs[1] = H5_checksum_crc64(kv.value, kv.value_len); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Map Datatype Checksums key = %016lX value = %016lX\n", cs[0], cs[1]); +#endif + + if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } + else { + if (iod_kv_set(oh, tid, hints, &kv, NULL, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } done: if(value) { @@ -707,7 +783,7 @@ done: */ herr_t H5VL_iod_insert_dataspace(iod_handle_t oh, iod_trans_id_t tid, hid_t space_id, - iod_hint_list_t *hints, iod_checksum_t *cs, iod_event_t *event) + uint32_t cs_scope, iod_hint_list_t *hints, iod_event_t *event) { char *key = NULL; void *value = NULL; @@ -733,9 +809,24 @@ H5VL_iod_insert_dataspace(iod_handle_t oh, iod_trans_id_t tid, hid_t space_id, kv.key_len = (iod_size_t)strlen(key); kv.value = value; 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_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t cs[2]; + + cs[0] = H5_checksum_crc64(kv.key, kv.key_len); + cs[1] = H5_checksum_crc64(kv.value, kv.value_len); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Dataspace Checksums key = %016lX value = %016lX\n", cs[0], cs[1]); +#endif + + if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } + else { + if (iod_kv_set(oh, tid, hints, &kv, NULL, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } done: if(key) { @@ -764,8 +855,8 @@ done: */ herr_t H5VL_iod_insert_new_link(iod_handle_t oh, iod_trans_id_t tid, const char *link_name, - H5L_type_t link_type, const void *link_val, iod_hint_list_t *hints, - iod_checksum_t *cs, iod_event_t *event) + H5L_type_t link_type, const void *link_val, uint32_t cs_scope, + iod_hint_list_t *hints, iod_event_t *event) { iod_kv_t kv; void *value = NULL; @@ -812,8 +903,23 @@ H5VL_iod_insert_new_link(iod_handle_t oh, iod_trans_id_t tid, const char *link_n kv.value = value; kv.value_len = value_len; - if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t cs[2]; + + cs[0] = H5_checksum_crc64(kv.key, kv.key_len); + cs[1] = H5_checksum_crc64(kv.value, kv.value_len); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Link Type Checksums key = %016lX value = %016lX\n", cs[0], cs[1]); +#endif + + if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } + else { + if (iod_kv_set(oh, tid, hints, &kv, NULL, event) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + } done: @@ -953,6 +1059,7 @@ H5VL_iod_get_metadata(iod_handle_t oh, iod_trans_id_t tid, H5VL_iod_metadata_t m default: HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "invalide metadata type"); } + done: if(value) { free(value); |