diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2019-02-19 04:34:08 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2019-02-19 04:34:08 (GMT) |
commit | 463703366250bfbcf4f9aa0d27f41b8d8f7a1afe (patch) | |
tree | f327848b0784e07732308116ded0b2783691474b /src | |
parent | fedf16540c21c722cb1e6b2017ed5ef1417face7 (diff) | |
download | hdf5-463703366250bfbcf4f9aa0d27f41b8d8f7a1afe.zip hdf5-463703366250bfbcf4f9aa0d27f41b8d8f7a1afe.tar.gz hdf5-463703366250bfbcf4f9aa0d27f41b8d8f7a1afe.tar.bz2 |
rados_write_full calls now use write_ops.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5VLrados.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/H5VLrados.c b/src/H5VLrados.c index 4069d0b..bb0ef72 100644 --- a/src/H5VLrados.c +++ b/src/H5VLrados.c @@ -366,13 +366,36 @@ hbool_t ioctx_init_g = FALSE; static int H5VL_rados_write_full(rados_ioctx_t io, const char *oid, const char *buf, size_t len) { - int ret; + int ret = 0; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT +#ifdef OLD_RADOS_CALLS if((ret = rados_write_full(io, oid, buf, len)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't write metadata to object: %s", strerror(-ret)) +#else +{ + rados_write_op_t write_op; + hbool_t write_op_init = FALSE; + + /* Create write op */ + if(NULL == (write_op = rados_create_write_op())) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create write operation") + write_op_init = TRUE; + + /* Add the write full operation (returns void) */ + rados_write_op_write_full(write_op, buf, len); + + /* Execute write operation */ + if((ret = rados_write_op_operate(write_op, io, oid, NULL, LIBRADOS_OPERATION_NOFLAG)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't perform write operation: %s", strerror(-ret)) + + /* clean up */ + if(write_op_init) + rados_release_write_op(write_op); +} +#endif done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_rados_write_full() */ |