summaryrefslogtreecommitdiffstats
path: root/src/H5Rdeprec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Rdeprec.c')
-rw-r--r--src/H5Rdeprec.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c
index d0c79a8..e6d8d21 100644
--- a/src/H5Rdeprec.c
+++ b/src/H5Rdeprec.c
@@ -47,6 +47,7 @@
#include "H5Oprivate.h" /* Object headers */
#include "H5Rpkg.h" /* References */
#include "H5Ppublic.h" /* for using H5P_DATASET_ACCESS_DEFAULT */
+#include "H5VLprivate.h" /* VOL plugins */
#ifndef H5_NO_DEPRECATED_SYMBOLS
/****************/
@@ -132,7 +133,6 @@ H5R_init_deprec_interface(void)
H5G_obj_t
H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
{
- H5G_loc_t loc; /* Object location */
H5O_type_t obj_type; /* Object type */
H5G_obj_t ret_value; /* Return value */
@@ -140,16 +140,14 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
H5TRACE3("Go", "iRt*x", id, ref_type, ref);
/* Check args */
- if(H5G_loc(id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location")
if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference type")
if(ref == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference pointer")
- /* Get the object information */
- if(H5R_get_obj_type(loc.oloc->file, H5AC_ind_dxpl_id, ref_type, ref, &obj_type) < 0)
- HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type")
+ /* get the object type through the VOL */
+ if((ret_value = H5VL_object_get(id, H5VL_REF_GET_TYPE, H5_REQUEST_NULL, &obj_type, ref_type, ref)) < 0)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info")
/* Set return value */
ret_value = H5G_map_obj_type(obj_type);
@@ -184,29 +182,34 @@ done:
hid_t
H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref)
{
- H5G_loc_t loc; /* Group location */
- H5F_t *file = NULL; /* File object */
+ void *location = NULL; /* a pointer to VOL specific token that indicates
+ the location of the object */
hid_t ret_value;
FUNC_ENTER_API(FAIL)
H5TRACE3("i", "iRt*x", obj_id, ref_type, _ref);
/* Check args */
- if(H5G_loc(obj_id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type")
if(_ref == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer")
- /* Get the file pointer from the entry */
- file = loc.oloc->file;
+ /* Get the token for the Object location through the VOL */
+ if(H5VL_object_lookup (obj_id, H5VL_OBJECT_LOOKUP_BY_REF, &location, H5_REQUEST_NULL,
+ ref_type, _ref) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object")
- /* Create reference */
- if((ret_value = H5R_dereference(file, H5P_DATASET_ACCESS_DEFAULT, H5AC_dxpl_id, ref_type, _ref, TRUE)) < 0)
- HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object")
+ /* Open the object through the VOL */
+ if((ret_value = H5VL_object_open_by_loc(obj_id, location, H5P_DATASET_ACCESS_DEFAULT, H5_REQUEST_NULL)) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open object")
done:
+ if (NULL != location) {
+ /* free the location token through the VOL */
+ if(H5VL_object_free_loc (obj_id, location, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to free location token")
+ }
FUNC_LEAVE_API(ret_value)
} /* end H5Rdereference1() */