diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2018-10-10 21:26:21 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2018-10-10 21:26:21 (GMT) |
commit | 39b3b52a941dd5e012e5a472ef940d624941833b (patch) | |
tree | de3cb2001c62b76a89837ff1e90044574d71f19d /src/H5Dvirtual.c | |
parent | 471150151d29eeb806333a8db41fefc9dfb452bb (diff) | |
parent | e962df1591bc6eaee5b9e318de83b9c6698bc7b6 (diff) | |
download | hdf5-39b3b52a941dd5e012e5a472ef940d624941833b.zip hdf5-39b3b52a941dd5e012e5a472ef940d624941833b.tar.gz hdf5-39b3b52a941dd5e012e5a472ef940d624941833b.tar.bz2 |
Merge pull request #1291 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:vol_squash to develop
* commit 'e962df1591bc6eaee5b9e318de83b9c6698bc7b6':
VOL FEATURE
Diffstat (limited to 'src/H5Dvirtual.c')
-rw-r--r-- | src/H5Dvirtual.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 8867492..89974b2 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -58,7 +58,8 @@ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property Lists */ #include "H5Sprivate.h" /* Dataspaces */ - +#include "H5VLnative.h" /* Native VOL driver */ +#include "H5VLprivate.h" /* Virtual Object Layer */ /****************/ /* Local Macros */ @@ -2961,27 +2962,38 @@ done: static herr_t H5D__virtual_refresh_source_dset(H5D_t **dset) { - hid_t temp_id; /* Temporary dataset identifier */ - herr_t ret_value = SUCCEED; /* Return value */ + 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 */ FUNC_ENTER_STATIC /* Sanity check */ HDassert(dset && *dset); + /* Get the native VOL driver's ID */ + 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 = H5I_register(H5I_DATASET, *dset, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register source dataset ID") + if((temp_id = H5VL_object_register(*dset, H5I_DATASET, native_vol_id, FALSE)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register (temporary) source dataset ID") /* Refresh source dataset */ if(H5D__refresh(temp_id, *dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh source dataset") /* Discard the identifier & replace the dataset */ - if(NULL == (*dset = (H5D_t *)H5I_remove(temp_id))) + 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); + vol_obj->data = NULL; done: + if(vol_obj && H5VL_free_object(vol_obj) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to free VOL object") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_refresh_source_dsets() */ |