summaryrefslogtreecommitdiffstats
path: root/src/H5Dvirtual.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-10-27 06:33:07 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-10-27 06:33:07 (GMT)
commit6e84fd8327138e48bd515665c1919bc8cf22dc9f (patch)
tree8e1db3902adcb85df26dd92fd5a7c7eeeee3eb6f /src/H5Dvirtual.c
parentce3d1ec9ea5a7a0627d948687d64dc7e5e76f6cd (diff)
downloadhdf5-6e84fd8327138e48bd515665c1919bc8cf22dc9f.zip
hdf5-6e84fd8327138e48bd515665c1919bc8cf22dc9f.tar.gz
hdf5-6e84fd8327138e48bd515665c1919bc8cf22dc9f.tar.bz2
Remove virtual dataset refresh code's direct use of native VOL plugin's ID.
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() */
/*-------------------------------------------------------------------------