summaryrefslogtreecommitdiffstats
path: root/src/H5R.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5R.c')
-rw-r--r--src/H5R.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/H5R.c b/src/H5R.c
index 3e6517f..a52f35b 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -93,6 +93,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t
{
H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */
H5VL_loc_params_t loc_params;
+ hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -126,13 +127,22 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t
if(H5CX_set_loc(loc_id) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set wrapper info in API context */
+ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
+ vol_wrapper_set = TRUE;
+
/* Create reference */
- if((ret_value = H5VL_object_specific(vol_obj->data, loc_params, vol_obj->driver->cls, H5VL_REF_CREATE,
+ if((ret_value = H5VL_object_specific(vol_obj->data, loc_params, vol_obj->plugin->cls, H5VL_REF_CREATE,
H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
ref, name, ref_type, space_id)) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create reference")
done:
+ /* Reset object wrapping info in API context */
+ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info")
+
FUNC_LEAVE_API(ret_value)
} /* end H5Rcreate() */
@@ -200,11 +210,11 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r
loc_params.obj_type = H5I_get_type(obj_id);
/* Dereference */
- if(NULL == (opened_obj = H5VL_object_open(vol_obj->data, loc_params, vol_obj->driver->cls,
+ if(NULL == (opened_obj = H5VL_object_open(vol_obj->data, loc_params, vol_obj->plugin->cls,
&opened_type, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to dereference object")
- if((ret_value = H5VL_register_id(opened_type, opened_obj, vol_obj->driver, TRUE)) < 0)
+ if((ret_value = H5VL_register_id(opened_type, opened_obj, vol_obj->plugin, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle")
done:
@@ -260,7 +270,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid file identifier")
/* Get the dataspace with the correct region selected */
- if(H5VL_object_get(vol_obj->data, loc_params, vol_obj->driver->cls, H5VL_REF_GET_REGION,
+ if(H5VL_object_get(vol_obj->data, loc_params, vol_obj->plugin->cls, H5VL_REF_GET_REGION,
H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value, ref_type, ref) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "unable to retrieve dataspace")
@@ -318,7 +328,7 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
/* Get the object type */
- if(H5VL_object_get(vol_obj->data, loc_params, vol_obj->driver->cls,
+ if(H5VL_object_get(vol_obj->data, loc_params, vol_obj->plugin->cls,
H5VL_REF_GET_TYPE, H5P_DATASET_XFER_DEFAULT,
H5_REQUEST_NULL, obj_type, ref_type, ref) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object type")
@@ -367,6 +377,7 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name,
{
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
+ hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
@@ -386,13 +397,22 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name,
if(NULL == (vol_obj = (H5VL_object_t *)H5I_object(id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid file identifier")
+ /* Set wrapper info in API context */
+ if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
+ vol_wrapper_set = TRUE;
+
/* Get name */
- if(H5VL_object_get(vol_obj->data, loc_params, vol_obj->driver->cls, H5VL_REF_GET_NAME,
+ if(H5VL_object_get(vol_obj->data, loc_params, vol_obj->plugin->cls, H5VL_REF_GET_NAME,
H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
&ret_value, name, size, ref_type, _ref) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "unable to determine object path")
done:
+ /* Reset object wrapping info in API context */
+ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't reset VOL wrapper info")
+
FUNC_LEAVE_API(ret_value)
} /* end H5Rget_name() */