summaryrefslogtreecommitdiffstats
path: root/src/H5VLiod_attr.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2013-09-19 23:41:05 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2013-09-19 23:41:05 (GMT)
commit32ec6c6568fc611a2d16a0c42f88c10d150573af (patch)
tree2398d0ef75590b0bcf9b6540d12774cf254a67fc /src/H5VLiod_attr.c
parent359d51effedde76636e0a65f0580b6bcfcb5753d (diff)
downloadhdf5-32ec6c6568fc611a2d16a0c42f88c10d150573af.zip
hdf5-32ec6c6568fc611a2d16a0c42f88c10d150573af.tar.gz
hdf5-32ec6c6568fc611a2d16a0c42f88c10d150573af.tar.bz2
[svn-r24173] - update checksum verification to check for properties for enabling/disabling checksums.
- done for raw data, scratch pads. to do KV pairs.
Diffstat (limited to 'src/H5VLiod_attr.c')
-rw-r--r--src/H5VLiod_attr.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/src/H5VLiod_attr.c b/src/H5VLiod_attr.c
index 9f4a8f9..da25cb6 100644
--- a/src/H5VLiod_attr.c
+++ b/src/H5VLiod_attr.c
@@ -53,6 +53,7 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine,
iod_obj_id_t attr_id = input->attr_id; /* The ID of the attribute that needs to be created */
iod_trans_id_t wtid = input->trans_num;
iod_trans_id_t rtid = input->rcxt_num;
+ uint32_t cs_scope = input->cs_scope;
iod_handle_t attr_oh, attr_kv_oh, obj_oh, mdkv_oh; /* object handles */
iod_obj_id_t obj_id, mdkv_id;
const char *loc_name = input->path; /* path to start hierarchy traversal */
@@ -103,8 +104,6 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine,
/* for the process that succeeded in creating the attribute, update
the parent scratch pad, create attribute scratch pad */
if(0 == ret) {
- iod_checksum_t sp_cs;
-
/* create the metadata KV object for the attribute */
if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_KV,
NULL, NULL, &mdkv_id, NULL) < 0)
@@ -115,11 +114,19 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine,
sp[1] = IOD_ID_UNDEFINED;
sp[2] = IOD_ID_UNDEFINED;
sp[3] = IOD_ID_UNDEFINED;
- sp_cs = H5checksum(&sp, sizeof(sp), NULL);
/* set scratch pad in attribute */
- if (iod_obj_set_scratch(attr_oh, wtid, &sp, &sp_cs, NULL) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad");
+ if(cs_scope & H5_CHECKSUM_IOD) {
+ iod_checksum_t sp_cs;
+
+ sp_cs = H5checksum(&sp, sizeof(sp), NULL);
+ if (iod_obj_set_scratch(attr_oh, wtid, &sp, &sp_cs, NULL) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad");
+ }
+ else {
+ if (iod_obj_set_scratch(attr_oh, wtid, &sp, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad");
+ }
/* Open Metadata KV object for write */
if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0)
@@ -150,7 +157,7 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine,
if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object");
- if(sp_cs) {
+ if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) {
/* verify scratch pad integrity */
if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check");
@@ -237,6 +244,7 @@ H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine,
iod_handle_t loc_handle = input->loc_oh; /* location handle to start traversal */
iod_obj_id_t loc_id = input->loc_id; /* location ID */
iod_trans_id_t rtid = input->rcxt_num;
+ uint32_t cs_scope = input->cs_scope;
iod_handle_t attr_kv_oh, attr_oh, obj_oh, mdkv_oh;
iod_obj_id_t obj_id;
iod_obj_id_t attr_id;
@@ -262,7 +270,7 @@ H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine,
if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object");
- if(sp_cs) {
+ if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) {
/* verify scratch pad integrity */
if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check");
@@ -303,7 +311,7 @@ H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine,
if(iod_obj_get_scratch(attr_oh, rtid, &sp, &sp_cs, NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object");
- if(sp_cs) {
+ if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) {
/* verify scratch pad integrity */
if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check");
@@ -405,6 +413,7 @@ H5VL_iod_server_attr_read_cb(AXE_engine_t UNUSED axe_engine,
hid_t type_id = input->type_id; /* datatype ID of data */
hid_t space_id = input->space_id; /* dataspace of attribute */
iod_trans_id_t rtid = input->rcxt_num;
+ uint32_t cs_scope = input->cs_scope;
hg_bulk_block_t bulk_block_handle; /* HG block handle */
hg_bulk_request_t bulk_request; /* HG request */
iod_mem_desc_t *mem_desc = NULL; /* memory descriptor used for reading array */
@@ -441,7 +450,7 @@ H5VL_iod_server_attr_read_cb(AXE_engine_t UNUSED axe_engine,
if(iod_obj_get_scratch(iod_oh, rtid, &sp, &sp_cs, NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object");
- if(sp_cs) {
+ if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) {
/* verify scratch pad integrity */
if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check");
@@ -580,6 +589,7 @@ H5VL_iod_server_attr_write_cb(AXE_engine_t UNUSED axe_engine,
hid_t space_id = input->space_id; /* dataspace of attribute */
iod_trans_id_t wtid = input->trans_num;
iod_trans_id_t rtid = input->rcxt_num;
+ uint32_t cs_scope = input->cs_scope;
hg_bulk_block_t bulk_block_handle; /* HG block handle */
hg_bulk_request_t bulk_request; /* HG request */
iod_mem_desc_t *mem_desc; /* memory descriptor used for writing array */
@@ -640,7 +650,7 @@ H5VL_iod_server_attr_write_cb(AXE_engine_t UNUSED axe_engine,
if(iod_obj_get_scratch(iod_oh, rtid, &sp, &sp_cs, NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object");
- if(sp_cs) {
+ if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) {
/* verify scratch pad integrity */
if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check");
@@ -748,6 +758,7 @@ H5VL_iod_server_attr_exists_cb(AXE_engine_t UNUSED axe_engine,
iod_handle_t loc_handle = input->loc_oh; /* location handle to start lookup */
iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */
iod_trans_id_t rtid = input->rcxt_num;
+ uint32_t cs_scope = input->cs_scope;
iod_handle_t obj_oh; /* current object handle accessed */
iod_handle_t attr_kv_oh; /* KV handle holding attributes for object */
iod_obj_id_t obj_id;
@@ -773,7 +784,7 @@ H5VL_iod_server_attr_exists_cb(AXE_engine_t UNUSED axe_engine,
if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object");
- if(sp_cs) {
+ if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) {
/* verify scratch pad integrity */
if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check");
@@ -862,6 +873,7 @@ H5VL_iod_server_attr_rename_cb(AXE_engine_t UNUSED axe_engine,
const char *new_name = input->new_attr_name;
iod_trans_id_t wtid = input->trans_num;
iod_trans_id_t rtid = input->rcxt_num;
+ uint32_t cs_scope = input->cs_scope;
iod_kv_params_t kvs; /* KV lists for objects - used to unlink attribute object */
iod_kv_t kv; /* KV entry */
H5VL_iod_link_t iod_link;
@@ -883,7 +895,7 @@ H5VL_iod_server_attr_rename_cb(AXE_engine_t UNUSED axe_engine,
if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object");
- if(sp_cs) {
+ if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) {
/* verify scratch pad integrity */
if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check");
@@ -979,6 +991,7 @@ H5VL_iod_server_attr_remove_cb(AXE_engine_t UNUSED axe_engine,
const char *attr_name = input->attr_name; /* attribute's name */
iod_trans_id_t wtid = input->trans_num;
iod_trans_id_t rtid = input->rcxt_num;
+ uint32_t cs_scope = input->cs_scope;
iod_kv_params_t kvs;
iod_kv_t kv;
H5VL_iod_link_t iod_link;
@@ -1000,7 +1013,7 @@ H5VL_iod_server_attr_remove_cb(AXE_engine_t UNUSED axe_engine,
if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object");
- if(sp_cs) {
+ if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) {
/* verify scratch pad integrity */
if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check");