diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-09-05 21:36:55 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-09-05 21:36:55 (GMT) |
commit | 05d51c036140f94a07efb75aab9675b3b4bd5ef0 (patch) | |
tree | 5fe046db1c355df5c771077164ba6d6c1f272866 /src/H5A.c | |
parent | f2e6cec0728a75f5982e3b6d91f0ce823d1206a6 (diff) | |
download | hdf5-05d51c036140f94a07efb75aab9675b3b4bd5ef0.zip hdf5-05d51c036140f94a07efb75aab9675b3b4bd5ef0.tar.gz hdf5-05d51c036140f94a07efb75aab9675b3b4bd5ef0.tar.bz2 |
[svn-r25575] cleanup H5I usage in VOL by removing the use of the aux pointer and
make a higher level wrapper object around all VOL objects that
includes the VOL information.
Diffstat (limited to 'src/H5A.c')
-rw-r--r-- | src/H5A.c | 407 |
1 files changed, 151 insertions, 256 deletions
@@ -93,8 +93,7 @@ static const H5I_class_t H5I_ATTR_CLS[1] = {{ H5I_ATTR, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - NULL, /* Callback routine for closing objects of this class */ - (H5I_free2_t)H5A_close_attr /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5A_close_attr /* Callback routine for closing objects of this class */ }}; @@ -233,12 +232,11 @@ hid_t H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t UNUSED aapl_id) { - void *attr = NULL; /* attr token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5P_genplist_t *plist; /* Property list pointer */ + void *attr = NULL; /* attr token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ + H5P_genplist_t *plist; /* Property list pointer */ H5VL_loc_params_t loc_params; - hid_t ret_value; /* Return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("i", "i*siiii", loc_id, attr_name, type_id, space_id, acpl_id, aapl_id); @@ -266,25 +264,22 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = H5VL_get_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the attribute through the VOL */ - if(NULL == (attr = H5VL_attr_create(obj, loc_params, vol_plugin->cls, attr_name, acpl_id, aapl_id, - H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (attr = H5VL_attr_create(obj->vol_obj, loc_params, obj->vol_info->vol_cls, attr_name, + acpl_id, aapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create attribute") - /* Get an atom for the attribute with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") + /* Get an atom for the attribute */ + if((ret_value = H5VL_register_id(H5I_ATTR, attr, obj->vol_info, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") done: if (ret_value < 0 && attr) - if(H5VL_attr_close(attr, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_attr_close(attr, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "unable to release attr") FUNC_LEAVE_API(ret_value) @@ -327,12 +322,11 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id) { - void *attr = NULL; /* attr token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5P_genplist_t *plist; /* Property list pointer */ + void *attr = NULL; /* attr token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ + H5P_genplist_t *plist; /* Property list pointer */ H5VL_loc_params_t loc_params; - hid_t ret_value; /* Return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE8("i", "i*s*siiiii", loc_id, obj_name, attr_name, type_id, space_id, @@ -365,26 +359,22 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, loc_params.loc_data.loc_by_name.name = obj_name; loc_params.loc_data.loc_by_name.lapl_id = lapl_id; - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = H5VL_get_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the attribute through the VOL */ - if(NULL == (attr = H5VL_attr_create(obj, loc_params, vol_plugin->cls, attr_name, acpl_id, - aapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (attr = H5VL_attr_create(obj->vol_obj, loc_params, obj->vol_info->vol_cls, attr_name, + acpl_id, aapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create attribute") - /* Get an atom for the attribute with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + /* Get an atom for the attribute */ + if((ret_value = H5VL_register_id(H5I_ATTR, attr, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") done: if (ret_value < 0 && attr) - if(H5VL_attr_close (attr, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_attr_close (attr, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "unable to release attr") FUNC_LEAVE_API(ret_value) } /* H5Acreate_by_name() */ @@ -412,11 +402,10 @@ done: hid_t H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) { - void *attr = NULL; /* attr token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *attr = NULL; /* attr token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - hid_t ret_value; + hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, attr_name, aapl_id); @@ -430,26 +419,22 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = H5VL_get_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - /* Create the attribute through the VOL */ - if(NULL == (attr = H5VL_attr_open(obj, loc_params, vol_plugin->cls, attr_name, aapl_id, - H5AC_ind_dxpl_id, H5_REQUEST_NULL))) + /* Open the attribute through the VOL */ + if(NULL == (attr = H5VL_attr_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + attr_name, aapl_id, H5AC_ind_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") - /* Get an atom for the attribute with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + /* Get an atom for the attribute */ + if((ret_value = H5VL_register_id(H5I_ATTR, attr, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") done: if (ret_value < 0 && attr) - if(H5VL_attr_close (attr, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_attr_close (attr, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "unable to release attr") FUNC_LEAVE_API(ret_value) } /* H5Aopen() */ @@ -480,11 +465,10 @@ hid_t H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, hid_t lapl_id) { - void *attr = NULL; /* attr token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5VL_loc_params_t loc_params; - hid_t ret_value; + void *attr = NULL; /* attr token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ + H5VL_loc_params_t loc_params; + hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE5("i", "i*s*sii", loc_id, obj_name, attr_name, aapl_id, lapl_id); @@ -507,27 +491,24 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, loc_params.loc_data.loc_by_name.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + /* get the location object */ + if(NULL == (obj = H5VL_get_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - /* Create the attribute through the VOL */ - if(NULL == (attr = H5VL_attr_open(obj, loc_params, vol_plugin->cls, attr_name, aapl_id, - H5AC_ind_dxpl_id, H5_REQUEST_NULL))) + /* Open the attribute through the VOL */ + if(NULL == (attr = H5VL_attr_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + attr_name, aapl_id, H5AC_ind_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") - /* Get an atom for the attribute with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + /* Get an atom for the attribute */ + if((ret_value = H5VL_register_id(H5I_ATTR, attr, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") done: if (ret_value < 0 && attr) - if(H5VL_attr_close (attr, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_attr_close (attr, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "unable to release attr") + FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_name() */ @@ -560,11 +541,10 @@ hid_t H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t aapl_id, hid_t lapl_id) { - void *attr = NULL; /* attr token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5VL_loc_params_t loc_params; - hid_t ret_value; /* Return value */ + void *attr = NULL; /* attr token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ + H5VL_loc_params_t loc_params; + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE7("i", "i*sIiIohii", loc_id, obj_name, idx_type, order, n, aapl_id, @@ -593,26 +573,22 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, loc_params.loc_data.loc_by_idx.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + /* get the location object */ + if(NULL == (obj = H5VL_get_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - /* Create the attribute through the VOL */ - if(NULL == (attr = H5VL_attr_open(obj, loc_params, vol_plugin->cls, NULL, aapl_id, - H5AC_ind_dxpl_id, H5_REQUEST_NULL))) + /* Open the attribute through the VOL */ + if(NULL == (attr = H5VL_attr_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + NULL, aapl_id, H5AC_ind_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") - /* Get an atom for the attribute with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + /* Get an atom for the attribute */ + if((ret_value = H5VL_register_id(H5I_ATTR, attr, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") done: if (ret_value < 0 && attr) - if(H5VL_attr_close (attr, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_attr_close (attr, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "unable to release attr") FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_idx() */ @@ -637,25 +613,21 @@ done: herr_t H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) { - H5VL_t *vol_plugin; - void *attr; + H5VL_object_t *attr; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii*x", attr_id, dtype_id, buf); /* check arguments */ - if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* write the data through the VOL */ - if((ret_value = H5VL_attr_write(attr, vol_plugin->cls, dtype_id, buf, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_attr_write(attr->vol_obj, attr->vol_info->vol_cls, + dtype_id, buf, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "can't read data") done: @@ -682,25 +654,21 @@ done: herr_t H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) { - H5VL_t *vol_plugin; - void *attr; + H5VL_object_t *attr; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii*x", attr_id, dtype_id, buf); /* check arguments */ - if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* Read the data through the VOL */ - if((ret_value = H5VL_attr_read(attr, vol_plugin->cls, dtype_id, buf, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_attr_read(attr->vol_obj, attr->vol_info->vol_cls, + dtype_id, buf, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "can't read data") done: @@ -727,23 +695,19 @@ done: hid_t H5Aget_space(hid_t attr_id) { - H5VL_t *vol_plugin; - void *attr; + H5VL_object_t *attr; hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", attr_id); /* check arguments */ - if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the dataspace through the VOL */ - if(H5VL_attr_get(attr, vol_plugin->cls, H5VL_ATTR_GET_SPACE, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) + if(H5VL_attr_get(attr->vol_obj, attr->vol_info->vol_cls, H5VL_ATTR_GET_SPACE, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get data space") done: @@ -770,23 +734,19 @@ done: hid_t H5Aget_type(hid_t attr_id) { - H5VL_t *vol_plugin; - void *attr; + H5VL_object_t *attr; hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", attr_id); /* check arguments */ - if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the datatype through the VOL */ - if(H5VL_attr_get(attr, vol_plugin->cls, H5VL_ATTR_GET_TYPE, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) + if(H5VL_attr_get(attr->vol_obj, attr->vol_info->vol_cls, H5VL_ATTR_GET_TYPE, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get type") done: @@ -816,8 +776,7 @@ done: hid_t H5Aget_create_plist(hid_t attr_id) { - H5VL_t *vol_plugin; - void *attr; + H5VL_object_t *attr; hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -826,16 +785,12 @@ H5Aget_create_plist(hid_t attr_id) HDassert(H5P_LST_ATTRIBUTE_CREATE_ID_g != -1); /* check arguments */ - if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the acpl through the VOL */ - if(H5VL_attr_get(attr, vol_plugin->cls, H5VL_ATTR_GET_ACPL, H5AC_dxpl_id, - H5_REQUEST_NULL, &ret_value) < 0) + if(H5VL_attr_get(attr->vol_obj, attr->vol_info->vol_cls, H5VL_ATTR_GET_ACPL, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get acpl") done: @@ -867,8 +822,7 @@ done: ssize_t H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) { - H5VL_t *vol_plugin; - void *attr; + H5VL_object_t *attr; H5VL_loc_params_t loc_params; ssize_t ret_value; @@ -876,7 +830,7 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) H5TRACE3("Zs", "iz*s", attr_id, buf_size, buf); /* check arguments */ - if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") if(!buf && buf_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid buffer") @@ -884,12 +838,9 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(attr_id); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the name through the VOL */ - if(H5VL_attr_get(attr, vol_plugin->cls, H5VL_ATTR_GET_NAME, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_attr_get(attr->vol_obj, attr->vol_info->vol_cls, H5VL_ATTR_GET_NAME, + H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, buf_size, buf, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get name") @@ -920,8 +871,7 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name /*out*/, size_t size, hid_t lapl_id) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; ssize_t ret_value; /* Return value */ @@ -944,11 +894,8 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) + if(NULL == (obj = H5VL_get_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") loc_params.type = H5VL_OBJECT_BY_IDX; @@ -960,8 +907,8 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, loc_params.obj_type = H5I_get_type(loc_id); /* get the name through the VOL */ - if(H5VL_attr_get(obj, vol_plugin->cls, H5VL_ATTR_GET_NAME, H5AC_ind_dxpl_id, H5_REQUEST_NULL, - loc_params, size, name, &ret_value) < 0) + if(H5VL_attr_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_ATTR_GET_NAME, + H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, size, name, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get name") done: @@ -989,23 +936,19 @@ done: hsize_t H5Aget_storage_size(hid_t attr_id) { - H5VL_t *vol_plugin; - void *attr; + H5VL_object_t *attr; hsize_t ret_value; /* Return value */ FUNC_ENTER_API(0) H5TRACE1("h", "i", attr_id); /* check arguments */ - if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not an attribute") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "ID does not contain VOL information") - /* get the storage size through the VOL */ - if(H5VL_attr_get(attr, vol_plugin->cls, H5VL_ATTR_GET_STORAGE_SIZE, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) + if(H5VL_attr_get(attr->vol_obj, attr->vol_info->vol_cls, H5VL_ATTR_GET_STORAGE_SIZE, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, 0, "unable to get acpl") done: @@ -1029,8 +972,7 @@ done: herr_t H5Aget_info(hid_t attr_id, H5A_info_t *ainfo) { - H5VL_t *vol_plugin; - void *attr; + H5VL_object_t *attr; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ @@ -1038,19 +980,15 @@ H5Aget_info(hid_t attr_id, H5A_info_t *ainfo) H5TRACE2("e", "i*x", attr_id, ainfo); /* check arguments */ - if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(attr_id); /* get the attribute info through the VOL */ - if(H5VL_attr_get(attr, vol_plugin->cls, H5VL_ATTR_GET_INFO, H5AC_ind_dxpl_id, - H5_REQUEST_NULL, loc_params, ainfo) < 0) + if(H5VL_attr_get(attr->vol_obj, attr->vol_info->vol_cls, H5VL_ATTR_GET_INFO, + H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, ainfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get attribute info") done: @@ -1075,8 +1013,7 @@ herr_t H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_info_t *ainfo, hid_t lapl_id) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ @@ -1103,16 +1040,13 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, loc_params.loc_data.loc_by_name.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(loc_id); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) + if(NULL == (obj = H5VL_get_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") /* get the attribute info through the VOL */ - if(H5VL_attr_get(obj, vol_plugin->cls, H5VL_ATTR_GET_INFO, H5AC_ind_dxpl_id, H5_REQUEST_NULL, - loc_params, ainfo, attr_name) < 0) + if(H5VL_attr_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_ATTR_GET_INFO, + H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, ainfo, attr_name) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get attribute info") done: @@ -1138,8 +1072,7 @@ herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5A_info_t *ainfo, hid_t lapl_id) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ @@ -1172,16 +1105,13 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, loc_params.loc_data.loc_by_idx.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(loc_id); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) + if(NULL == (obj = H5VL_get_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") /* get the attribute info through the VOL */ - if(H5VL_attr_get(obj, vol_plugin->cls, H5VL_ATTR_GET_INFO, H5AC_ind_dxpl_id, H5_REQUEST_NULL, - loc_params, ainfo) < 0) + if(H5VL_attr_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_ATTR_GET_INFO, + H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, ainfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get attribute info") done: @@ -1218,22 +1148,18 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) /* Avoid thrashing things if the names are the same */ if(HDstrcmp(old_name, new_name)) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = H5VL_get_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* rename the attribute info through the VOL */ - if((ret_value = H5VL_attr_specific(obj, loc_params, vol_plugin->cls, H5VL_ATTR_RENAME, + if((ret_value = H5VL_attr_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_ATTR_RENAME, H5AC_dxpl_id, H5_REQUEST_NULL, old_name, new_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") } @@ -1282,8 +1208,7 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, /* Avoid thrashing things if the names are the same */ if(HDstrcmp(old_attr_name, new_attr_name)) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; loc_params.type = H5VL_OBJECT_BY_NAME; @@ -1291,17 +1216,13 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, loc_params.loc_data.loc_by_name.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = H5VL_get_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* rename the attribute info through the VOL */ - if((ret_value = H5VL_attr_specific(obj, loc_params, vol_plugin->cls, H5VL_ATTR_RENAME, - H5AC_dxpl_id, H5_REQUEST_NULL, - old_attr_name, new_attr_name)) < 0) + if((ret_value = H5VL_attr_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_ATTR_RENAME, + H5AC_dxpl_id, H5_REQUEST_NULL, old_attr_name, new_attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") } /* end if */ @@ -1355,8 +1276,7 @@ herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; herr_t ret_value; /* Return value */ @@ -1375,14 +1295,11 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, loc_params.obj_type = H5I_get_type(loc_id); /* get the loc object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + if(NULL == (obj = H5VL_get_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* iterate over the links through the VOL */ - if((ret_value = H5VL_attr_specific(obj, loc_params, vol_plugin->cls, H5VL_ATTR_ITER, + if((ret_value = H5VL_attr_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_ATTR_ITER, H5AC_dxpl_id, H5_REQUEST_NULL, idx_type, order, idx, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "attribute iteration failed") @@ -1440,8 +1357,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data, hid_t lapl_id) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ @@ -1470,14 +1386,11 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, loc_params.loc_data.loc_by_name.lapl_id = lapl_id; /* get the loc object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + if(NULL == (obj = H5VL_get_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* iterate over the links through the VOL */ - if((ret_value = H5VL_attr_specific(obj, loc_params, vol_plugin->cls, H5VL_ATTR_ITER, + if((ret_value = H5VL_attr_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_ATTR_ITER, H5AC_dxpl_id, H5_REQUEST_NULL, idx_type, order, idx, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "attribute iteration failed") @@ -1504,8 +1417,7 @@ done: herr_t H5Adelete(hid_t loc_id, const char *name) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ @@ -1521,15 +1433,12 @@ H5Adelete(hid_t loc_id, const char *name) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(loc_id); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) + if(NULL == (obj = H5VL_get_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") /* Delete the attribute through the VOL */ - if((ret_value = H5VL_attr_specific(obj, loc_params, vol_plugin->cls, H5VL_ATTR_DELETE, + if((ret_value = H5VL_attr_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_ATTR_DELETE, H5AC_dxpl_id, H5_REQUEST_NULL, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") @@ -1558,8 +1467,7 @@ herr_t H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ @@ -1584,15 +1492,12 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, loc_params.loc_data.loc_by_name.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(loc_id); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) + if(NULL == (obj = H5VL_get_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") /* Delete the attribute through the VOL */ - if((ret_value = H5VL_attr_specific(obj, loc_params, vol_plugin->cls, H5VL_ATTR_DELETE, + if((ret_value = H5VL_attr_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_ATTR_DELETE, H5AC_dxpl_id, H5_REQUEST_NULL, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") @@ -1629,8 +1534,7 @@ herr_t H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ @@ -1660,15 +1564,12 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, loc_params.loc_data.loc_by_idx.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(loc_id); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) + if(NULL == (obj = H5VL_get_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") /* Delete the attribute through the VOL */ - if((ret_value = H5VL_attr_specific(obj, loc_params, vol_plugin->cls, H5VL_ATTR_DELETE, + if((ret_value = H5VL_attr_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_ATTR_DELETE, H5AC_dxpl_id, H5_REQUEST_NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") @@ -1730,8 +1631,7 @@ done: htri_t H5Aexists(hid_t obj_id, const char *attr_name) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; htri_t ret_value; /* Return value */ @@ -1744,18 +1644,15 @@ H5Aexists(hid_t obj_id, const char *attr_name) if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object */ - if(NULL == (obj = (void *)H5VL_get_object(obj_id))) + if(NULL == (obj = H5VL_get_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(obj_id); /* Check existence of attribute through the VOL */ - if(H5VL_attr_specific(obj, loc_params, vol_plugin->cls, H5VL_ATTR_EXISTS, + if(H5VL_attr_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_ATTR_EXISTS, H5AC_ind_dxpl_id, H5_REQUEST_NULL, attr_name, &ret_value) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: @@ -1780,8 +1677,7 @@ htri_t H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; htri_t ret_value; /* Return value */ @@ -1801,11 +1697,8 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object */ - if(NULL == (obj = (void *)H5VL_get_object(loc_id))) + if(NULL == (obj = H5VL_get_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") loc_params.type = H5VL_OBJECT_BY_NAME; @@ -1814,7 +1707,7 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, loc_params.obj_type = H5I_get_type(loc_id); /* Check existence of attribute through the VOL */ - if(H5VL_attr_specific(obj, loc_params, vol_plugin->cls, H5VL_ATTR_EXISTS, + if(H5VL_attr_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_ATTR_EXISTS, H5AC_ind_dxpl_id, H5_REQUEST_NULL, attr_name, &ret_value) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") @@ -1838,19 +1731,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_close_attr(void *attr, H5VL_t *vol_plugin) +H5A_close_attr(void *_attr) { - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t *attr = (H5VL_object_t *)_attr; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Close the attr through the VOL*/ - if((ret_value = H5VL_attr_close(attr, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_attr_close(attr->vol_obj, attr->vol_info->vol_cls, + H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "unable to close attribute") - /* decrement ref count on VOL ID */ - if(H5VL_free_id(vol_plugin) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin") + /* free attribute */ + if(H5VL_free_object(attr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to free VOL object") done: FUNC_LEAVE_NOAPI(ret_value) |