summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2014-08-05 20:07:22 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2016-11-29 23:42:29 (GMT)
commit311095ec1030a83676e389527878be047a1405ca (patch)
tree86e296d2a6c1f406ee382a80d3c83bca06d597da
parent0c0a8f59c2e39f4fb5f0c5b140c24ab6f5e27cc8 (diff)
downloadhdf5-311095ec1030a83676e389527878be047a1405ca.zip
hdf5-311095ec1030a83676e389527878be047a1405ca.tar.gz
hdf5-311095ec1030a83676e389527878be047a1405ca.tar.bz2
Add back index pre/post_update callbacks
-rw-r--r--src/H5Dio.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index c0aa83e..1444f72 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -233,6 +233,17 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms")
+ /* Call index pre_update if available */
+ if (dset->shared->idx_class) {
+ H5X_class_t *idx_class = dset->shared->idx_class;
+ void *idx_handle = dset->shared->idx_handle;
+ hid_t xxpl_id = H5P_INDEX_XFER_DEFAULT;
+
+ if (idx_class->pre_update &&
+ (FAIL == idx_class->pre_update(idx_handle, file_space_id, xxpl_id)))
+ HGOTO_ERROR(H5E_INDEX, H5E_CANTUPDATE, FAIL, "cannot do an index pre-update");
+ }
+
/* Get the dataset transfer property list */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
@@ -344,6 +355,20 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id,
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data")
} /* end else */
+ /* Call index post_update if available */
+ if (dset->shared->idx_class) {
+ H5X_class_t *idx_class = dset->shared->idx_class;
+ void *idx_handle = dset->shared->idx_handle;
+ hid_t xxpl_id = H5P_INDEX_XFER_DEFAULT;
+
+ if (idx_class->post_update &&
+ (FAIL == idx_class->post_update(idx_handle, buf, file_space_id, xxpl_id)))
+ HGOTO_ERROR(H5E_INDEX, H5E_CANTUPDATE, FAIL, "cannot do an index post-update");
+// if (idx_class->refresh &&
+// (FAIL == idx_class->refresh(idx_handle, &metadata_size, &metadata)))
+// HGOTO_ERROR(H5E_INDEX, H5E_CANTUPDATE, FAIL, "cannot do an index refresh");
+ }
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__pre_write() */