Skip to content

Commit

Permalink
Set DXPL in API context for native VOL attribute I/O calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF committed Mar 24, 2024
1 parent cdc5112 commit a1735ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/H5VLint.c
Original file line number Diff line number Diff line change
Expand Up @@ -2249,7 +2249,7 @@ H5VL_set_vol_wrapper(const H5VL_object_t *vol_obj)
vol_wrap_ctx->obj_wrap_ctx = obj_wrap_ctx;
} /* end if */
else
/* Incremeent ref count on existing wrapper context */
/* Increment ref count on existing wrapper context */
vol_wrap_ctx->rc++;

/* Save the wrapper context */
Expand Down
13 changes: 9 additions & 4 deletions src/H5VLnative_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Apkg.h" /* Attributes */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
#include "H5Gprivate.h" /* Groups */
Expand Down Expand Up @@ -195,8 +196,7 @@ H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const cha
*-------------------------------------------------------------------------
*/
herr_t
H5VL__native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t H5_ATTR_UNUSED dxpl_id,
void H5_ATTR_UNUSED **req)
H5VL__native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t dxpl_id, void H5_ATTR_UNUSED **req)
{
H5T_t *mem_type; /* Memory datatype */
herr_t ret_value; /* Return value */
Expand All @@ -206,6 +206,9 @@ H5VL__native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t H5_ATTR_UNUS
if (NULL == (mem_type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype");

/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);

/* Go write the actual data to the attribute */
if ((ret_value = H5A__read((H5A_t *)attr, mem_type, buf)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute");
Expand All @@ -224,8 +227,7 @@ H5VL__native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t H5_ATTR_UNUS
*-------------------------------------------------------------------------
*/
herr_t
H5VL__native_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t H5_ATTR_UNUSED dxpl_id,
void H5_ATTR_UNUSED **req)
H5VL__native_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t dxpl_id, void H5_ATTR_UNUSED **req)
{
H5T_t *mem_type; /* Memory datatype */
herr_t ret_value; /* Return value */
Expand All @@ -235,6 +237,9 @@ H5VL__native_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t H5_AT
if (NULL == (mem_type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype");

/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);

/* Go write the actual data to the attribute */
if ((ret_value = H5A__write((H5A_t *)attr, mem_type, buf)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute");
Expand Down

0 comments on commit a1735ed

Please sign in to comment.