summaryrefslogtreecommitdiffstats
path: root/src/H5Dvirtual.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Dvirtual.c')
-rw-r--r--src/H5Dvirtual.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index 7d127c2..3dc44c5 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -2963,7 +2963,6 @@ static herr_t
H5D__virtual_refresh_source_dset(H5D_t **dset)
{
hid_t temp_id = H5I_INVALID_HID; /* Temporary dataset identifier */
- hid_t native_vol_id = H5I_INVALID_HID; /* ID for the native VOL driver */
H5VL_object_t *vol_obj = NULL; /* VOL object stored with the ID */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2972,13 +2971,16 @@ H5D__virtual_refresh_source_dset(H5D_t **dset)
/* Sanity check */
HDassert(dset && *dset);
- /* Get the native VOL driver's ID */
-/* XXX (VOL MERGE): Need a better solution than this */
- if((native_vol_id = H5VL_native_get_driver_id()) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get native VOL driver ID")
-
/* Get a temporary identifier for this source dataset */
- if((temp_id = H5VL_register_using_vol_id(H5I_DATASET, *dset, native_vol_id, FALSE)) < 0)
+{
+void *vol_wrap_ctx = NULL; /* Object wrapping context */
+
+/* Retrieve the VOL object wrap context */
+if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL object wrap context")
+HDassert(vol_wrap_ctx);
+}
+ if((temp_id = H5VL_wrap_register(H5I_DATASET, *dset, FALSE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register (temporary) source dataset ID")
/* Refresh source dataset */
@@ -2988,7 +2990,8 @@ H5D__virtual_refresh_source_dset(H5D_t **dset)
/* Discard the identifier & replace the dataset */
if(NULL == (vol_obj = (H5VL_object_t *)H5I_remove(temp_id)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "can't unregister source dataset ID")
- *dset = (H5D_t *)(vol_obj->data);
+ if(NULL == (*dset = (H5D_t *)H5VL_object_data(vol_obj)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve library object from VOL object")
vol_obj->data = NULL;
done:
@@ -2996,7 +2999,7 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to free VOL object")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D__virtual_refresh_source_dsets() */
+} /* end H5D__virtual_refresh_source_dset() */
/*-------------------------------------------------------------------------