From 05d51c036140f94a07efb75aab9675b3b4bd5ef0 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 5 Sep 2014 16:36:55 -0500 Subject: [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. --- src/H5A.c | 407 ++++++++++++++++---------------------------- src/H5Adeprec.c | 100 +++++------ src/H5Aint.c | 11 +- src/H5Atest.c | 4 +- src/H5D.c | 202 +++++++++------------- src/H5Ddbg.c | 2 +- src/H5Ddeprec.c | 50 +++--- src/H5Dint.c | 18 +- src/H5Dio.c | 22 +-- src/H5Doh.c | 2 +- src/H5Dpkg.h | 1 - src/H5Dtest.c | 6 +- src/H5E.c | 9 +- src/H5F.c | 313 ++++++++++++---------------------- src/H5FD.c | 3 +- src/H5Fdeprec.c | 2 +- src/H5Fint.c | 106 +----------- src/H5Fmount.c | 41 ++--- src/H5Fmpi.c | 4 +- src/H5Fpkg.h | 2 - src/H5Ftest.c | 6 +- src/H5G.c | 162 +++++++----------- src/H5Gdeprec.c | 322 ++++++++--------------------------- src/H5Gloc.c | 10 +- src/H5Gname.c | 20 +-- src/H5Goh.c | 2 +- src/H5Gtest.c | 34 ++-- src/H5I.c | 224 ++++++------------------ src/H5Iprivate.h | 4 - src/H5L.c | 298 ++++++++++++-------------------- src/H5Lexternal.c | 12 +- src/H5O.c | 269 +++++++++++------------------ src/H5Oattribute.c | 2 +- src/H5Ocopy.c | 24 +-- src/H5Odtype.c | 6 +- src/H5Pint.c | 6 +- src/H5R.c | 72 +++----- src/H5Rdeprec.c | 30 ++-- src/H5S.c | 3 +- src/H5T.c | 9 +- src/H5Tcommit.c | 271 +++++++++++++---------------- src/H5Tdeprec.c | 74 ++++---- src/H5Toh.c | 5 +- src/H5Tpkg.h | 2 +- src/H5Tprivate.h | 7 +- src/H5VL.c | 23 +-- src/H5VLint.c | 340 +++++++++++++++++++++++++++--------- src/H5VLnative.c | 69 ++++---- src/H5VLprivate.h | 39 +++-- test/accum.c | 2 +- test/btree2.c | 24 +-- test/cache_api.c | 4 +- test/cache_common.c | 10 +- test/cache_tagging.c | 14 +- test/earray.c | 6 +- test/farray.c | 6 +- test/fheap.c | 142 ++++++++-------- test/freespace.c | 32 ++-- test/gheap.c | 12 +- test/lheap.c | 4 +- test/mf.c | 142 ++++++++-------- test/ohdr.c | 8 +- test/testfiles/err_compat_1 | 4 +- testpar/t_cache.c | 2 +- tools/misc/h5debug.c | 2 +- 65 files changed, 1645 insertions(+), 2419 deletions(-) diff --git a/src/H5A.c b/src/H5A.c index 709a05f..2de57e5 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -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) diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 75d1665..28e4c3f 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -164,8 +164,7 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t plist_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_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; H5P_genplist_t *plist; /* Property list pointer */ hid_t ret_value; /* Return value */ @@ -196,26 +195,24 @@ H5Acreate1(hid_t loc_id, const char *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 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, name, plist_id, H5P_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (attr = H5VL_attr_create(obj->vol_obj, loc_params, obj->vol_info->vol_cls, name, + plist_id, H5P_DEFAULT, 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) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") + 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) } /* H5Acreate1() */ @@ -246,8 +243,7 @@ hid_t H5Aopen_name(hid_t loc_id, const char *name) { void *attr = NULL; /* attr token from VOL plugin */ - 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; hid_t ret_value; @@ -263,27 +259,24 @@ H5Aopen_name(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 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, name, H5P_DEFAULT, - H5AC_ind_dxpl_id, H5_REQUEST_NULL))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open attribute") + /* Open the attribute through the VOL */ + if(NULL == (attr = H5VL_attr_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + name, H5P_DEFAULT, 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) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") + 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_name() */ @@ -314,8 +307,7 @@ hid_t H5Aopen_idx(hid_t loc_id, unsigned idx) { void *attr = NULL; /* attr token from VOL plugin */ - 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; hid_t ret_value; @@ -334,26 +326,24 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) loc_params.loc_data.loc_by_idx.lapl_id = H5P_LINK_ACCESS_DEFAULT; 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, NULL, H5P_DEFAULT, - H5AC_ind_dxpl_id, H5_REQUEST_NULL))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open attribute") + /* Open the attribute through the VOL */ + if(NULL == (attr = H5VL_attr_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + NULL, H5P_DEFAULT, 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) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") + 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_idx() */ @@ -379,11 +369,10 @@ done: int H5Aget_num_attrs(hid_t loc_id) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5VL_loc_params_t loc_params; H5O_info_t oinfo; - int ret_value; + int ret_value; FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", loc_id); @@ -391,15 +380,12 @@ H5Aget_num_attrs(hid_t loc_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") /* Get the group info through the VOL using the location token */ - if(H5VL_object_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_object_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_OBJECT_GET_INFO, loc_params, &oinfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") diff --git a/src/H5Aint.c b/src/H5Aint.c index b812d56..ea91306 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -239,7 +239,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, * (to maintain ref. count incr/decr similarity with "shared message" * type of datatype sharing) */ - if(H5T_committed(attr->shared->dt)) { + if(H5T_is_named(attr->shared->dt)) { /* Increment the reference count on the shared datatype */ if(H5T_link(attr->shared->dt, 1, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, NULL, "unable to adjust shared datatype link count") @@ -767,8 +767,7 @@ H5A_get_type(H5A_t *attr) if(H5T_lock(dt, FALSE) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") - - if(H5T_committed(dt)) { + if(H5T_is_named(dt)) { /* If this is a committed datatype, we need to recreate the two level IDs, where the VOL object is a copy of the returned datatype */ @@ -1978,7 +1977,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si if(H5T_set_loc(attr_dst->shared->dt, file_dst, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "cannot mark datatype on disk") - if(!H5T_committed(attr_src->shared->dt)) { + if(!H5T_is_named(attr_src->shared->dt)) { /* If the datatype is not named, it may have been shared in the * source file's heap. Un-share it for now. We'll try to shared * it in the destination file below. @@ -2200,7 +2199,7 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, HDassert(file_src); HDassert(file_dst); - if(H5T_committed(attr_src->shared->dt)) { + if(H5T_is_named(attr_src->shared->dt)) { H5O_loc_t *src_oloc_dt; /* Pointer to source datatype's object location */ H5O_loc_t *dst_oloc_dt; /* Pointer to dest. datatype's object location */ @@ -2467,7 +2466,7 @@ herr_t H5A_iterate(void *obj, H5VL_loc_params_t loc_params, H5_index_t idx_type, /* Iterate over the attributess */ if(loc_params.type == H5VL_OBJECT_BY_SELF) { if((obj_loc_id = H5VL_native_register(loc_params.obj_type, obj, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register object") } else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* Set up opened group location to fill in */ diff --git a/src/H5Atest.c b/src/H5Atest.c index 19b5547..2061ba3 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -100,7 +100,7 @@ H5A_is_shared_test(hid_t attr_id) FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ - if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5A_t *)H5VL_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") /* Check if attribute is shared */ @@ -133,7 +133,7 @@ H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ - if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5A_t *)H5VL_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") /* Sanity check */ diff --git a/src/H5D.c b/src/H5D.c index 2995a73..0c585a4 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -148,12 +148,11 @@ hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id) { - void *dset = NULL; /* dset token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *dset = NULL; /* dset token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - H5P_genplist_t *plist; /* Property list pointer */ - hid_t ret_value = FAIL; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE7("i", "i*siiiii", loc_id, name, type_id, space_id, lcpl_id, dcpl_id, @@ -187,6 +186,10 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* set creation properties */ if(H5P_set(plist, H5VL_PROP_DSET_TYPE_ID, &type_id) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for datatype id") @@ -198,24 +201,18 @@ H5Dcreate2(hid_t loc_id, const char *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 location object */ - if(NULL == (obj = (void *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location 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") - /* Create the dataset through the VOL */ - if(NULL == (dset = H5VL_dataset_create(obj, loc_params, vol_plugin->cls, name, dcpl_id, dapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (dset = H5VL_dataset_create(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + name, dcpl_id, dapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") - /* Get an atom for the dataset with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_DATASET, dset, vol_plugin, TRUE)) < 0) + /* Get an atom for the dataset */ + if((ret_value = H5VL_register_id(H5I_DATASET, dset, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") done: if (ret_value < 0 && dset) - if(H5VL_dataset_close (dset, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_dataset_close (dset, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate2() */ @@ -260,12 +257,11 @@ hid_t H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id) { - void *dset = NULL; /* dset token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *dset = NULL; /* dset token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - H5P_genplist_t *plist; /* Property list pointer */ - hid_t ret_value; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("i", "iiiii", loc_id, type_id, space_id, dcpl_id, dapl_id); @@ -284,6 +280,10 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, if(TRUE != H5P_isa_class(dapl_id, H5P_DATASET_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset access property list") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Get the plist structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") @@ -297,25 +297,19 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_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 *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location 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") - /* Create the dataset through the VOL */ - if(NULL == (dset = H5VL_dataset_create(obj, loc_params, vol_plugin->cls, NULL, dcpl_id, dapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (dset = H5VL_dataset_create(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + NULL, dcpl_id, dapl_id, + H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") - /* Get an atom for the dataset with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_DATASET, dset, vol_plugin, TRUE)) < 0) + /* Get an atom for the dataset */ + if((ret_value = H5VL_register_id(H5I_DATASET, dset, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") done: if (ret_value < 0 && dset) - if(H5VL_dataset_close (dset, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_dataset_close (dset, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate_anon() */ @@ -341,11 +335,10 @@ done: hid_t H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) { - void *dset = NULL; /* dset token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *dset = NULL; /* dset 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, name, dapl_id); @@ -364,25 +357,22 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_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 *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location 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 location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the dataset through the VOL */ - if(NULL == (dset = H5VL_dataset_open(obj, loc_params, vol_plugin->cls, name, dapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (dset = H5VL_dataset_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, name, + dapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") - /* Get an atom for the dataset with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_DATASET, dset, vol_plugin, TRUE)) < 0) + /* Get an atom for the dataset */ + if((ret_value = H5VL_register_id(H5I_DATASET, dset, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") done: if (ret_value < 0 && dset) - if(H5VL_dataset_close (dset, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_dataset_close (dset, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) } /* end H5Dopen2() */ @@ -449,22 +439,18 @@ done: hid_t H5Dget_space(hid_t dset_id) { - H5VL_t *vol_plugin; - void *dset; + H5VL_object_t *dset; hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); /* Check args */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the dataspace through the VOL */ - if(H5VL_dataset_get(dset, vol_plugin->cls, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, + if(H5VL_dataset_get(dset->vol_obj, dset->vol_info->vol_cls, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get data space") @@ -490,22 +476,18 @@ done: herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) { - H5VL_t *vol_plugin; - void *dset; + H5VL_object_t *dset; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Ds", dset_id, allocation); /* Check args */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* Read data space address through the VOL and return */ - if((ret_value = H5VL_dataset_get(dset, vol_plugin->cls, H5VL_DATASET_GET_SPACE_STATUS, + if((ret_value = H5VL_dataset_get(dset->vol_obj, dset->vol_info->vol_cls, H5VL_DATASET_GET_SPACE_STATUS, H5AC_ind_dxpl_id, H5_REQUEST_NULL, allocation)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get space status") @@ -533,22 +515,19 @@ done: hid_t H5Dget_type(hid_t dset_id) { - H5VL_t *vol_plugin; - void *dset; + H5VL_object_t *dset; hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); /* Check args */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the datatype through the VOL */ - if(H5VL_dataset_get(dset, vol_plugin->cls, H5VL_DATASET_GET_TYPE, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) + if(H5VL_dataset_get(dset->vol_obj, dset->vol_info->vol_cls, H5VL_DATASET_GET_TYPE, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get datatype") done: @@ -575,21 +554,17 @@ done: hid_t H5Dget_create_plist(hid_t dset_id) { - H5VL_t *vol_plugin; - void *dset; + H5VL_object_t *dset; hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); /* Check args */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - if(H5VL_dataset_get(dset, vol_plugin->cls, H5VL_DATASET_GET_DCPL, H5AC_dxpl_id, + if(H5VL_dataset_get(dset->vol_obj, dset->vol_info->vol_cls, H5VL_DATASET_GET_DCPL, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataset creation properties") @@ -634,21 +609,18 @@ done: hid_t H5Dget_access_plist(hid_t dset_id) { - H5VL_t *vol_plugin; - void *dset; - hid_t ret_value = FAIL; /* Return value */ + H5VL_object_t *dset; + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); /* Check args */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - if(H5VL_dataset_get(dset, vol_plugin->cls, H5VL_DATASET_GET_DAPL, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) + if(H5VL_dataset_get(dset->vol_obj, dset->vol_info->vol_cls, H5VL_DATASET_GET_DAPL, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataset access properties") done: @@ -677,22 +649,18 @@ done: hsize_t H5Dget_storage_size(hid_t dset_id) { - H5VL_t *vol_plugin; - void *dset; + H5VL_object_t *dset; hsize_t ret_value; /* Return value */ FUNC_ENTER_API(0) H5TRACE1("h", "i", dset_id); /* Check args */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "invalid dataset identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "ID does not contain VOL information") /* get storage size through the VOL */ - if(H5VL_dataset_get(dset, vol_plugin->cls, H5VL_DATASET_GET_STORAGE_SIZE, + if(H5VL_dataset_get(dset->vol_obj, dset->vol_info->vol_cls, H5VL_DATASET_GET_STORAGE_SIZE, H5AC_ind_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, 0, "unable to get storage size") @@ -718,22 +686,19 @@ done: haddr_t H5Dget_offset(hid_t dset_id) { - H5VL_t *vol_plugin; - void *dset; + H5VL_object_t *dset; haddr_t ret_value; /* Return value */ FUNC_ENTER_API(HADDR_UNDEF) H5TRACE1("a", "i", dset_id); /* Check args */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "invalid dataset identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "ID does not contain VOL information") /* get offset through the VOL */ - if(H5VL_dataset_get(dset, vol_plugin->cls, H5VL_DATASET_GET_OFFSET, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) + if(H5VL_dataset_get(dset->vol_obj, dset->vol_info->vol_cls, H5VL_DATASET_GET_OFFSET, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, HADDR_UNDEF, "unable to get offset") done: @@ -905,9 +870,8 @@ herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size) { - H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0, 0, 0}; - H5VL_t *vol_plugin; /* VOL plugin this object belongs to */ - void *dset; /* Dataset for operation */ + H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0, 0}; + H5VL_object_t *dset; /* Dataset for operation */ H5S_t *mspace = NULL; /* Memory dataspace */ char bogus; /* bogus value to pass to H5Diterate() */ H5S_t *space; /* Dataspace for iteration */ @@ -921,26 +885,21 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, if(H5I_DATASET != H5I_get_type(dataset_id) || (H5I_DATATYPE != H5I_get_type(type_id)) || size == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dataset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the dataset object */ - if(NULL == (dset = (void *)H5I_object(dataset_id))) + if(NULL == (dset = (H5VL_object_t *)H5I_object(dataset_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace") if(!(H5S_has_extent(space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set") - /* Save the dataset & VOL plugin */ + /* Save the dataset */ vlen_bufsize.dset = dset; - vlen_bufsize.vol_cls = vol_plugin->cls; - vlen_bufsize.fspace_id = FAIL; vlen_bufsize.mspace_id = FAIL; /* Get a copy of the dataspace ID */ - if(H5VL_dataset_get(dset, vol_plugin->cls, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, + if(H5VL_dataset_get(dset->vol_obj, dset->vol_info->vol_cls, H5VL_DATASET_GET_SPACE, H5AC_dxpl_id, H5_REQUEST_NULL, &vlen_bufsize.fspace_id) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy dataspace") @@ -1016,26 +975,21 @@ done: herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]) { - H5VL_t *vol_plugin; - void *dset; + H5VL_object_t *dset; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", dset_id, size); /* Check args */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier") if(!size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* set the extent through the VOL */ - if((ret_value = H5VL_dataset_specific(dset, vol_plugin->cls, H5VL_DATASET_SET_EXTENT, + if((ret_value = H5VL_dataset_specific(dset->vol_obj, dset->vol_info->vol_cls, H5VL_DATASET_SET_EXTENT, H5AC_dxpl_id, H5_REQUEST_NULL, size)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extent of dataset") @@ -1059,14 +1013,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_close_dataset(void *dset, H5VL_t *vol_plugin) +H5D_close_dataset(void *_dset) { - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t *dset = (H5VL_object_t *)_dset; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Close the dataset through the VOL */ - if((ret_value = H5VL_dataset_close(dset, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_dataset_close(dset->vol_obj, dset->vol_info->vol_cls, + H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to close dataset") done: @@ -1074,9 +1030,9 @@ done: Always decrement the ref count on the vol for datasets, since the ID is removed even if the close fails */ - /* decrement ref count on VOL ID */ - if(H5VL_free_id(vol_plugin) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin") + /* free dset */ + if(H5VL_free_object(dset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to free VOL object") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_close_dataset() */ diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index a7c6dc1..e187fa2 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -108,7 +108,7 @@ H5Ddebug(hid_t dset_id) H5TRACE1("e", "i", dset_id); /* Check args */ - if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5D_t *)H5VL_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Print B-tree information */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 6dd0ebb..cf68652 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -165,13 +165,12 @@ hid_t H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t dcpl_id) { - void *dset = NULL; /* dset token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *dset = NULL; /* dset token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - H5P_genplist_t *plist; /* Property list pointer */ + H5P_genplist_t *plist; /* Property list pointer */ hid_t lcpl_id = H5P_LINK_CREATE_DEFAULT; - hid_t ret_value; /* Return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, dcpl_id); @@ -197,26 +196,22 @@ H5Dcreate1(hid_t loc_id, const char *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 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 dataset through the VOL */ - if(NULL == (dset = H5VL_dataset_create(obj, loc_params, vol_plugin->cls, name, dcpl_id, + if(NULL == (dset = H5VL_dataset_create(obj->vol_obj, loc_params, obj->vol_info->vol_cls, name, dcpl_id, H5P_DATASET_ACCESS_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") - /* Get an atom for the dataset with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_DATASET, dset, vol_plugin, TRUE)) < 0) + /* Get an atom for the dataset */ + if((ret_value = H5VL_register_id(H5I_DATASET, dset, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") done: if (ret_value < 0 && dset) - if(H5VL_dataset_close (dset, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_dataset_close (dset, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate1() */ @@ -243,8 +238,7 @@ hid_t H5Dopen1(hid_t loc_id, const char *name) { void *dset = NULL; /* dset token from VOL plugin */ - 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; hid_t dapl_id = H5P_DATASET_ACCESS_DEFAULT; /* dapl to use to open dataset */ hid_t ret_value; @@ -259,25 +253,21 @@ H5Dopen1(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 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 dataset through the VOL */ - if(NULL == (dset = H5VL_dataset_open(obj, loc_params, vol_plugin->cls, name, dapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (dset = H5VL_dataset_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, name, dapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") - /* Get an atom for the dataset with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_DATASET, dset, vol_plugin, TRUE)) < 0) + /* Get an atom for the dataset */ + if((ret_value = H5VL_register_id(H5I_DATASET, dset, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") done: if (ret_value < 0 && dset) - if(H5VL_dataset_close (dset, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_dataset_close (dset, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) } /* end H5Dopen1() */ @@ -309,7 +299,7 @@ H5Dextend(hid_t dset_id, const hsize_t size[]) H5TRACE2("e", "i*h", dset_id, size); /* Check args */ - if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5D_t *)H5VL_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(!size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") diff --git a/src/H5Dint.c b/src/H5Dint.c index a1d062fa..7a7c60c 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -114,8 +114,7 @@ static const H5I_class_t H5I_DATASET_CLS[1] = {{ H5I_DATASET, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - NULL, /* Callback routine for closing objects of this class */ - (H5I_free2_t)H5D_close_dataset /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5D_close_dataset /* Callback routine for closing objects of this class */ }}; @@ -930,7 +929,7 @@ H5D_t * H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id) { - const H5T_t *type, *dt; /* Datatype for dataset */ + const H5T_t *type, *dt; /* Datatype for dataset */ H5D_t *new_dset = NULL; H5P_genplist_t *dc_plist = NULL; /* New Property list */ hbool_t has_vl_type = FALSE; /* Flag to indicate a VL-type for dataset */ @@ -948,12 +947,10 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HDassert(H5I_GENPROP_LST == H5I_get_type(dxpl_id)); /* Get the dataset's datatype */ - if(NULL == (dt = (const H5T_t *)H5I_object(type_id))) + if(NULL == (dt = (H5T_t *)H5I_object(type_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype") - - /* Get the actual datatype object if this is a named datatype */ - if(NULL == (type = (const H5T_t *)H5T_get_named_type(dt))) - type = dt; + /* If this is a named datatype, get the plugin pointer to the datatype */ + type = (const H5T_t *)H5T_get_actual_type(dt); /* Check if the datatype is "sensible" for use in a dataset */ if(H5T_is_sensible(type) != TRUE) @@ -2061,6 +2058,7 @@ herr_t H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t *point, void *op_data) { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)op_data; + H5VL_object_t *dset = (H5VL_object_t *)vlen_bufsize->dset; H5T_t *dt; /* Datatype for operation */ H5S_t *fspace; /* File dataspace for operation */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2085,7 +2083,7 @@ H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, c HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't select point") /* Read in the point (with the custom VL memory allocator) */ - if(H5VL_dataset_read(vlen_bufsize->dset, vlen_bufsize->vol_cls, + if(H5VL_dataset_read(dset->vol_obj, dset->vol_info->vol_cls, type_id, vlen_bufsize->mspace_id, vlen_bufsize->fspace_id, vlen_bufsize->xfer_pid, vlen_bufsize->fl_tbuf, H5_REQUEST_NULL) < 0) @@ -2732,7 +2730,7 @@ H5D_get_type(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to lock transient datatype") /* Create an atom */ - if(H5T_committed(dt)) { + if(H5T_is_named(dt)) { /* If this is a committed datatype, we need to recreate the two level IDs, where the VOL object is a copy of the returned datatype */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 015e5e0..e9c203f 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -120,8 +120,7 @@ herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf/*out*/) { - H5VL_t *vol_plugin = NULL; - void *dset = NULL; + H5VL_object_t *dset = NULL; const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -131,7 +130,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, plist_id, buf); /* check arguments */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(mem_space_id < 0 || file_space_id < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") @@ -160,12 +159,8 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* Read the data through the VOL */ - if((ret_value = H5VL_dataset_read(dset, vol_plugin->cls, mem_type_id, mem_space_id, + if((ret_value = H5VL_dataset_read(dset->vol_obj, dset->vol_info->vol_cls, mem_type_id, mem_space_id, file_space_id, plist_id, buf, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") @@ -209,8 +204,7 @@ herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t dxpl_id, const void *buf) { - H5VL_t *vol_plugin = NULL; - void *dset = NULL; + H5VL_object_t *dset = NULL; H5P_genplist_t *plist; /* Property list pointer */ const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; @@ -222,7 +216,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, dxpl_id, buf); /* check arguments */ - if(NULL == (dset = (void *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Get the default dataset transfer property list if the user didn't provide one */ @@ -263,12 +257,8 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, } /* end if */ } - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dset_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* Write the data through the VOL */ - if((ret_value = H5VL_dataset_write(dset, vol_plugin->cls, mem_type_id, mem_space_id, + if((ret_value = H5VL_dataset_write(dset->vol_obj, dset->vol_info->vol_cls, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") diff --git a/src/H5Doh.c b/src/H5Doh.c index abf76d0..74521b9 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -332,7 +332,7 @@ H5O__dset_get_oloc(hid_t obj_id) FUNC_ENTER_STATIC /* Get the dataset */ - if(NULL == (dset = (H5D_t *)H5I_object(obj_id))) + if(NULL == (dset = (H5D_t *)H5VL_object(obj_id))) HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID") /* Get the dataset's object header location */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 86da45f..ae37c98 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -480,7 +480,6 @@ typedef struct H5D_fill_buf_info_t { /* Internal data structure for computing variable-length dataset's total size */ typedef struct { void *dset; /* Dataset for operation */ - const H5VL_class_t *vol_cls; /* VOL plugin the dataset belongs to */ hid_t fspace_id; /* ID of the file dataset's dataspace we are working on */ hid_t mspace_id; /* ID of the memory dataset's dataspace we are working on */ void *fl_tbuf; /* Ptr to the temporary buffer we are using for fixed-length data */ diff --git a/src/H5Dtest.c b/src/H5Dtest.c index eef3c91..e528494 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -90,7 +90,7 @@ H5D__layout_version_test(hid_t did, unsigned *version) FUNC_ENTER_PACKAGE /* Check args */ - if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + if(NULL == (dset = (H5D_t *)H5VL_object_verify(did, H5I_DATASET))) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") if(version) @@ -129,7 +129,7 @@ H5D__layout_contig_size_test(hid_t did, hsize_t *size) FUNC_ENTER_PACKAGE /* Check args */ - if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + if(NULL == (dset = (H5D_t *)H5VL_object_verify(did, H5I_DATASET))) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") if(size) { @@ -170,7 +170,7 @@ H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused) FUNC_ENTER_PACKAGE /* Check args */ - if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + if(NULL == (dset = (H5D_t *)H5VL_object_verify(did, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(nbytes_used) { diff --git a/src/H5E.c b/src/H5E.c index e831db3..f36ab9a 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -124,8 +124,7 @@ static const H5I_class_t H5I_ERRCLS_CLS[1] = {{ H5I_ERROR_CLASS, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5E_unregister_class, /* Callback routine for closing objects of this class */ - NULL /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5E_unregister_class /* Callback routine for closing objects of this class */ }}; /* Error message ID class */ @@ -133,8 +132,7 @@ static const H5I_class_t H5I_ERRMSG_CLS[1] = {{ H5I_ERROR_MSG, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5E_close_msg, /* Callback routine for closing objects of this class */ - NULL /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5E_close_msg /* Callback routine for closing objects of this class */ }}; /* Error stack ID class */ @@ -142,8 +140,7 @@ static const H5I_class_t H5I_ERRSTK_CLS[1] = {{ H5I_ERROR_STACK, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5E_close_stack,/* Callback routine for closing objects of this class */ - NULL /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5E_close_stack /* Callback routine for closing objects of this class */ }}; diff --git a/src/H5F.c b/src/H5F.c index 922fd45..363fef5 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -69,14 +69,17 @@ /* Local Variables */ /*******************/ +/* Declare a free list to manage the H5VL_t struct */ +H5FL_EXTERN(H5VL_t); +/* Declare a free list to manage the H5VL_object_t struct */ +H5FL_EXTERN(H5VL_object_t); /* File ID class */ static const H5I_class_t H5I_FILE_CLS[1] = {{ H5I_FILE, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - NULL, /* Callback routine for closing objects of this class */ - (H5I_free2_t)H5F_close_file /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5F_close_file /* Callback routine for closing objects of this class */ }}; @@ -96,6 +99,7 @@ static herr_t H5F__init_pub_interface(void) { herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_STATIC /* @@ -204,22 +208,18 @@ H5F_term_interface(void) hid_t H5Fget_create_plist(hid_t file_id) { - H5VL_t *vol_plugin = NULL; - void *obj = NULL; - hid_t ret_value; /* Return value */ + H5VL_object_t *obj = NULL; + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", file_id); /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - if(H5VL_file_get(obj, vol_plugin->cls, H5VL_FILE_GET_FCPL, H5AC_dxpl_id, - H5_REQUEST_NULL, &ret_value) < 0) + if(H5VL_file_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_GET_FCPL, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file creation properties") done: @@ -251,23 +251,19 @@ done: hid_t H5Fget_access_plist(hid_t file_id) { - H5VL_t *vol_plugin; - void *file; - hid_t fapl_id = FAIL; - hid_t ret_value; /* Return value */ + H5VL_object_t *file = NULL; + hid_t fapl_id = FAIL; + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", file_id); /* get the file object */ - if(NULL == (file = (void *)H5I_object(file_id))) + if(NULL == (file = (H5VL_object_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - if(H5VL_file_get(file, vol_plugin->cls, H5VL_FILE_GET_FAPL, H5AC_dxpl_id, - H5_REQUEST_NULL, &fapl_id) < 0) + if(H5VL_file_get(file->vol_obj, file->vol_info->vol_cls, H5VL_FILE_GET_FAPL, + H5AC_dxpl_id, H5_REQUEST_NULL, &fapl_id) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file creation properties") ret_value = fapl_id; @@ -328,18 +324,14 @@ H5Fget_obj_count(hid_t file_id, unsigned types) H5TRACE2("Zs", "iIu", file_id, types); if(file_id != (hid_t)H5F_OBJ_ALL) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; /* get the file object */ - if(NULL == (obj = (void *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file id") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - if(H5VL_file_get(obj, vol_plugin->cls, H5VL_FILE_GET_OBJ_COUNT, H5AC_dxpl_id, - H5_REQUEST_NULL, types, &ret_value) < 0) + if(H5VL_file_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_GET_OBJ_COUNT, + H5AC_dxpl_id, H5_REQUEST_NULL, types, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get object count in file(s)") } /* iterate over all open files and get the obj count for each */ @@ -440,18 +432,14 @@ H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list) /* Check arguments */ if(file_id != (hid_t)H5F_OBJ_ALL) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the file object */ - if(NULL == (obj = (void *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_get(obj, vol_plugin->cls, H5VL_FILE_GET_OBJ_IDS, H5AC_dxpl_id, H5_REQUEST_NULL, - types, max_objs, oid_list, &ret_value) < 0) + if(H5VL_file_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_GET_OBJ_IDS, + H5AC_dxpl_id, H5_REQUEST_NULL, types, max_objs, oid_list, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get object count in file(s)") } /* iterate over all open files and get the obj count for each */ @@ -507,8 +495,7 @@ done: herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -518,15 +505,11 @@ H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle) if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file handle pointer") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_optional(obj, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_GET_VFD_HANDLE, file_handle, fapl) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file handle") @@ -608,11 +591,11 @@ done: hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { - void *file = NULL; /* file token from VOL plugin */ - H5VL_t *vol_plugin = NULL; /* VOL plugin information */ + void *file; /* file object returned from the plugin */ H5P_genplist_t *plist; /* Property list pointer */ hid_t plugin_id; /* VOL plugin identigier attached to fapl_id */ H5VL_class_t *vol_cls = NULL; /* VOL Class structure for callback info */ + H5VL_t *vol_info = NULL; /* VOL info struct */ hid_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) @@ -658,16 +641,16 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to create file") - /* Build the vol plugin struct */ - if(NULL == (vol_plugin = (H5VL_t *)H5MM_calloc(sizeof(H5VL_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - vol_plugin->cls = vol_cls; - vol_plugin->nrefs = 0; - vol_plugin->id = plugin_id; + /* setup VOL info struct */ + if(NULL == (vol_info = H5FL_CALLOC(H5VL_t))) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate VL info struct") + vol_info->vol_cls = vol_cls; + vol_info->vol_id = plugin_id; + if(H5I_inc_ref(vol_info->vol_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin") - /* Get an atom for the file with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_FILE, file, vol_plugin, TRUE)) < 0) + /* Get an atom for the file */ + if((ret_value = H5VL_register_id(H5I_FILE, file, vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") done: @@ -718,11 +701,11 @@ done: hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { - void *file = NULL; /* file token from VOL plugin */ - H5VL_t *vol_plugin = NULL; /* VOL plugin information */ + void *file; /* file object returned from the plugin */ H5P_genplist_t *plist; /* Property list pointer */ hid_t plugin_id; /* VOL plugin identigier attached to fapl_id */ H5VL_class_t *vol_cls = NULL; /* VOL Class structure for callback info */ + H5VL_t *vol_info = NULL; /* VOL info struct */ hid_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) @@ -754,16 +737,16 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) if(NULL == (file = H5VL_file_open(vol_cls, filename, flags, fapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to create file") - /* Build the vol plugin struct */ - if(NULL == (vol_plugin = (H5VL_t *)H5MM_calloc(sizeof(H5VL_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + /* setup VOL info struct */ + if(NULL == (vol_info = H5FL_CALLOC(H5VL_t))) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate VL info struct") + vol_info->vol_cls = vol_cls; + vol_info->vol_id = plugin_id; + if(H5I_inc_ref(vol_info->vol_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin") - vol_plugin->cls = vol_cls; - vol_plugin->nrefs = 0; - vol_plugin->id = plugin_id; - - /* Get an atom for the file with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_FILE, file, vol_plugin, TRUE)) < 0) + /* Get an atom for the file */ + if((ret_value = H5VL_register_id(H5I_FILE, file, vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") done: @@ -788,8 +771,7 @@ done: herr_t H5Fflush(hid_t object_id, H5F_scope_t scope) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj = NULL; H5I_type_t obj_type; herr_t ret_value = SUCCEED; /* Return value */ @@ -802,15 +784,11 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") } - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(object_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(object_id))) + if(NULL == (obj = H5VL_get_object(object_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_specific(obj, vol_plugin->cls, H5VL_FILE_FLUSH, H5AC_dxpl_id, + if(H5VL_file_specific(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_FLUSH, H5AC_dxpl_id, H5_REQUEST_NULL, obj_type, scope) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file") @@ -876,20 +854,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_close_file(void *file, H5VL_t *vol_plugin) +H5F_close_file(void *_file) { - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t *file = (H5VL_object_t *)_file; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Close the file through the VOL*/ - if((ret_value = H5VL_file_close(file, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_file_close(file->vol_obj, file->vol_info->vol_cls, + H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close file") - /* decrement ref count on VOL ID */ - if(H5VL_free_id(vol_plugin) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin") - + /* free file */ + if(H5VL_free_object(file) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_close_file() */ @@ -920,31 +899,26 @@ done: hid_t H5Freopen(hid_t file_id) { - H5VL_t *vol_plugin; - void *obj; - void *file; /*file token from VOL plugin */ - hid_t ret_value; + H5VL_object_t *obj = NULL; + void *file; /* file token from VOL plugin */ + hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", file_id); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_optional(obj, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_REOPEN, &file) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") if (NULL == file) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") - /* Get an atom for the file with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_FILE, file, vol_plugin, TRUE)) < 0) + /* Get an atom for the file */ + if((ret_value = H5VL_register_id(H5I_FILE, file, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") done: @@ -975,18 +949,13 @@ H5Fget_intent(hid_t file_id, unsigned *intent_flags) /* If no intent flags were passed in, exit quietly */ if(intent_flags) { - H5VL_t *vol_plugin; - void *obj; - - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + H5VL_object_t *obj = NULL; /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if((ret_value = H5VL_file_get(obj, vol_plugin->cls, H5VL_FILE_GET_INTENT, + if((ret_value = H5VL_file_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_GET_INTENT, H5AC_dxpl_id, H5_REQUEST_NULL, intent_flags)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file intent") } @@ -1013,22 +982,17 @@ done: hssize_t H5Fget_freespace(hid_t file_id) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj = NULL; hssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("Hs", "i", file_id); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_GET_FREE_SPACE, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file free space") @@ -1056,22 +1020,17 @@ done: herr_t H5Fget_filesize(hid_t file_id, hsize_t *size) { - H5VL_t *vol_plugin; - void *file; + H5VL_object_t *file; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", file_id, size); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the file object */ - if(NULL == (file = (void *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - if(H5VL_file_optional(file, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(file->vol_obj, file->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_GET_SIZE, size) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file size") @@ -1124,23 +1083,18 @@ done: ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) { - H5VL_t *vol_plugin; - void *file; + H5VL_object_t *file; ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "i*xz", file_id, buf_ptr, buf_len); /* Check args */ - if(NULL == (file = (void *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get image through the VOL */ - if(H5VL_file_optional(file, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(file->vol_obj, file->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_GET_FILE_IMAGE, buf_ptr, &ret_value, buf_len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file image") @@ -1170,9 +1124,8 @@ done: herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) { - H5VL_t *vol_plugin; - void *obj; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t *obj = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", file_id, config_ptr); @@ -1181,15 +1134,11 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) if((NULL == config_ptr) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_optional(obj, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_GET_MDC_CONF, config_ptr) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get mdc configuration") @@ -1216,21 +1165,17 @@ done: herr_t H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) { - H5VL_t *vol_plugin; - void *obj; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t *obj = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", file_id, config_ptr); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_optional(obj, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_SET_MDC_CONFIG, config_ptr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "uanvle to set MDC configuration") @@ -1258,25 +1203,20 @@ done: herr_t H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr) { - H5VL_t *vol_plugin; - void *file; + H5VL_object_t *file; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*d", file_id, hit_rate_ptr); /* Check args */ - if(NULL == (file = (void *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") if(NULL == hit_rate_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL hit rate pointer") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - if(H5VL_file_optional(file, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(file->vol_obj, file->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_GET_MDC_HR, hit_rate_ptr) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get MDC hit rate") @@ -1306,8 +1246,7 @@ herr_t H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, int *cur_num_entries_ptr) { - H5VL_t *vol_plugin; - void *file; + H5VL_object_t *file; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1315,14 +1254,11 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr); /* Check args */ - if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - if(H5VL_file_optional(file, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_GET_MDC_SIZE, + if(H5VL_file_optional(file->vol_obj, file->vol_info->vol_cls, H5AC_dxpl_id, + H5_REQUEST_NULL, H5VL_FILE_GET_MDC_SIZE, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get MDC size") @@ -1354,22 +1290,17 @@ done: herr_t H5Freset_mdc_hit_rate_stats(hid_t file_id) { - H5VL_t *vol_plugin; - void *obj; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t *obj = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(file_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_optional(obj, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_RESET_MDC_HIT_RATE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't reset cache hit rate") @@ -1403,8 +1334,7 @@ done: ssize_t H5Fget_name(hid_t obj_id, char *name/*out*/, size_t size) { - H5VL_t *vol_plugin = NULL; - void *obj = NULL; + H5VL_object_t *obj = NULL; H5I_type_t type; ssize_t ret_value; @@ -1417,16 +1347,12 @@ H5Fget_name(hid_t obj_id, char *name/*out*/, size_t size) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") } - /* 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 file 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 file identifier") - if(H5VL_file_get(obj, vol_plugin->cls, H5VL_FILE_GET_NAME, H5AC_dxpl_id, H5_REQUEST_NULL, - type, size, name, &ret_value) < 0) + if(H5VL_file_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_GET_NAME, + H5AC_dxpl_id, H5_REQUEST_NULL, type, size, name, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file name") done: @@ -1454,8 +1380,7 @@ done: herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj = NULL; H5I_type_t type; herr_t ret_value = SUCCEED; /* Return value */ @@ -1472,15 +1397,11 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") } - /* 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 file 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 file identifier") - if(H5VL_file_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_GET_INFO, type, finfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file info") done: @@ -1507,24 +1428,19 @@ ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/) { - H5VL_t *vol_plugin; - void *file; + H5VL_object_t *file; ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("Zs", "iFmzx", file_id, type, nsects, sect_info); /* Check args */ - if(NULL == (file = (void *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") if(sect_info && nsects == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "nsects must be > 0") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - if(H5VL_file_optional(file, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(file->vol_obj, file->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_GET_FREE_SECTIONS, sect_info, &ret_value, type, nsects) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file free sections") done: @@ -1549,22 +1465,17 @@ done: herr_t H5Fclear_elink_file_cache(hid_t file_id) { - H5VL_t *vol_plugin; - void *file; + H5VL_object_t *file; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); /* Check args */ - if(NULL == (file = (void *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - if(H5VL_file_optional(file, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_file_optional(file->vol_obj, file->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL, H5VL_FILE_CLEAR_ELINK_CACHE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") diff --git a/src/H5FD.c b/src/H5FD.c index f9daf11..c779ee4 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -107,8 +107,7 @@ static const H5I_class_t H5I_VFL_CLS[1] = {{ H5I_VFL, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5FD_free_cls, /* Callback routine for closing objects of this class */ - NULL /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5FD_free_cls /* Callback routine for closing objects of this class */ }}; diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index f5a7c5d..ae46fea 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -164,7 +164,7 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) * the top file in a mount hierarchy) */ if(H5I_get_type(obj_id) == H5I_FILE ) { - if(NULL == (f = (H5F_t *)H5I_object(obj_id))) + if(NULL == (f = (H5F_t *)H5VL_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") } /* end if */ else { diff --git a/src/H5Fint.c b/src/H5Fint.c index 96ea58a..ade23f8 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -249,49 +249,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_get_obj_count_cb - * - * Purpose: H5F_get_obj_count_cb callback function. It calls in the - * VOL and gets the object count for the file ID passed - * - * Return: Non-negative on success; negative on failure. - * - * Programmer: Mohamad Chaarawi - * May 2012 - * - *------------------------------------------------------------------------- - */ -int -H5F_get_obj_count_cb(void UNUSED *obj_ptr, hid_t obj_id, void *key) -{ - H5F_trav_obj_cnt_t *udata = (H5F_trav_obj_cnt_t *)key; - ssize_t obj_count = 0; - H5VL_t *vol_plugin; - void *obj; - int ret_value = H5_ITER_CONT; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* 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 file object */ - if(NULL == (obj = (void *)H5I_object_verify(obj_id, H5I_FILE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file id") - - if(H5VL_file_get(obj, vol_plugin->cls, H5VL_FILE_GET_OBJ_COUNT, H5AC_dxpl_id, H5_REQUEST_NULL, - udata->types, &obj_count) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, H5_ITER_ERROR, "unable to get object count in file(s)") - - *(udata->obj_count) += obj_count; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_get_obj_count_cb */ - - -/*------------------------------------------------------------------------- * Function: H5F_get_obj_count * * Purpose: Private function return the number of opened object IDs @@ -324,54 +281,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_get_obj_ids_cb - * - * Purpose: H5F_get_obj_ids_cb callback function. It calls in the - * VOL and gets the object ids for the file ID passed - * - * Return: Non-negative on success; negative on failure. - * - * Programmer: Mohamad Chaarawi - * May 2012 - * - *------------------------------------------------------------------------- - */ -int -H5F_get_obj_ids_cb(void UNUSED *obj_ptr, hid_t obj_id, void *key) -{ - H5F_trav_obj_ids_t *udata = (H5F_trav_obj_ids_t *)key; - H5VL_t *vol_plugin; - void *obj; - ssize_t obj_count = 0; - int ret_value = H5_ITER_CONT; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* 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 file object */ - if(NULL == (obj = (void *)H5I_object_verify(obj_id, H5I_FILE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - - if(H5VL_file_get(obj, vol_plugin->cls, H5VL_FILE_GET_OBJ_IDS, H5AC_dxpl_id, H5_REQUEST_NULL, - udata->types, udata->max_objs, udata->oid_list, &obj_count) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, H5_ITER_ERROR, "unable to get object count in file(s)") - - *(udata->obj_count) += obj_count; - udata->max_objs -= obj_count; - udata->oid_list += obj_count; - - if(udata->max_objs <= 0) - ret_value = H5_ITER_STOP; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_get_obj_ids_cb */ - - -/*------------------------------------------------------------------------- * Function: H5F_get_obj_ids * * Purpose: Private function to return a list of opened object IDs. @@ -561,16 +470,11 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) break; case H5I_DATATYPE: - { - H5T_t *type = NULL; - - /* Get the actual datatype object that should be the vol_obj */ - if(NULL == (type = (H5T_t *)H5T_get_named_type((H5T_t*)obj_ptr))) - oloc = NULL; - else - oloc = H5T_oloc(type); - break; - } + if(H5T_is_named((H5T_t*)obj_ptr)==TRUE) + oloc = H5T_oloc((H5T_t*)obj_ptr); + else + oloc = NULL; + break; case H5I_UNINIT: case H5I_BADID: diff --git a/src/H5Fmount.c b/src/H5Fmount.c index b9fc596..fa230e2 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -28,7 +28,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Pprivate.h" /* Property lists */ #include "H5MMprivate.h" /* Memory management */ -#include "H5VLprivate.h" /* VOL plugins */ +#include "H5VLprivate.h" /* VOL */ /* PRIVATE PROTOTYPES */ static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); @@ -468,10 +468,8 @@ H5F_is_mount(const H5F_t *file) herr_t H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) { - void *obj; - void *file; - H5VL_t *vol_plugin1; /* VOL structure attached to loc_id */ - H5VL_t *vol_plugin2; /* VOL structure attached to child_id */ + H5VL_object_t *obj; + H5VL_object_t *file; H5I_type_t type; herr_t ret_value = SUCCEED; /* Return value */ @@ -492,25 +490,19 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or group object") } - /* get the plugin pointers */ - if (NULL == (vol_plugin1 = (H5VL_t *)H5I_get_aux(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - if (NULL == (vol_plugin2 = (H5VL_t *)H5I_get_aux(child_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - /* check if both objects are associated with the same VOL plugin */ - if (vol_plugin1->cls->value != vol_plugin2->cls->value) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL plugin") - /* get the group/file object */ - if(NULL == (obj = (void *)H5I_object(loc_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") /* get the file object */ - if(NULL == (file = (void *)H5I_object(child_id))) + if(NULL == (file = (H5VL_object_t *)H5I_object(child_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_specific(obj, vol_plugin1->cls, H5VL_FILE_MOUNT, H5AC_dxpl_id, - H5_REQUEST_NULL, type, name, file, plist_id) < 0) + /* check if both objects are associated with the same VOL plugin */ + if (obj->vol_info->vol_cls->value != file->vol_info->vol_cls->value) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL plugin") + + if(H5VL_file_specific(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_MOUNT, H5AC_dxpl_id, + H5_REQUEST_NULL, type, name, file->vol_obj, plist_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file") done: @@ -540,8 +532,7 @@ done: herr_t H5Funmount(hid_t loc_id, const char *name) { - void *obj; - H5VL_t *vol_plugin; /* VOL structure attached to loc_id */ + H5VL_object_t *obj; H5I_type_t type; herr_t ret_value=SUCCEED; /* Return value */ @@ -557,15 +548,11 @@ H5Funmount(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or group object") } - /* get the plugin pointers */ - 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 group/file object */ - if(NULL == (obj = (void *)H5I_object(loc_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if(H5VL_file_specific(obj, vol_plugin->cls, H5VL_FILE_UNMOUNT, H5AC_dxpl_id, + if(H5VL_file_specific(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_UNMOUNT, H5AC_dxpl_id, H5_REQUEST_NULL, type, name) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file") diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 4d3ca34..4e1b096 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -204,7 +204,7 @@ H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag) H5TRACE2("e", "ib", file_id, flag); /* Check args */ - if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Check VFD */ @@ -244,7 +244,7 @@ H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag) H5TRACE2("e", "i*b", file_id, flag); /* Check args */ - if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Check VFD */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index a44c0d7..74d7e9a 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -329,8 +329,6 @@ H5_DLL htri_t H5F_is_hdf5(const char *name, hid_t fapl_id); H5_DLL herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); H5_DLL int H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); -H5_DLL int H5F_get_obj_count_cb(void *obj_ptr, hid_t obj_id, void *key); -H5_DLL int H5F_get_obj_ids_cb(void *obj_ptr, hid_t obj_id, void *key); H5_DLL herr_t H5F_close(H5F_t *f); /* File mount related routines */ diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 73b00a6..561b292 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -105,7 +105,7 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ - if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") /* Retrieve count for message type */ @@ -142,7 +142,7 @@ H5F_check_cached_stab_test(hid_t file_id) FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ - if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") /* Verify the cached stab info */ @@ -176,7 +176,7 @@ H5F_get_maxaddr_test(hid_t file_id, haddr_t *maxaddr) FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ - if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + if(NULL == (file = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") /* Retrieve maxaddr for file */ diff --git a/src/H5G.c b/src/H5G.c index 7d2bcb4..22d367e 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -136,8 +136,7 @@ static const H5I_class_t H5I_GROUP_CLS[1] = {{ H5I_GROUP, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - NULL, /* Callback routine for closing objects of this class */ - (H5I_free2_t)H5G_close_group /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5G_close_group /* Callback routine for closing objects of this class */ }}; @@ -276,12 +275,11 @@ H5G_term_interface(void) hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id) { - void *grp = NULL; /* dset token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *grp = NULL; /* group token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - H5P_genplist_t *plist; /* Property list pointer */ - hid_t ret_value; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("i", "i*siii", loc_id, name, lcpl_id, gcpl_id, gapl_id); @@ -321,25 +319,22 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t g loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the group through the VOL */ - if(NULL == (grp = H5VL_group_create(obj, loc_params, vol_plugin->cls, name, gcpl_id, gapl_id, - H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (grp = H5VL_group_create(obj->vol_obj, loc_params, obj->vol_info->vol_cls, name, + gcpl_id, gapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") - /* Get an atom for the group with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) + /* Get an atom for the group */ + if((ret_value = H5VL_register_id(H5I_GROUP, grp, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize group handle") done: if (ret_value < 0 && grp) - if(H5VL_group_close (grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_group_close (grp, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate2() */ @@ -383,11 +378,10 @@ done: hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) { - void *grp = NULL; /* dset token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *grp = NULL; /* group 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; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("i", "iii", loc_id, gcpl_id, gapl_id); @@ -409,26 +403,22 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_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 *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the group through the VOL */ - if(NULL == (grp = H5VL_group_create(obj, loc_params, vol_plugin->cls, NULL, gcpl_id, gapl_id, - H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (grp = H5VL_group_create(obj->vol_obj, loc_params, obj->vol_info->vol_cls, NULL, + gcpl_id, gapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") - /* Get an atom for the group with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) + /* Get an atom for the group */ + if((ret_value = H5VL_register_id(H5I_GROUP, grp, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize group handle") done: if (ret_value < 0 && grp) - if(H5VL_group_close (grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_group_close (grp, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate_anon() */ @@ -454,11 +444,10 @@ done: hid_t H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) { - void *grp = NULL; /* dset token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *grp = NULL; /* group 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 */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, name, gapl_id); @@ -477,26 +466,22 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_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 *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the group through the VOL */ - if(NULL == (grp = H5VL_group_open(obj, loc_params, vol_plugin->cls, name, gapl_id, - H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (grp = H5VL_group_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + name, gapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - /* Get an atom for the group with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) + /* Get an atom for the group */ + if((ret_value = H5VL_register_id(H5I_GROUP, grp, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize group handle") done: if (ret_value < 0 && grp) - if(H5VL_group_close (grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_group_close (grp, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_API(ret_value) } /* end H5Gopen2() */ @@ -521,23 +506,18 @@ done: hid_t H5Gget_create_plist(hid_t grp_id) { - H5VL_t *vol_plugin; - void *grp; + H5VL_object_t *grp; hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", grp_id); /* Check args */ - if(NULL == (grp = (void *)H5I_object_verify(grp_id, H5I_GROUP))) + if(NULL == (grp = (H5VL_object_t *)H5I_object_verify(grp_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(grp_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - if(H5VL_group_get(grp, vol_plugin->cls, H5VL_GROUP_GET_GCPL, H5AC_dxpl_id, H5_REQUEST_NULL, - &ret_value) < 0) + if(H5VL_group_get(grp->vol_obj, grp->vol_info->vol_cls, H5VL_GROUP_GET_GCPL, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group creation properties") done: @@ -561,8 +541,7 @@ done: herr_t H5Gget_info(hid_t loc_id, H5G_info_t *grp_info) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; H5I_type_t id_type; /* Type of ID */ H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ @@ -577,19 +556,16 @@ H5Gget_info(hid_t loc_id, H5G_info_t *grp_info) if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - /* 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 dataset object */ - if(NULL == (obj = (void *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid group identifier") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = id_type; /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(obj, vol_plugin->cls, H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, - H5_REQUEST_NULL, loc_params, grp_info)) < 0) + if((ret_value = H5VL_group_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_GROUP_GET_INFO, + H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, grp_info)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: @@ -614,8 +590,7 @@ herr_t H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, 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 */ @@ -638,16 +613,13 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, 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 dataset object */ - if(NULL == (obj = (void *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid group identifier") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(obj, vol_plugin->cls, H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, - H5_REQUEST_NULL, loc_params, grp_info)) < 0) + if((ret_value = H5VL_group_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_GROUP_GET_INFO, + H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, grp_info)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: @@ -673,8 +645,7 @@ herr_t H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info, 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 */ @@ -705,15 +676,13 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_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 dataset object */ - if(NULL == (obj = (void *)H5I_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid group identifier") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(obj, vol_plugin->cls, H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, + if((ret_value = H5VL_group_get(obj->vol_obj, obj->vol_info->vol_cls, + H5VL_GROUP_GET_INFO, H5AC_ind_dxpl_id, H5_REQUEST_NULL, loc_params, grp_info)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") @@ -753,11 +722,6 @@ H5Gclose(hid_t group_id) */ if(H5I_dec_app_ref(group_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") -#if 0 - /* Close the group through the VOL */ - if(H5VL_group_close(group_id, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") -#endif done: FUNC_LEAVE_API(ret_value) @@ -779,19 +743,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_close_group(void *grp, H5VL_t *vol_plugin) +H5G_close_group(void *_grp) { + H5VL_object_t *grp = (H5VL_object_t *)_grp; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Close the group through the VOL*/ - if((ret_value = H5VL_group_close(grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_group_close(grp->vol_obj, grp->vol_info->vol_cls, + H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to close group") - /* decrement ref count on VOL ID */ - if(H5VL_free_id(vol_plugin) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin") + /* free group */ + if(H5VL_free_object(grp) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to free VOL object") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 22e09ed..c580f73 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -221,14 +221,13 @@ H5G_map_obj_type(H5O_type_t obj_type) hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) { - void *grp = NULL; /* dset token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *grp = NULL; /* group token from VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - hid_t tmp_gcpl = (-1); /* Temporary group creation property list */ - hid_t lcpl_id = H5P_LINK_CREATE_DEFAULT; - H5P_genplist_t *plist; - hid_t ret_value; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + hid_t tmp_gcpl = (-1); /* Temporary group creation property list */ + hid_t lcpl_id = H5P_LINK_CREATE_DEFAULT; + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*sz", loc_id, name, size_hint); @@ -277,21 +276,17 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the group through the VOL */ - if(NULL == (grp = H5VL_group_create(obj, loc_params, vol_plugin->cls, name, tmp_gcpl, + if(NULL == (grp = H5VL_group_create(obj->vol_obj, loc_params, obj->vol_info->vol_cls, name, tmp_gcpl, H5P_GROUP_ACCESS_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") - /* Get an atom for the group with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) + /* Get an atom for the group */ + if((ret_value = H5VL_register_id(H5I_GROUP, grp, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize group handle") done: @@ -299,7 +294,7 @@ done: if(H5I_dec_ref(tmp_gcpl) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release property list") if (ret_value < 0 && grp) - if(H5VL_group_close (grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_group_close (grp, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_API(ret_value) @@ -326,11 +321,10 @@ done: hid_t H5Gopen1(hid_t loc_id, const char *name) { - void *grp = NULL; /* dset token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *grp = NULL; /* group 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 */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); @@ -342,26 +336,22 @@ H5Gopen1(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 file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the group through the VOL */ - if(NULL == (grp = H5VL_group_open(obj, loc_params, vol_plugin->cls, name, H5P_DEFAULT, + if(NULL == (grp = H5VL_group_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, name, H5P_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") - /* Get an atom for the group with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_GROUP, grp, vol_plugin, TRUE)) < 0) + /* Get an atom for the group */ + if((ret_value = H5VL_register_id(H5I_GROUP, grp, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize group handle") done: if (ret_value < 0 && grp) - if(H5VL_group_close (grp, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_group_close (grp, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_API(ret_value) } /* end H5Gopen1() */ @@ -396,8 +386,7 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") if(type == H5L_TYPE_HARD) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin = NULL; /* VOL plugin information */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params1; H5VL_loc_params_t loc_params2; @@ -410,27 +399,23 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new loc_params2.loc_data.loc_by_name.name = new_name; loc_params2.loc_data.loc_by_name.lapl_id = H5P_DEFAULT; - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(cur_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(cur_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(cur_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* set creation properties */ - if(H5P_set(plist, H5VL_PROP_LINK_TARGET, &obj) < 0) + if(H5P_set(plist, H5VL_PROP_LINK_TARGET, &obj->vol_obj) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for target") if(H5P_set(plist, H5VL_PROP_LINK_TARGET_LOC_PARAMS, &loc_params1) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for target loc params") /* Create the link through the VOL */ - if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_HARD, NULL, loc_params2, vol_plugin->cls, + if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_HARD, NULL, loc_params2, obj->vol_info->vol_cls, lcpl_id, H5P_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") } /* end if */ else if(type == H5L_TYPE_SOFT) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin = NULL; /* VOL plugin information */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; loc_params.type = H5VL_OBJECT_BY_NAME; @@ -438,19 +423,16 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new loc_params.loc_data.loc_by_name.lapl_id = H5P_DEFAULT; loc_params.obj_type = H5I_get_type(cur_loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(cur_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(cur_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(cur_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* set creation properties */ if(H5P_set(plist, H5VL_PROP_LINK_TARGET_NAME, &cur_name) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for target name") /* Create the link through the VOL */ - if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_SOFT, obj, loc_params, vol_plugin->cls, + if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_SOFT, obj->vol_obj, loc_params, obj->vol_info->vol_cls, lcpl_id, H5P_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") } /* end else if */ @@ -492,10 +474,8 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") if(type == H5L_TYPE_HARD) { - void *obj1 = NULL; /* object token of loc_id */ - void *obj2 = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin1 = NULL; /* VOL plugin information */ - H5VL_t *vol_plugin2 = NULL; /* VOL plugin information */ + H5VL_object_t *obj1 = NULL; /* object token of loc_id */ + H5VL_object_t *obj2 = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params1; H5VL_loc_params_t loc_params2; @@ -509,35 +489,25 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, loc_params2.loc_data.loc_by_name.name = new_name; loc_params2.loc_data.loc_by_name.lapl_id = H5P_DEFAULT; - /* get the file object */ - if(NULL == (obj1 = (void *)H5I_object(cur_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin1 = (H5VL_t *)H5I_get_aux(cur_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - /* get the file object */ - if(NULL == (obj2 = (void *)H5I_object(new_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin2 = (H5VL_t *)H5I_get_aux(new_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj1 = (H5VL_object_t *)H5I_object(cur_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + if(NULL == (obj2 = (H5VL_object_t *)H5I_object(new_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* set creation properties */ - if(H5P_set(plist, H5VL_PROP_LINK_TARGET, &obj1) < 0) + if(H5P_set(plist, H5VL_PROP_LINK_TARGET, &obj1->vol_obj) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for target id") if(H5P_set(plist, H5VL_PROP_LINK_TARGET_LOC_PARAMS, &loc_params1) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for target name") /* Create the link through the VOL */ - if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_HARD, obj2, loc_params2, - (vol_plugin1!=NULL ? vol_plugin1->cls : vol_plugin2->cls), + if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_HARD, obj2->vol_obj, loc_params2, obj2->vol_info->vol_cls, lcpl_id, H5P_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") } /* end if */ else if(type == H5L_TYPE_SOFT) { - 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; /* Soft links only need one location, the new_loc_id, but it's possible that @@ -550,19 +520,16 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, loc_params.loc_data.loc_by_name.lapl_id = H5P_DEFAULT; loc_params.obj_type = H5I_get_type(new_loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(new_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(new_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(new_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* set creation properties */ if(H5P_set(plist, H5VL_PROP_LINK_TARGET_NAME, &cur_name) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for target name") /* Create the link through the VOL */ - if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_SOFT, obj, loc_params, vol_plugin->cls, + if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_SOFT, obj->vol_obj, loc_params, obj->vol_info->vol_cls, lcpl_id, H5P_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") } /* end else if */ @@ -584,8 +551,7 @@ done: herr_t H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin = NULL; /* VOL plugin information */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params1; H5VL_loc_params_t loc_params2; herr_t ret_value = SUCCEED; /* Return value */ @@ -602,15 +568,12 @@ H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name) loc_params2.loc_data.loc_by_name.name = dst_name; loc_params2.loc_data.loc_by_name.lapl_id = H5P_DEFAULT; - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(src_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(src_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(src_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the link through the VOL */ - if((ret_value = H5VL_link_move(obj, loc_params1, NULL, loc_params2, vol_plugin->cls, + if((ret_value = H5VL_link_move(obj->vol_obj, loc_params1, NULL, loc_params2, obj->vol_info->vol_cls, H5P_DEFAULT, H5P_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") @@ -630,11 +593,9 @@ herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name) { - void *obj1 = NULL; /* object token of src_id */ - H5VL_t *vol_plugin1; /* VOL plugin information */ + H5VL_object_t *obj1 = NULL; /* object token of src_id */ H5VL_loc_params_t loc_params1; - void *obj2 = NULL; /* object token of dst_id */ - H5VL_t *vol_plugin2; /* VOL plugin information */ + H5VL_object_t *obj2 = NULL; /* object token of dst_id */ H5VL_loc_params_t loc_params2; herr_t ret_value = SUCCEED; /* Return value */ @@ -653,30 +614,19 @@ H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, loc_params2.obj_type = H5I_get_type(dst_loc_id); if(H5L_SAME_LOC != src_loc_id) { - /* get the file object */ - if(NULL == (obj1 = (void *)H5I_object(src_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin1 = (H5VL_t *)H5I_get_aux(src_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj1 = (H5VL_object_t *)H5I_object(src_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } if(H5L_SAME_LOC != dst_loc_id) { - /* get the file object */ - if(NULL == (obj2 = (void *)H5I_object(dst_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin2 = (H5VL_t *)H5I_get_aux(dst_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - } - /* Make sure that the VOL plugins are the same */ - if(H5L_SAME_LOC != dst_loc_id && H5L_SAME_LOC != src_loc_id) { - if (vol_plugin1 != vol_plugin2) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked") + /* get the location object */ + if(NULL == (obj2 = (H5VL_object_t *)H5I_object(dst_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } /* Move the link through the VOL */ - if((ret_value = H5VL_link_move(obj1, loc_params1, obj2, loc_params2, - (vol_plugin1!=NULL ? vol_plugin1->cls : vol_plugin2->cls), + if((ret_value = H5VL_link_move(obj1->vol_obj, loc_params1, obj2->vol_obj, loc_params2, + obj1->vol_info->vol_cls, H5P_DEFAULT, H5P_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") @@ -695,8 +645,7 @@ done: herr_t H5Gunlink(hid_t loc_id, const char *name) { - 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 */ @@ -711,15 +660,12 @@ H5Gunlink(hid_t loc_id, const char *name) loc_params.loc_data.loc_by_name.name = name; loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT; - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Delete the link through the VOL */ - if(H5VL_link_specific(obj, loc_params, vol_plugin->cls, H5VL_LINK_DELETE, + if(H5VL_link_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_DELETE, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link") @@ -739,8 +685,7 @@ done: herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { - 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 */ @@ -756,15 +701,12 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) loc_params.loc_data.loc_by_name.name = name; loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT; - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the link info through the VOL */ - if((ret_value = H5VL_link_get(obj, loc_params, vol_plugin->cls, H5VL_LINK_GET_VAL, + if((ret_value = H5VL_link_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_GET_VAL, H5AC_ind_dxpl_id, H5_REQUEST_NULL, buf, size)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get link value") @@ -858,124 +800,6 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Gget_comment() */ -#if 0 - -/*------------------------------------------------------------------------- - * Function: H5Gset_comment - * - * Purpose: Gives the specified object a comment. The COMMENT string - * should be a null terminated string. An object can have only - * one comment at a time. Passing NULL for the COMMENT argument - * will remove the comment property from the object. - * - * Note: Deprecated in favor of H5Oset_comment/H5Oset_comment_by_name - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, July 20, 1998 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Gset_comment(hid_t loc_id, const char *name, const char *comment) -{ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*s*s", loc_id, name, comment); - - if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - - loc_params.type = H5VL_OBJECT_BY_NAME; - loc_params.loc_data.loc_by_name.name = name; - loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT; - loc_params.obj_type = H5I_get_type(loc_id); - - /* get the file object */ - if(NULL == (obj = (void *)H5I_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") - - /* set comment on object through the VOL */ - if(H5VL_object_optional(obj, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, - H5VL_OBJECT_SET_COMMENT, loc_params, comment) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to set comment value") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Gset_comment() */ - - -/*------------------------------------------------------------------------- - * Function: H5Gget_comment - * - * Purpose: Return at most BUFSIZE characters of the comment for the - * specified object. If BUFSIZE is large enough to hold the - * entire comment then the comment string will be null - * terminated, otherwise it will not. If the object does not - * have a comment value then no bytes are copied to the BUF - * buffer. - * - * Note: Deprecated in favor of H5Oget_comment/H5Oget_comment_by_name - * - * Return: Success: Number of characters in the comment counting - * the null terminator. The value returned may - * be larger than the BUFSIZE argument. - * - * Failure: Negative - * - * Programmer: Robb Matzke - * Monday, July 20, 1998 - * - *------------------------------------------------------------------------- - */ -int -H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) -{ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5VL_loc_params_t loc_params; - ssize_t size; - int ret_value; - - FUNC_ENTER_API(FAIL) - H5TRACE4("Is", "i*sz*s", loc_id, name, bufsize, buf); - - if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - if(bufsize > 0 && !buf) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no buffer specified") - - loc_params.type = H5VL_OBJECT_BY_NAME; - loc_params.loc_data.loc_by_name.name = name; - loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT; - loc_params.obj_type = H5I_get_type(loc_id); - - /* get the file object */ - if(NULL == (obj = (void *)H5I_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(H5VL_object_optional(obj, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL, - H5VL_OBJECT_GET_COMMENT, loc_params, buf, bufsize, &size) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get object comment") - - ret_value = (int)size; - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Gget_comment() */ -#endif - /*------------------------------------------------------------------------- * Function: H5Giterate diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 4503f15..3786967 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -179,8 +179,7 @@ H5G_loc_real(void *obj, H5I_type_t type, H5G_loc_t *loc) H5T_t *dt = NULL; /* Get the actual datatype object if the VOL object is set */ - if(NULL == (dt = (H5T_t *)H5T_get_named_type((const H5T_t *)obj))) - dt = (H5T_t *) obj; + dt = (H5T_t *)H5T_get_actual_type((H5T_t *)obj); if(NULL == (loc->oloc = H5T_oloc(dt))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location of datatype") @@ -236,11 +235,16 @@ done: herr_t H5G_loc(hid_t loc_id, H5G_loc_t *loc) { + void *obj = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - if(H5G_loc_real(H5I_object(loc_id), H5I_get_type(loc_id), loc) < 0) + /* get the object */ + if(NULL == (obj = H5VL_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid identifier") + + if(H5G_loc_real(obj, H5I_get_type(loc_id), loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") done: diff --git a/src/H5Gname.c b/src/H5Gname.c index f48234d..6f2c8ba 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -824,21 +824,12 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) break; case H5I_DATATYPE: - { - H5T_t *type = NULL; + /* Avoid non-named datatypes */ + if(!H5T_is_named((H5T_t*)obj_ptr)) + HGOTO_DONE(SUCCEED) /* Do not exit search over IDs */ - /* Get the actual datatype object that should be the vol_obj */ - if(NULL == (type = (H5T_t *)H5T_get_named_type((H5T_t*)obj_ptr))) - HGOTO_DONE(SUCCEED) /* Do not exit search over IDs */ - - /* Avoid non-named datatypes */ - if(!H5T_is_named(type)) - HGOTO_DONE(SUCCEED) /* Do not exit search over IDs */ - - oloc = H5T_oloc(type); - obj_path = H5T_nameof(type); - break; - } + oloc = H5T_oloc((H5T_t*)obj_ptr); + obj_path = H5T_nameof((H5T_t*)obj_ptr); break; case H5I_UNINIT: @@ -848,6 +839,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_ATTR: case H5I_REFERENCE: case H5I_VFL: + case H5I_VOL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: case H5I_ERROR_CLASS: diff --git a/src/H5Goh.c b/src/H5Goh.c index c6115db..36b2096 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -307,7 +307,7 @@ H5O_group_get_oloc(hid_t obj_id) FUNC_ENTER_NOAPI_NOINIT /* Get the group */ - if(NULL == (grp = (H5G_t *)H5I_object(obj_id))) + if(NULL == (grp = (H5G_t *)H5VL_object(obj_id))) HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID") /* Get the group's object header location */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 1608447..da9884a 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -103,7 +103,7 @@ H5G__is_empty_test(hid_t gid) FUNC_ENTER_PACKAGE /* Get group structure */ - if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) + if(NULL == (grp = (H5G_t *)H5VL_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* "New format" checks */ @@ -214,7 +214,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) FUNC_ENTER_PACKAGE /* Get group structure */ - if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) + if(NULL == (grp = (H5G_t *)H5VL_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Check if the group has any link messages */ @@ -272,7 +272,7 @@ H5G__has_stab_test(hid_t gid) FUNC_ENTER_PACKAGE /* Get group structure */ - if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) + if(NULL == (grp = (H5G_t *)H5VL_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Check if the group has a symbol table message */ @@ -322,7 +322,7 @@ H5G__is_new_dense_test(hid_t gid) FUNC_ENTER_PACKAGE /* Get group structure */ - if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) + if(NULL == (grp = (H5G_t *)H5VL_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Check if the group has a symbol table message */ @@ -392,7 +392,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) FUNC_ENTER_PACKAGE /* Get group structure */ - if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) + if(NULL == (grp = (H5G_t *)H5VL_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Set metadata tag in dxpl_id */ @@ -472,7 +472,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) FUNC_ENTER_PACKAGE /* Get group structure */ - if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) + if(NULL == (grp = (H5G_t *)H5VL_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Make certain the group has a symbol table message */ @@ -524,7 +524,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign HDassert(obj_hidden); /* Get pointer to object for ID */ - if(NULL == (obj_ptr = H5I_object(obj_id))) + if(NULL == (obj_ptr = H5VL_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get object for ID") /* Get the symbol table entry */ @@ -538,18 +538,12 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign break; case H5I_DATATYPE: - { - H5T_t *type = NULL; - - /* Get the actual datatype object that should be the vol_obj */ - if(NULL == (type = (H5T_t *)H5T_get_named_type((H5T_t*)obj_ptr))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a named datatype") - /* Avoid non-named datatypes */ - if(!H5T_is_named(type)) - HGOTO_DONE(SUCCEED) /* Do not exit search over IDs */ - obj_path = H5T_nameof(type); - break; - } + /* Avoid non-named datatypes */ + if(!H5T_is_named((H5T_t *)obj_ptr)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a named datatype") + + obj_path = H5T_nameof((H5T_t *)obj_ptr); + break; case H5I_UNINIT: case H5I_BADID: @@ -779,7 +773,7 @@ H5G__verify_cached_stabs_test(hid_t gid) HDassert(gid >= 0); /* Check args */ - if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) + if(NULL == (grp = (H5G_t *)H5VL_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Set up metadata tagging */ diff --git a/src/H5I.c b/src/H5I.c index 314adf2..f0c26bf 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -77,7 +77,6 @@ typedef struct H5I_id_info_t { unsigned count; /* ref. count for this atom */ unsigned app_count; /* ref. count of application visible atoms */ const void *obj_ptr; /* pointer associated with the atom */ - const void *aux_ptr; /* auxilary pointer associated with the atom */ } H5I_id_info_t; /* ID type structure used */ @@ -102,7 +101,8 @@ typedef struct { /* User data for iterator callback for retrieveing an ID correponding to an object pointer */ typedef struct { - const void *object; /* object pointer to search for */ + const void *object; /* object pointer to search for */ + H5I_type_t obj_type; /* type of object we are searching for */ hid_t ret_id; /* ID returned */ } H5I_get_id_ud_t; @@ -111,6 +111,7 @@ typedef struct { H5I_search_func_t user_func; /* 'User' function to invoke */ void *user_udata; /* User data to pass to 'user' function */ hbool_t app_ref; /* Whether this is an appl. ref. call */ + H5I_type_t obj_type; /* type of object we are iterating over */ } H5I_iterate_ud_t; /*-------------------- Locally scoped variables -----------------------------*/ @@ -135,6 +136,8 @@ H5FL_DEFINE_STATIC(H5I_id_type_t); /* Declare a free list to manage the H5I_class_t struct */ H5FL_DEFINE_STATIC(H5I_class_t); +H5FL_EXTERN(H5VL_object_t); + /*--------------------- Local function prototypes ---------------------------*/ static int H5I__destroy_type(H5I_type_t type); static void *H5I__remove_verify(hid_t id, H5I_type_t id_type); @@ -287,7 +290,6 @@ H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func) cls->flags = H5I_CLASS_IS_APPLICATION; cls->reserved = reserved; cls->free_func = free_func; - cls->free_aux = NULL; /* Register the new ID class */ if(H5I_register_type(cls) < 0) @@ -570,7 +572,6 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) /* Get ID for this node */ if(NULL == (cur = (H5I_id_info_t *)H5SL_item(curr_node))) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID info for node") - herr_t result1 = SUCCEED, result2 = SUCCEED; /* * Do nothing to the object if the reference count is larger than @@ -581,11 +582,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) else { /* Check for a 'free' function and call it, if it exists */ /* (Casting away const OK -QAK) */ - if(cur->aux_ptr && type_ptr->cls->free_aux) - result1 = (type_ptr->cls->free_aux)((void *)cur->obj_ptr, (void *)cur->aux_ptr); - if(type_ptr->cls->free_func) - result2 = (type_ptr->cls->free_func)((void *)cur->obj_ptr); - if(result1 < 0 || result2 < 0) { + if(type_ptr->cls->free_func && (type_ptr->cls->free_func)((void *)cur->obj_ptr) < 0) { if(force) { #ifdef H5I_DEBUG if(H5DEBUG(I)) { @@ -790,7 +787,6 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) id_ptr->count = 1; /*initial reference count*/ id_ptr->app_count = !!app_ref; id_ptr->obj_ptr = object; - id_ptr->aux_ptr = NULL; /* Insert into the type */ if(H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) @@ -812,66 +808,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_register2 - * - * Purpose: This routine does the same as H5I_register, and additionally - * attaches an auxilary structure to the id - * - * Return: Success: New object id. - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * - * - *------------------------------------------------------------------------- - */ -hid_t -H5I_register2(H5I_type_t type, const void *object, const void *aux_object, hbool_t app_ref) -{ - H5I_id_type_t *type_ptr; /*ptr to the type */ - H5I_id_info_t *id_ptr; /*ptr to the new ID information */ - hid_t new_id = FAIL; /*new ID */ - hid_t ret_value = FAIL; /*return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check arguments */ - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - type_ptr = H5I_id_type_list_g[type]; - if(NULL == type_ptr || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - if(NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t))) - HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Create the struct & it's ID */ - new_id = H5I_MAKE(type, type_ptr->nextid); - id_ptr->id = new_id; - id_ptr->count = 1; /*initial reference count*/ - id_ptr->app_count = !!app_ref; - id_ptr->obj_ptr = object; - id_ptr->aux_ptr = aux_object; - - /* Insert into the type */ - if(H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list") - type_ptr->id_count++; - type_ptr->nextid++; - - /* - * Sanity check for the 'nextid' getting too large and wrapping around. - */ - HDassert(type_ptr->nextid <= ID_MASK); - - /* Set return value */ - ret_value = new_id; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_register2() */ - - -/*------------------------------------------------------------------------- * Function: H5I_subst * * Purpose: Substitute a new object pointer for the specified ID. @@ -1327,9 +1263,7 @@ H5I_dec_ref(hid_t id) */ if(1 == id_ptr->count) { /* (Casting away const OK -QAK) */ - if((!type_ptr->cls->free_aux || !id_ptr->aux_ptr || - (type_ptr->cls->free_aux)((void *)id_ptr->obj_ptr, (void *)id_ptr->aux_ptr) >= 0) && - (!type_ptr->cls->free_func || (type_ptr->cls->free_func)((void *)id_ptr->obj_ptr) >= 0)) { + if(!type_ptr->cls->free_func || (type_ptr->cls->free_func)((void *)id_ptr->obj_ptr) >= 0) { /* Remove the node from the type */ if(NULL == H5I__remove_common(type_ptr, id)) HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, FAIL, "can't remove ID node") @@ -2078,10 +2012,25 @@ H5I__iterate_cb(void *_item, void UNUSED *_key, void *_udata) FUNC_ENTER_STATIC_NOERR /* Don't make callback if app_ref is set and the appl. ref count is 0 */ - if((!udata->app_ref) || (item->app_count > 0)) + if((!udata->app_ref) || (item->app_count > 0)) { + H5I_type_t type = udata->obj_type; + const void *obj_ptr = NULL; + + if(H5I_FILE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) { + const H5VL_object_t *obj = (const H5VL_object_t *)item->obj_ptr; + obj_ptr = obj->vol_obj; + } + else if(H5I_DATATYPE == type) { + const H5T_t *dt = (const H5T_t *)item->obj_ptr; + obj_ptr = (void *)H5T_get_actual_type(dt); + } + else + obj_ptr = item->obj_ptr; + /* (Casting away const OK) */ - ret_value = (*udata->user_func)((void *)item->obj_ptr, item->id, udata->user_udata); + ret_value = (*udata->user_func)((void *)obj_ptr, item->id, udata->user_udata); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__iterate_cb() */ @@ -2133,6 +2082,7 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re iter_udata.user_func = func; iter_udata.user_udata = udata; iter_udata.app_ref = app_ref; + iter_udata.obj_type = type; /* Iterate over IDs */ if((ret_value = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0) @@ -2254,8 +2204,7 @@ done: hid_t H5Iget_file_id(hid_t obj_id) { - H5VL_t *vol_plugin; - void *obj; + H5VL_object_t *obj; void *file = NULL; H5I_type_t type; /* ID type */ hid_t ret_value; /* Return value */ @@ -2269,29 +2218,21 @@ H5Iget_file_id(hid_t obj_id) if(H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) { /* get the object pointer*/ - if(NULL == (obj = (void *)H5I_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* 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") - - /* If this is a named datatype, get the vol_obj from the H5T_t struct*/ - if (H5I_DATATYPE == type) { - if (NULL == (obj = H5T_get_named_type((H5T_t *)obj))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a named datatype") - } + if(NULL == (obj = H5VL_get_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid identifier") /* Get the file through the VOL */ - if(H5VL_file_get(obj, vol_plugin->cls, H5VL_OBJECT_GET_FILE, H5AC_dxpl_id, - H5_REQUEST_NULL, type, &file) < 0) + if(H5VL_file_get(obj->vol_obj, obj->vol_info->vol_cls, H5VL_OBJECT_GET_FILE, + H5AC_dxpl_id, H5_REQUEST_NULL, type, &file) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to get file") + if (NULL == file) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") /* Check if the ID already exists and procceed accordingly */ if (FAIL == (ret_value = H5I_get_id(file, H5I_FILE))) { - /* Get an atom for the file with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_FILE, file, vol_plugin, TRUE)) < 0) + /* Get an atom for the file */ + if((ret_value = H5VL_register_id(H5I_FILE, file, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") } else { @@ -2345,25 +2286,9 @@ H5I_get_file_id(hid_t obj_id, hbool_t app_ref) else if(type == H5I_DATATYPE || type == H5I_GROUP || type == H5I_DATASET || type == H5I_ATTR) { H5G_loc_t loc; /* Location of object */ - /* If object is a named datatype, we need to do extra processing to get the actual - datatype struct (the VOL struct) */ - if (H5I_DATATYPE == type) { - void *obj = NULL; - - /* get the dt object */ - if(NULL == (obj = (void *)H5I_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if (NULL == (obj = H5T_get_named_type((H5T_t *)obj))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a named datatype") - /* Get the object location information */ - if(H5G_loc_real(obj, type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - } - else { - /* Get the object location information */ - if(H5G_loc(obj_id, &loc) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get object location") - } + /* Get the object location information */ + if(H5G_loc(obj_id, &loc) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get object location") /* Get the file ID for the object */ if((ret_value = H5F_get_id(loc.oloc->file, app_ref)) < 0) @@ -2375,67 +2300,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_file_id() */ -/*------------------------------------------------------------------------- - * Function: H5I_register_aux - * - * Purpose: register an Auxilary object and a free func with an existing ID - * - * Return: Success: postive - * Failure: FAIL - * - * Programmer: Mohamad Chaarawi - * May 2012 - * - *------------------------------------------------------------------------- - */ -herr_t -H5I_register_aux(hid_t id, void *aux_ptr) -{ - H5I_id_info_t *id_ptr = NULL; /*ptr to the id*/ - herr_t ret_value = SUCCEED; /*return value*/ - - FUNC_ENTER_NOAPI_NOINIT - - if(NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "Invalid ID") - - id_ptr->aux_ptr = aux_ptr; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_register_aux() */ - - -/*------------------------------------------------------------------------- - * Function: H5I_get_aux - * - * Purpose: return the aux ptr - * - * Return: Success: Non-null auxilary pointer associated with the - * specified ID. - * Failure: NULL - * - * Programmer: Mohamad Chaarawi - * May 2012 - * - *------------------------------------------------------------------------- - */ -void * -H5I_get_aux(hid_t id) -{ - H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ - void *ret_value = NULL; /*return value */ - - FUNC_ENTER_NOAPI(NULL) - - if(NULL != (id_ptr = H5I__find_id(id))) { - ret_value = (void *)id_ptr->aux_ptr; - } - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_get_aux() */ - /*------------------------------------------------------------------------- * Function: H5I__get_id_cb @@ -2455,6 +2319,8 @@ H5I__get_id_cb(void *_item, void UNUSED *_key, void *_udata) { H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ H5I_get_id_ud_t *udata = (H5I_get_id_ud_t *)_udata; /* Pointer to user data */ + H5I_type_t type = udata->obj_type; + const void *obj_ptr = NULL; int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -2463,7 +2329,18 @@ H5I__get_id_cb(void *_item, void UNUSED *_key, void *_udata) HDassert(item); HDassert(udata); - if (item->obj_ptr == udata->object) { + if(H5I_FILE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) { + const H5VL_object_t *obj = (const H5VL_object_t *)item->obj_ptr; + obj_ptr = obj->vol_obj; + } + else if(H5I_DATATYPE == type) { + const H5T_t *dt = (const H5T_t *)item->obj_ptr; + obj_ptr = (void *)H5T_get_actual_type(dt); + } + else + obj_ptr = item->obj_ptr; + + if (obj_ptr == udata->object) { udata->ret_id = item->id; ret_value = H5_ITER_STOP; } @@ -2504,6 +2381,7 @@ H5I_get_id(const void *object, H5I_type_t type) /* Set up iterator user data */ udata.object = object; + udata.obj_type = type; udata.ret_id = FAIL; /* Iterate over IDs */ diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index ef8b3d3..1bc1f24 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -56,7 +56,6 @@ typedef struct H5I_class_t { * and are not allocated dynamically later.] */ H5I_free_t free_func; /* Free function for object's of this type */ - H5I_free2_t free_aux; /* Free function for auxilary objects of this type */ } H5I_class_t; @@ -72,7 +71,6 @@ H5_DLL herr_t H5I_register_type(const H5I_class_t *cls); H5_DLL int64_t H5I_nmembers(H5I_type_t type); H5_DLL herr_t H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref); H5_DLL hid_t H5I_register(H5I_type_t type, const void *object, hbool_t app_ref); -H5_DLL hid_t H5I_register2(H5I_type_t type, const void *object, const void* aux_object, hbool_t app_ref); H5_DLL void *H5I_subst(hid_t id, const void *new_object); H5_DLL void *H5I_object(hid_t id); H5_DLL void *H5I_object_verify(hid_t id, H5I_type_t id_type); @@ -86,8 +84,6 @@ H5_DLL int H5I_dec_ref(hid_t id); H5_DLL int H5I_dec_app_ref(hid_t id); H5_DLL int H5I_dec_app_ref_always_close(hid_t id); H5_DLL herr_t H5I_dec_type_ref(H5I_type_t type); -H5_DLL herr_t H5I_register_aux(hid_t id, void *aux_ptr); -H5_DLL void *H5I_get_aux(hid_t id); H5_DLL hid_t H5I_get_id(const void *object, H5I_type_t type); #endif /* _H5Iprivate_H */ diff --git a/src/H5L.c b/src/H5L.c index 7ce316a..857153e 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -264,11 +264,9 @@ herr_t H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name, hid_t lcpl_id, hid_t lapl_id) { - void *obj1 = NULL; /* object token of src_id */ - H5VL_t *vol_plugin1; /* VOL plugin information */ + H5VL_object_t *obj1 = NULL; /* object token of src_id */ H5VL_loc_params_t loc_params1; - void *obj2 = NULL; /* object token of dst_id */ - H5VL_t *vol_plugin2; /* VOL plugin information */ + H5VL_object_t *obj2 = NULL; /* object token of dst_id */ H5VL_loc_params_t loc_params2; herr_t ret_value=SUCCEED; /* Return value */ @@ -305,30 +303,26 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, loc_params2.obj_type = H5I_get_type(dst_loc_id); if(H5L_SAME_LOC != src_loc_id) { - /* get the file object */ - if(NULL == (obj1 = (void *)H5I_object(src_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin1 = (H5VL_t *)H5I_get_aux(src_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj1 = (H5VL_object_t *)H5I_object(src_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } if(H5L_SAME_LOC != dst_loc_id) { - /* get the file object */ - if(NULL == (obj2 = (void *)H5I_object(dst_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin2 = (H5VL_t *)H5I_get_aux(dst_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj2 = (H5VL_object_t *)H5I_object(dst_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } + /* Make sure that the VOL plugins are the same */ - if(H5L_SAME_LOC != dst_loc_id && H5L_SAME_LOC != src_loc_id) { - if (vol_plugin1->cls != vol_plugin2->cls) + if(obj1 && obj2) { + if (obj1->vol_info->vol_cls->value != obj2->vol_info->vol_cls->value) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked") } /* Move the link through the VOL */ - if(H5VL_link_move(obj1, loc_params1, obj2, loc_params2, - (vol_plugin1!=NULL ? vol_plugin1->cls : vol_plugin2->cls), + if(H5VL_link_move((obj1 ? obj1->vol_obj : NULL), loc_params1, + (obj2 ? obj2->vol_obj : NULL), loc_params2, + (obj1 ? obj1->vol_info->vol_cls : obj2->vol_info->vol_cls), lcpl_id, lapl_id, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") @@ -355,11 +349,9 @@ herr_t H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name, hid_t lcpl_id, hid_t lapl_id) { - void *obj1 = NULL; /* object token of src_id */ - H5VL_t *vol_plugin1; /* VOL plugin information */ + H5VL_object_t *obj1 = NULL; /* object token of src_id */ H5VL_loc_params_t loc_params1; - void *obj2 = NULL; /* object token of dst_id */ - H5VL_t *vol_plugin2; /* VOL plugin information */ + H5VL_object_t *obj2 = NULL; /* object token of dst_id */ H5VL_loc_params_t loc_params2; herr_t ret_value=SUCCEED; /* Return value */ @@ -396,30 +388,26 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, loc_params2.obj_type = H5I_get_type(dst_loc_id); if(H5L_SAME_LOC != src_loc_id) { - /* get the file object */ - if(NULL == (obj1 = (void *)H5I_object(src_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin1 = (H5VL_t *)H5I_get_aux(src_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj1 = (H5VL_object_t *)H5I_object(src_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } if(H5L_SAME_LOC != dst_loc_id) { - /* get the file object */ - if(NULL == (obj2 = (void *)H5I_object(dst_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin2 = (H5VL_t *)H5I_get_aux(dst_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj2 = (H5VL_object_t *)H5I_object(dst_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } + /* Make sure that the VOL plugins are the same */ - if(H5L_SAME_LOC != dst_loc_id && H5L_SAME_LOC != src_loc_id) { - if (vol_plugin1->cls != vol_plugin2->cls) + if(obj1 && obj2) { + if (obj1->vol_info->vol_cls->value != obj2->vol_info->vol_cls->value) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked") } /* Move the link through the VOL */ - if(H5VL_link_copy(obj1, loc_params1, obj2, loc_params2, - (vol_plugin1!=NULL ? vol_plugin1->cls : vol_plugin2->cls), + if(H5VL_link_copy((obj1 ? obj1->vol_obj : NULL), loc_params1, + (obj2 ? obj2->vol_obj : NULL), loc_params2, + (obj1 ? obj1->vol_info->vol_cls : obj2->vol_info->vol_cls), lcpl_id, lapl_id, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") done: @@ -449,8 +437,7 @@ herr_t H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, 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; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -480,12 +467,9 @@ H5Lcreate_soft(const char *link_target, loc_params.loc_data.loc_by_name.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(link_loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(link_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(link_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5VL_get_object(link_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the plist structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(lcpl_id))) @@ -496,7 +480,7 @@ H5Lcreate_soft(const char *link_target, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for target name") /* Create the link through the VOL */ - if(H5VL_link_create(H5VL_LINK_CREATE_SOFT, obj, loc_params, vol_plugin->cls, + if(H5VL_link_create(H5VL_LINK_CREATE_SOFT, obj->vol_obj, loc_params, obj->vol_info->vol_cls, lcpl_id, lapl_id, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") @@ -525,10 +509,8 @@ herr_t H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id) { - void *obj1 = NULL; /* object token of loc_id */ - void *obj2 = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin1 = NULL; /* VOL plugin information */ - H5VL_t *vol_plugin2 = NULL; /* VOL plugin information */ + H5VL_object_t *obj1 = NULL; /* object token of cur_loc_id */ + H5VL_object_t *obj2 = NULL; /* object token of new_loc_id */ H5VL_loc_params_t loc_params1; H5VL_loc_params_t loc_params2; H5P_genplist_t *plist; /* Property list pointer */ @@ -566,24 +548,18 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, loc_params2.loc_data.loc_by_name.lapl_id = lapl_id; if(H5L_SAME_LOC != cur_loc_id) { - /* get the file object */ - if(NULL == (obj1 = (void *)H5I_object(cur_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin1 = (H5VL_t *)H5I_get_aux(cur_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj1 = (H5VL_object_t *)H5VL_get_object(cur_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } if(H5L_SAME_LOC != new_loc_id) { - /* get the file object */ - if(NULL == (obj2 = (void *)H5I_object(new_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin2 = (H5VL_t *)H5I_get_aux(new_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj2 = (H5VL_object_t *)H5VL_get_object(new_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } /* Make sure that the VOL plugins are the same */ - if(H5L_SAME_LOC != new_loc_id && H5L_SAME_LOC != cur_loc_id) { - if (vol_plugin1->cls != vol_plugin2->cls) + if(obj1 && obj2) { + if (obj1->vol_info->vol_cls->value != obj2->vol_info->vol_cls->value) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked") } @@ -592,14 +568,14 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* set creation properties */ - if(H5P_set(plist, H5VL_PROP_LINK_TARGET, &obj1) < 0) + if(H5P_set(plist, H5VL_PROP_LINK_TARGET, (obj1 ? &(obj1->vol_obj) : NULL)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for target id") if(H5P_set(plist, H5VL_PROP_LINK_TARGET_LOC_PARAMS, &loc_params1) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for target name") /* Create the link through the VOL */ - if(H5VL_link_create(H5VL_LINK_CREATE_HARD, obj2, loc_params2, - (vol_plugin1!=NULL ? vol_plugin1->cls : vol_plugin2->cls), + if(H5VL_link_create(H5VL_LINK_CREATE_HARD, (obj2 ? (obj2->vol_obj) : NULL), loc_params2, + (obj1!=NULL ? obj1->vol_info->vol_cls : obj2->vol_info->vol_cls), lcpl_id, lapl_id, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") @@ -636,8 +612,7 @@ herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id, 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; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -664,12 +639,9 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, loc_params.loc_data.loc_by_name.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(link_loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(link_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(link_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(link_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the plist structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(lcpl_id))) @@ -684,7 +656,7 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value from plist") /* Create the link through the VOL */ - if(H5VL_link_create(H5VL_LINK_CREATE_UD, obj, loc_params, vol_plugin->cls, + if(H5VL_link_create(H5VL_LINK_CREATE_UD, obj->vol_obj, loc_params, obj->vol_info->vol_cls, lcpl_id, lapl_id, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") @@ -713,8 +685,7 @@ done: herr_t H5Ldelete(hid_t loc_id, const char *name, 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 */ @@ -730,15 +701,12 @@ H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) loc_params.loc_data.loc_by_name.name = name; loc_params.loc_data.loc_by_name.lapl_id = lapl_id; - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Delete the link through the VOL */ - if(H5VL_link_specific(obj, loc_params, vol_plugin->cls, H5VL_LINK_DELETE, + if(H5VL_link_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_DELETE, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link") @@ -770,8 +738,7 @@ herr_t H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, 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 */ @@ -799,15 +766,12 @@ H5Ldelete_by_idx(hid_t loc_id, const char *group_name, 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 *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Delete the link through the VOL */ - if(H5VL_link_specific(obj, loc_params, vol_plugin->cls, H5VL_LINK_DELETE, + if(H5VL_link_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_DELETE, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link") @@ -839,8 +803,7 @@ herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, 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 */ @@ -861,15 +824,12 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, loc_params.loc_data.loc_by_name.name = name; loc_params.loc_data.loc_by_name.lapl_id = lapl_id; - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the link info through the VOL */ - if(H5VL_link_get(obj, loc_params, vol_plugin->cls, H5VL_LINK_GET_VAL, + if(H5VL_link_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_GET_VAL, H5AC_ind_dxpl_id, H5_REQUEST_NULL, buf, size) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get link value") @@ -901,8 +861,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, void *buf/*out*/, size_t size, 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 */ @@ -931,15 +890,12 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_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 *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the link info through the VOL */ - if(H5VL_link_get(obj, loc_params, vol_plugin->cls, H5VL_LINK_GET_VAL, + if(H5VL_link_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_GET_VAL, H5AC_ind_dxpl_id, H5_REQUEST_NULL, buf, size) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get link value") @@ -964,8 +920,7 @@ done: htri_t H5Lexists(hid_t loc_id, const char *name, 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; htri_t ret_value; @@ -986,15 +941,12 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) loc_params.loc_data.loc_by_name.name = name; loc_params.loc_data.loc_by_name.lapl_id = lapl_id; - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* check link existence through the VOL */ - if(H5VL_link_specific(obj, loc_params, vol_plugin->cls, H5VL_LINK_EXISTS, + if(H5VL_link_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_EXISTS, H5AC_ind_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get link info") @@ -1021,8 +973,7 @@ herr_t H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, 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; @@ -1042,15 +993,12 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, loc_params.loc_data.loc_by_name.name = name; loc_params.loc_data.loc_by_name.lapl_id = lapl_id; - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the link info through the VOL */ - if(H5VL_link_get(obj, loc_params, vol_plugin->cls, H5VL_LINK_GET_INFO, + if(H5VL_link_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_GET_INFO, H5AC_ind_dxpl_id, H5_REQUEST_NULL, linfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get link info") @@ -1078,8 +1026,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5L_info_t *linfo /*out*/, 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 */ @@ -1108,15 +1055,12 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, 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 *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the link info through the VOL */ - if(H5VL_link_get(obj, loc_params, vol_plugin->cls, H5VL_LINK_GET_INFO, + if(H5VL_link_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_GET_INFO, H5AC_ind_dxpl_id, H5_REQUEST_NULL, linfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get link info") @@ -1274,8 +1218,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name /*out*/, size_t size, 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; ssize_t ret_value; /* Return value */ @@ -1304,15 +1247,12 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, 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 *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Get the link info through the VOL */ - if(H5VL_link_get(obj, loc_params, vol_plugin->cls, H5VL_LINK_GET_NAME, + if(H5VL_link_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_GET_NAME, H5AC_ind_dxpl_id, H5_REQUEST_NULL, name, size, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get link name") @@ -1347,8 +1287,7 @@ herr_t H5Literate(hid_t id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_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; H5I_type_t id_type; /* Type of ID */ herr_t ret_value; /* Return value */ @@ -1370,15 +1309,12 @@ H5Literate(hid_t id, H5_index_t idx_type, H5_iter_order_t order, loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* iterate over the links through the VOL */ - if((ret_value = H5VL_link_specific(obj, loc_params, vol_plugin->cls, H5VL_LINK_ITER, + if((ret_value = H5VL_link_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_ITER, H5AC_ind_dxpl_id, H5_REQUEST_NULL, FALSE, idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") @@ -1415,8 +1351,7 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_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; /* Return value */ @@ -1444,15 +1379,12 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, loc_params.loc_data.loc_by_name.name = group_name; loc_params.loc_data.loc_by_name.lapl_id = lapl_id; - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* iterate over the links through the VOL */ - if((ret_value = H5VL_link_specific(obj, loc_params, vol_plugin->cls, H5VL_LINK_ITER, + if((ret_value = H5VL_link_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_ITER, H5AC_ind_dxpl_id, H5_REQUEST_NULL, FALSE, idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") @@ -1494,8 +1426,7 @@ herr_t H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_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; H5I_type_t id_type; /* Type of ID */ herr_t ret_value; /* Return value */ @@ -1518,15 +1449,12 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(grp_id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(grp_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(grp_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(grp_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* iterate over the links through the VOL */ - if((ret_value = H5VL_link_specific(obj, loc_params, vol_plugin->cls, H5VL_LINK_ITER, + if((ret_value = H5VL_link_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_ITER, H5AC_ind_dxpl_id, H5_REQUEST_NULL, TRUE, idx_type, order, NULL, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link visit failed") @@ -1568,8 +1496,7 @@ herr_t H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_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; /* Return value */ @@ -1597,15 +1524,12 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, loc_params.loc_data.loc_by_name.name = group_name; loc_params.loc_data.loc_by_name.lapl_id = lapl_id; - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* visit the links through the VOL */ - if((ret_value = H5VL_link_specific(obj, loc_params, vol_plugin->cls, H5VL_LINK_ITER, + if((ret_value = H5VL_link_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_LINK_ITER, H5AC_ind_dxpl_id, H5_REQUEST_NULL, TRUE, idx_type, order, NULL, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link visit failed") diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index a78b0b0..f529e95 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -567,8 +567,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, size_t file_name_len; /* Length of file name string */ size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ - 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; H5P_genplist_t *plist; /* Property list pointer */ H5L_type_t link_type = H5L_TYPE_EXTERNAL; @@ -613,12 +612,9 @@ H5Lcreate_external(const char *file_name, const char *obj_name, loc_params.loc_data.loc_by_name.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(link_loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(link_loc_id))) + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(link_loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(link_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* Get the plist structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(lcpl_id))) @@ -633,7 +629,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value from plist") /* Create the link through the VOL */ - if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_UD, obj, loc_params, vol_plugin->cls, + if((ret_value = H5VL_link_create(H5VL_LINK_CREATE_UD, obj->vol_obj, loc_params, obj->vol_info->vol_cls, lcpl_id, lapl_id, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") diff --git a/src/H5O.c b/src/H5O.c index 00103c4..568190f 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -227,12 +227,11 @@ H5O_init_interface(void) hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5I_type_t opened_type; - void *opened_obj = NULL; + H5VL_object_t *obj = NULL; /* object token of loc_id */ + H5I_type_t opened_type; + void *opened_obj = NULL; H5VL_loc_params_t loc_params; - hid_t ret_value = FAIL; + hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, name, lapl_id); @@ -240,12 +239,9 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* get the file object */ - if(NULL == (obj = (void *)H5I_object(loc_id))) + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_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") loc_params.type = H5VL_OBJECT_BY_NAME; loc_params.loc_data.loc_by_name.name = name; @@ -253,11 +249,11 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) loc_params.obj_type = H5I_get_type(loc_id); /* Open the object through the VOL */ - if(NULL == (opened_obj = H5VL_object_open(obj, loc_params, vol_plugin->cls, &opened_type, + if(NULL == (opened_obj = H5VL_object_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, &opened_type, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") - if((ret_value = H5VL_object_register(opened_obj, opened_type, vol_plugin, TRUE)) < 0) + if((ret_value = H5VL_register_id(opened_type, opened_obj, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object handle") done: FUNC_LEAVE_API(ret_value) @@ -291,12 +287,11 @@ hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5I_type_t opened_type; - void *opened_obj = NULL; + H5VL_object_t *obj = NULL; /* object token of loc_id */ + H5I_type_t opened_type; + void *opened_obj = NULL; H5VL_loc_params_t loc_params; - hid_t ret_value = FAIL; + hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) H5TRACE6("i", "i*sIiIohi", loc_id, group_name, idx_type, order, n, lapl_id); @@ -322,19 +317,16 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_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 *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Open the object through the VOL */ - if(NULL == (opened_obj = H5VL_object_open(obj, loc_params, vol_plugin->cls, &opened_type, + if(NULL == (opened_obj = H5VL_object_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, &opened_type, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") - if((ret_value = H5VL_object_register(opened_obj, opened_type, vol_plugin, TRUE)) < 0) + if((ret_value = H5VL_register_id(opened_type, opened_obj, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object handle") done: @@ -380,12 +372,11 @@ done: hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5I_type_t opened_type; - void *opened_obj = NULL; + H5VL_object_t *obj = NULL; /* object token of loc_id */ + H5I_type_t opened_type; + void *opened_obj = NULL; H5VL_loc_params_t loc_params; - hid_t ret_value = FAIL; + hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) H5TRACE2("i", "ia", loc_id, addr); @@ -394,19 +385,16 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr) loc_params.loc_data.loc_by_addr.addr = addr; loc_params.obj_type = H5I_get_type(loc_id); - /* get the file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Open the object through the VOL */ - if(NULL == (opened_obj = H5VL_object_open(obj, loc_params, vol_plugin->cls, &opened_type, + if(NULL == (opened_obj = H5VL_object_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, &opened_type, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") - if((ret_value = H5VL_object_register(opened_obj, opened_type, vol_plugin, TRUE)) < 0) + if((ret_value = H5VL_register_id(opened_type, opened_obj, obj->vol_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object handle") done: @@ -439,10 +427,8 @@ herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id) { - void *obj1 = NULL; /* object token of loc_id */ - void *obj2 = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin1 = NULL; /* VOL plugin information */ - H5VL_t *vol_plugin2 = NULL; /* VOL plugin information */ + H5VL_object_t *obj1 = NULL; /* object token of obj_id */ + H5VL_object_t *obj2 = NULL; /* object token of new_loc_id */ H5VL_loc_params_t loc_params1; H5VL_loc_params_t loc_params2; H5P_genplist_t *plist; /* Property list pointer */ @@ -477,24 +463,18 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, loc_params2.loc_data.loc_by_name.lapl_id = lapl_id; if(H5L_SAME_LOC != obj_id) { - /* get the file object */ - if(NULL == (obj1 = (void *)H5VL_get_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin1 = (H5VL_t *)H5I_get_aux(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj1 = H5VL_get_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } if(H5L_SAME_LOC != new_loc_id) { - /* get the file object */ - if(NULL == (obj2 = (void *)H5VL_get_object(new_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin2 = (H5VL_t *)H5I_get_aux(new_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj2 = H5VL_get_object(new_loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") } /* Make sure that the VOL plugins are the same */ - if(H5L_SAME_LOC != new_loc_id && H5L_SAME_LOC != obj_id) { - if (vol_plugin1->cls != vol_plugin2->cls) + if(obj1 && obj2) { + if (obj1->vol_info->vol_cls->value != obj2->vol_info->vol_cls->value) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked") } @@ -503,14 +483,14 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* set creation properties */ - if(H5P_set(plist, H5VL_PROP_LINK_TARGET, &obj1) < 0) + if(H5P_set(plist, H5VL_PROP_LINK_TARGET, &obj1->vol_obj) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for target id") if(H5P_set(plist, H5VL_PROP_LINK_TARGET_LOC_PARAMS, &loc_params1) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for target id") /* Create the link through the VOL */ - if(H5VL_link_create(H5VL_LINK_CREATE_HARD, obj2, loc_params2, - (vol_plugin1!=NULL ? vol_plugin1->cls : vol_plugin2->cls), + if(H5VL_link_create(H5VL_LINK_CREATE_HARD, obj2->vol_obj, loc_params2, + (obj1!=NULL ? obj1->vol_info->vol_cls : obj2->vol_info->vol_cls), lcpl_id, lapl_id, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") @@ -542,8 +522,7 @@ done: herr_t H5Oincr_refcount(hid_t object_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; @@ -553,15 +532,12 @@ H5Oincr_refcount(hid_t object_id) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(object_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(object_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(object_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = H5VL_get_object(object_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* change the ref count through the VOL */ - if(H5VL_object_specific(obj, loc_params, vol_plugin->cls, H5VL_OBJECT_CHANGE_REF_COUNT, + if(H5VL_object_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_OBJECT_CHANGE_REF_COUNT, H5AC_dxpl_id, H5_REQUEST_NULL, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") @@ -593,8 +569,7 @@ done: herr_t H5Odecr_refcount(hid_t object_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; @@ -604,15 +579,12 @@ H5Odecr_refcount(hid_t object_id) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(object_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(object_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(object_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + /* get the location object */ + if(NULL == (obj = H5VL_get_object(object_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* change the ref count through the VOL */ - if(H5VL_object_specific(obj, loc_params, vol_plugin->cls, H5VL_OBJECT_CHANGE_REF_COUNT, + if(H5VL_object_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_OBJECT_CHANGE_REF_COUNT, H5AC_dxpl_id, H5_REQUEST_NULL, -1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") @@ -637,8 +609,7 @@ done: htri_t H5Oexists_by_name(hid_t loc_id, const char *name, 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; htri_t ret_value = FAIL; /* Return value */ @@ -659,15 +630,12 @@ H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) 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))) + /* 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") /* change the ref count through the VOL */ - if(H5VL_object_specific(obj, loc_params, vol_plugin->cls, H5VL_OBJECT_EXISTS, + if(H5VL_object_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_OBJECT_EXISTS, H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", name) @@ -692,8 +660,7 @@ done: herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) { - 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 */ @@ -707,15 +674,12 @@ H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) 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") /* Get the group info through the VOL using the location token */ - if(H5VL_object_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_object_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_OBJECT_GET_INFO, loc_params, oinfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") @@ -740,8 +704,7 @@ done: herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, 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 */ @@ -764,16 +727,12 @@ H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lap 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") /* Get the group info through the VOL using the location token */ - if(H5VL_object_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_object_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_OBJECT_GET_INFO, loc_params, oinfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") @@ -800,8 +759,7 @@ herr_t H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, 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 */ @@ -832,15 +790,12 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_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 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") /* Get the group info through the VOL using the location token */ - if(H5VL_object_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_object_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_OBJECT_GET_INFO, loc_params, oinfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") @@ -869,8 +824,7 @@ done: herr_t H5Oset_comment(hid_t obj_id, const char *comment) { - 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 */ @@ -880,15 +834,12 @@ H5Oset_comment(hid_t obj_id, const char *comment) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(obj_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* 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 location object */ + if(NULL == (obj = H5VL_get_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* set comment on object through the VOL */ - if(H5VL_object_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_object_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_OBJECT_SET_COMMENT, loc_params, comment) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to set comment value") @@ -918,8 +869,7 @@ herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, 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 */ @@ -940,15 +890,12 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, 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") /* set comment on object through the VOL */ - if(H5VL_object_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_object_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_OBJECT_SET_COMMENT, loc_params, comment) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to set comment value") @@ -976,8 +923,7 @@ done: ssize_t H5Oget_comment(hid_t loc_id, char *comment, size_t bufsize) { - 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; ssize_t ret_value; /* Return value */ @@ -987,14 +933,11 @@ H5Oget_comment(hid_t loc_id, char *comment, size_t bufsize) 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") - if(H5VL_object_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_object_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_OBJECT_GET_COMMENT, loc_params, comment, bufsize, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get object comment") @@ -1023,8 +966,7 @@ ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t bufsize, 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; ssize_t ret_value; /* Return value */ @@ -1045,14 +987,11 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf 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") - if(H5VL_object_optional(obj, vol_plugin->cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if(H5VL_object_optional(obj->vol_obj, obj->vol_info->vol_cls, H5AC_ind_dxpl_id, H5_REQUEST_NULL, H5VL_OBJECT_GET_COMMENT, loc_params, comment, bufsize, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get object info") @@ -1097,8 +1036,7 @@ herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_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 */ @@ -1116,16 +1054,13 @@ H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(obj_id); - /* get the file object */ - if(NULL == (obj = (void *)H5VL_get_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* 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 location object */ + if(NULL == (obj = H5VL_get_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* iterate over the objects through the VOL */ - if((ret_value = H5VL_object_specific(obj, loc_params, vol_plugin->cls, H5VL_OBJECT_VISIT, - H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if((ret_value = H5VL_object_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + H5VL_OBJECT_VISIT, H5AC_ind_dxpl_id, H5_REQUEST_NULL, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") @@ -1170,8 +1105,7 @@ herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_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; /* Return value */ @@ -1199,16 +1133,13 @@ H5Ovisit_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; 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") /* iterate over the objects through the VOL */ - if((ret_value = H5VL_object_specific(obj, loc_params, vol_plugin->cls, H5VL_OBJECT_VISIT, - H5AC_ind_dxpl_id, H5_REQUEST_NULL, + if((ret_value = H5VL_object_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + H5VL_OBJECT_VISIT, H5AC_ind_dxpl_id, H5_REQUEST_NULL, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 30ec732..d87cb5f 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -726,7 +726,7 @@ H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_t unsigned long attr_fnum; /* Attributes file serial number */ /* Get pointer to attribute */ - if(NULL == (*attr = (H5A_t *)H5I_object_verify(attr_id_list[u], H5I_ATTR))) + if(NULL == (*attr = (H5A_t *)H5VL_object_verify(attr_id_list[u], H5I_ATTR))) HGOTO_ERROR(H5E_ATTR, H5E_BADTYPE, FAIL, "not an attribute") /* Get file serial number for attribute */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 7ba1c07..6975397 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -205,11 +205,9 @@ herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) { - void *obj1 = NULL; /* object token of src_id */ - H5VL_t *vol_plugin1; /* VOL plugin information */ + H5VL_object_t *obj1 = NULL; /* object token of src_id */ H5VL_loc_params_t loc_params1; - void *obj2 = NULL; /* object token of dst_id */ - H5VL_t *vol_plugin2; /* VOL plugin information */ + H5VL_object_t *obj2 = NULL; /* object token of dst_id */ H5VL_loc_params_t loc_params2; herr_t ret_value = SUCCEED; /* Return value */ @@ -234,26 +232,20 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not object copy property list") /* get the object */ - if(NULL == (obj1 = (void *)H5I_object(src_loc_id))) + if(NULL == (obj1 = (H5VL_object_t *)H5I_object(src_loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin1 = (H5VL_t *)H5I_get_aux(src_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "src ID does not contain VOL information") loc_params1.type = H5VL_OBJECT_BY_SELF; loc_params1.obj_type = H5I_get_type(src_loc_id); /* get the object */ - if(NULL == (obj2 = (void *)H5I_object(dst_loc_id))) + if(NULL == (obj2 = (H5VL_object_t *)H5I_object(dst_loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin2 = (H5VL_t *)H5I_get_aux(dst_loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dst ID does not contain VOL information") loc_params2.type = H5VL_OBJECT_BY_SELF; loc_params2.obj_type = H5I_get_type(dst_loc_id); /* Open the object through the VOL */ - if((ret_value = H5VL_object_copy(obj1, loc_params1, vol_plugin1->cls, src_name, - obj2, loc_params2, vol_plugin2->cls, dst_name, + if((ret_value = H5VL_object_copy(obj1->vol_obj, loc_params1, obj1->vol_info->vol_cls, src_name, + obj2->vol_obj, loc_params2, obj2->vol_info->vol_cls, dst_name, ocpypl_id, lcpl_id, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to copy object") @@ -1551,7 +1543,7 @@ H5O_copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get attribute datatype") /* Check if the datatype is committed and search the skip list if so */ - if(H5T_committed(dt)) { + if(H5T_is_named(dt)) { /* Allocate key */ if(NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") @@ -1674,7 +1666,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, /* Check if the datatype is committed and search the skip list if so */ - if(H5T_committed(key->dt)) { + if(H5T_is_named(key->dt)) { /* Get datatype object fileno */ H5F_GET_FILENO(obj_oloc->file, key->fileno); diff --git a/src/H5Odtype.c b/src/H5Odtype.c index cb6bf98..d2c5efd 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -1481,7 +1481,7 @@ H5O_dtype_can_share(const void *_mesg) HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "can't tell if datatype is immutable") /* Don't share committed datatypes */ - if((tri_ret = H5T_committed(mesg)) > 0) + if((tri_ret = H5T_is_named(mesg)) > 0) HGOTO_DONE(FALSE) else if(tri_ret < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "can't tell if datatype is shared") @@ -1606,12 +1606,12 @@ H5O_dtype_shared_post_copy_upd(const H5O_loc_t UNUSED *src_oloc, FUNC_ENTER_NOAPI_NOINIT_NOERR if(dt_dst->sh_loc.type == H5O_SHARE_TYPE_COMMITTED) { - HDassert(H5T_committed(dt_dst)); + HDassert(H5T_is_named(dt_dst)); dt_dst->oloc.file = dt_dst->sh_loc.file; dt_dst->oloc.addr = dt_dst->sh_loc.u.loc.oh_addr; } /* end if */ else - HDassert(!H5T_committed(dt_dst)); + HDassert(!H5T_is_named(dt_dst)); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_dtype_shared_post_copy_upd */ diff --git a/src/H5Pint.c b/src/H5Pint.c index 53bdf3f..06ec48c 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -299,8 +299,7 @@ static const H5I_class_t H5I_GENPROPCLS_CLS[1] = {{ H5I_GENPROP_CLS, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5P_close_class,/* Callback routine for closing objects of this class */ - NULL /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5P_close_class /* Callback routine for closing objects of this class */ }}; /* Generic Property List ID class */ @@ -308,8 +307,7 @@ static const H5I_class_t H5I_GENPROPLST_CLS[1] = {{ H5I_GENPROP_LST, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5P_close, /* Callback routine for closing objects of this class */ - NULL /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5P_close /* Callback routine for closing objects of this class */ }}; diff --git a/src/H5R.c b/src/H5R.c index 4adea98..06c58ab 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -73,8 +73,7 @@ static const H5I_class_t H5I_REFERENCE_CLS[1] = {{ H5I_REFERENCE, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - NULL, /* Callback routine for closing objects of this class */ - NULL /* Callback routine for closing auxilary objects of this class */ + NULL /* Callback routine for closing objects of this class */ }}; @@ -350,8 +349,7 @@ done: herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_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; /* Return value */ @@ -374,16 +372,13 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t loc_params.obj_type = H5I_get_type(loc_id); /* get the file object */ - if(NULL == (obj = (void *)H5I_object(loc_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_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") /* create the ref through the VOL */ - if(ret_value = H5VL_object_specific(obj, loc_params, vol_plugin->cls, H5VL_REF_CREATE, - H5AC_dxpl_id, H5_REQUEST_NULL, - ref, name, ref_type, space_id) < 0) + if((ret_value = H5VL_object_specific(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_REF_CREATE, + H5AC_dxpl_id, H5_REQUEST_NULL, + ref, name, ref_type, space_id)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: @@ -578,12 +573,11 @@ done: hid_t H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_ref) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5I_type_t opened_type; - void *opened_obj = NULL; + H5VL_object_t *obj = NULL; /* object token of loc_id */ + H5I_type_t opened_type; + void *opened_obj = NULL; H5VL_loc_params_t loc_params; - hid_t ret_value; + hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) H5TRACE4("i", "iiRt*x", obj_id, oapl_id, ref_type, _ref); @@ -597,11 +591,8 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") /* get the vol 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 file identifier") - /* 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") loc_params.type = H5VL_OBJECT_BY_REF; loc_params.loc_data.loc_by_ref.ref_type = ref_type; @@ -610,13 +601,12 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r loc_params.obj_type = H5I_get_type(obj_id); /* Open the object through the VOL */ - if(NULL == (opened_obj = H5VL_object_open(obj, loc_params, vol_plugin->cls, &opened_type, + if(NULL == (opened_obj = H5VL_object_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, &opened_type, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to dereference object") - /* Get an atom for the object */ - if ((ret_value = H5VL_object_register(opened_obj, opened_type, vol_plugin, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") + if((ret_value = H5VL_register_id(opened_type, opened_obj, obj->vol_info, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object handle") done: FUNC_LEAVE_API(ret_value) @@ -718,8 +708,7 @@ done: hid_t H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) { - 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; hid_t ret_value; @@ -736,14 +725,11 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) loc_params.obj_type = H5I_get_type(id); /* get the file object */ - if(NULL == (obj = (void *)H5I_object(id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* Get the space id through the VOL */ - if(H5VL_object_get(obj, loc_params, vol_plugin->cls, H5VL_REF_GET_REGION, + if(H5VL_object_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_REF_GET_REGION, H5AC_ind_dxpl_id, H5_REQUEST_NULL, &ret_value, ref_type, ref) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") @@ -865,8 +851,7 @@ herr_t H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type) { - 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 */ @@ -883,15 +868,13 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, loc_params.obj_type = H5I_get_type(id); /* get the file object */ - if(NULL == (obj = (void *)H5I_object(id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object type through the VOL */ - if((ret_value = H5VL_object_get(obj, loc_params, vol_plugin->cls, H5VL_REF_GET_TYPE, - H5AC_ind_dxpl_id, H5_REQUEST_NULL, obj_type, ref_type, ref)) < 0) + if((ret_value = H5VL_object_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + H5VL_REF_GET_TYPE, H5AC_ind_dxpl_id, + H5_REQUEST_NULL, obj_type, ref_type, ref)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: @@ -1040,8 +1023,7 @@ ssize_t H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, size_t size) { - 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; ssize_t ret_value; /* Return value */ @@ -1058,14 +1040,12 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, loc_params.obj_type = H5I_get_type(id); /* get the file object */ - if(NULL == (obj = (void *)H5I_object(id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object type through the VOL */ - if(H5VL_object_get(obj, loc_params, vol_plugin->cls, H5VL_REF_GET_NAME, H5AC_dxpl_id, H5_REQUEST_NULL, + if(H5VL_object_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_REF_GET_NAME, + H5AC_dxpl_id, H5_REQUEST_NULL, &ret_value, name, size, ref_type, _ref) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 1f95827..1a01e07 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -159,8 +159,7 @@ H5R__term_deprec_interface(void) H5G_obj_t H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) { - 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; H5O_type_t obj_type; /* Object type */ H5G_obj_t ret_value; /* Return value */ @@ -178,14 +177,11 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) loc_params.obj_type = H5I_get_type(id); /* get the vol object */ - if(NULL == (obj = (void *)H5VL_get_object(id))) + if(NULL == (obj = H5VL_get_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* get the object type through the VOL */ - if((ret_value = H5VL_object_get(obj, loc_params, vol_plugin->cls, H5VL_REF_GET_TYPE, + if((ret_value = H5VL_object_get(obj->vol_obj, loc_params, obj->vol_info->vol_cls, H5VL_REF_GET_TYPE, H5AC_ind_dxpl_id, H5_REQUEST_NULL, &obj_type, ref_type, ref)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") @@ -222,12 +218,11 @@ done: hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) { - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ - H5I_type_t opened_type; - void *opened_obj = NULL; + H5VL_object_t *obj = NULL; /* object token of loc_id */ + H5I_type_t opened_type; + void *opened_obj = NULL; H5VL_loc_params_t loc_params; - hid_t ret_value; + hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) H5TRACE3("i", "iRt*x", obj_id, ref_type, _ref); @@ -239,11 +234,8 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") /* get the vol 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 file identifier") - /* 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") loc_params.type = H5VL_OBJECT_BY_REF; loc_params.loc_data.loc_by_ref.ref_type = ref_type; @@ -252,13 +244,13 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) loc_params.obj_type = H5I_get_type(obj_id); /* Open the object through the VOL */ - if(NULL == (opened_obj = H5VL_object_open(obj, loc_params, vol_plugin->cls, &opened_type, + if(NULL == (opened_obj = H5VL_object_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, &opened_type, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open object") /* Get an atom for the object */ - if ((ret_value = H5VL_object_register(opened_obj, opened_type, vol_plugin, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") + if((ret_value = H5VL_register_id(opened_type, opened_obj, obj->vol_info, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object handle") done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5S.c b/src/H5S.c index 01bcbc4..eb5430e 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -87,8 +87,7 @@ static const H5I_class_t H5I_DATASPACE_CLS[1] = {{ H5I_DATASPACE, /* ID class value */ 0, /* Class flags */ 2, /* # of reserved IDs for class */ - (H5I_free_t)H5S_close, /* Callback routine for closing objects of this class */ - NULL /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5S_close /* Callback routine for closing objects of this class */ }}; diff --git a/src/H5T.c b/src/H5T.c index e185bc7..24dfd8d 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -530,8 +530,7 @@ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{ H5I_DATATYPE, /* ID class value */ 0, /* Class flags */ 8, /* # of reserved IDs for class */ - (H5I_free_t)H5T_close, /* Callback routine for closing objects of this class */ - (H5I_free2_t)H5T_close_datatype /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5T_close_datatype /* Callback routine for closing objects of this class */ }}; @@ -1693,7 +1692,7 @@ H5Tcopy(hid_t type_id) H5D_t *dset; /* Dataset for datatype */ /* The argument is a dataset handle */ - if(NULL == (dset = (H5D_t *)H5I_object(type_id))) + if(NULL == (dset = (H5D_t *)H5VL_object(type_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(NULL == (dt = H5D_typeof(dset))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get the dataset datatype") @@ -4969,8 +4968,10 @@ H5T_is_named(const H5T_t *dt) HDassert(dt); - if(dt->shared->state == H5T_STATE_OPEN || dt->shared->state == H5T_STATE_NAMED) + if(dt->vol_obj) ret_value = TRUE; + else + ret_value = (H5T_STATE_OPEN == dt->shared->state || H5T_STATE_NAMED == dt->shared->state); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index ed4d37b..315920e 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -82,6 +82,10 @@ static H5T_t *H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id); /* Local Variables */ /*******************/ +/* Declare a free list to manage the H5VL_t struct */ +H5FL_EXTERN(H5VL_t); +/* Declare a free list to manage the H5VL_object_t struct */ +H5FL_EXTERN(H5VL_object_t); /*-------------------------------------------------------------------------- @@ -123,12 +127,12 @@ herr_t H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id) { - void *dt = NULL; - H5T_t *type = NULL; - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *dt = NULL; /* datatype object created by VOL plugin */ + H5VL_object_t *new_obj = NULL; /* VOL object that holds the datatype object and the VOL info */ + H5T_t *type = NULL; /* high level datatype object that wraps the VOL object */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*siiii", loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id); @@ -138,7 +142,7 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - if(H5T_committed(type)) + if(H5T_is_named(type)) HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed") /* Get correct property list */ @@ -166,29 +170,24 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, loc_params.obj_type = H5I_get_type(loc_id); /* get the object from the loc_id */ - if(NULL == (obj = (void *)H5I_object(loc_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object 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") /* commit the datatype through the VOL */ - if (NULL == (dt = H5VL_datatype_commit(obj, loc_params, vol_plugin->cls, name, type_id, lcpl_id, - tcpl_id, tapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) + if (NULL == (dt = H5VL_datatype_commit(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + name, type_id, lcpl_id, tcpl_id, tapl_id, + H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to commit datatype") - /* attach the vol object created using the commit call to the - library datatype structure */ - /* set the committed type object to the VOL pluging pointer in the H5T_t struct */ - type->vol_obj = dt; - - /* attach VOL information to the ID */ - if (H5I_register_aux(type_id, vol_plugin) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") + /* setup VOL object */ + if(NULL == (new_obj = H5FL_CALLOC(H5VL_object_t))) + HGOTO_ERROR(H5E_VOL, H5E_NOSPACE, FAIL, "can't allocate top object structure") + new_obj->vol_info = obj->vol_info; + new_obj->vol_info->nrefs ++; + new_obj->vol_obj = dt; - vol_plugin->nrefs ++; - if(H5I_inc_ref(vol_plugin->id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin") + /* set the committed type object to the VOL pluging pointer in the H5T_t struct */ + type->vol_obj = new_obj; done: FUNC_LEAVE_API(ret_value) @@ -299,12 +298,12 @@ done: herr_t H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) { - void *dt = NULL; - H5T_t *type = NULL; - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *dt = NULL; /* datatype object created by VOL plugin */ + H5VL_object_t *new_obj = NULL; /* VOL object that holds the datatype object and the VOL info */ + H5T_t *type = NULL; /* high level datatype object that wraps the VOL object */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "iiii", loc_id, type_id, tcpl_id, tapl_id); @@ -312,7 +311,7 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) /* check args */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - if(H5T_committed(type)) + if(H5T_is_named(type)) HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed") /* Get correct property list */ @@ -333,27 +332,24 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) loc_params.obj_type = H5I_get_type(loc_id); /* get the file object */ - if(NULL == (obj = (void *)H5I_object(loc_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_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") /* commite the datatype through the VOL */ - if (NULL == (dt = H5VL_datatype_commit(obj, loc_params, vol_plugin->cls, NULL, type_id, H5P_DEFAULT, - tcpl_id, tapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) + if (NULL == (dt = H5VL_datatype_commit(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + NULL, type_id, H5P_DEFAULT, tcpl_id, tapl_id, + H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to commit datatype") - /* set the committed type object to the VOL pluging pointer in the H5T_t struct */ - type->vol_obj = dt; + /* setup VOL object */ + if(NULL == (new_obj = H5FL_CALLOC(H5VL_object_t))) + HGOTO_ERROR(H5E_VOL, H5E_NOSPACE, FAIL, "can't allocate top object structure") + new_obj->vol_info = obj->vol_info; + new_obj->vol_info->nrefs ++; + new_obj->vol_obj = dt; - /* attach VOL information to the ID */ - if (H5I_register_aux(type_id, vol_plugin) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") - - vol_plugin->nrefs ++; - if(H5I_inc_ref(vol_plugin->id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin") + /* set the committed type object to the VOL pluging pointer in the H5T_t struct */ + type->vol_obj = new_obj; done: FUNC_LEAVE_API(ret_value) @@ -510,7 +506,7 @@ H5Tcommitted(hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Set return value */ - ret_value = H5T_committed(type); + ret_value = H5T_is_named(type); done: FUNC_LEAVE_API(ret_value) @@ -518,36 +514,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_committed - * - * Purpose: Determines if a datatype is committed or not. - * - * Return: Success: TRUE if committed, FALSE otherwise. - * - * Programmer: Quincey Koziol - * Wednesday, September 24, 2003 - * - *------------------------------------------------------------------------- - */ -htri_t -H5T_committed(const H5T_t *type) -{ - htri_t ret_value; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(type); - - if(type->vol_obj) - ret_value = TRUE; - else - ret_value = (H5T_STATE_OPEN == type->shared->state || H5T_STATE_NAMED == type->shared->state); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_committed() */ - - -/*------------------------------------------------------------------------- * Function: H5T_link * * Purpose: Adjust the link count for an object header by adding @@ -597,11 +563,10 @@ done: hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id) { - void *dt = NULL; /* datatype token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *vol_dt = NULL; /* datatype token created by VOL plugin */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - hid_t ret_value = FAIL; /* Return value */ + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, name, tapl_id); @@ -620,26 +585,23 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_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 *)H5I_object(loc_id))) + /* get the location object */ + if(NULL == (obj = (H5VL_object_t *)H5I_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") /* Create the datatype through the VOL */ - if(NULL == (dt = H5VL_datatype_open(obj, loc_params, vol_plugin->cls, name, tapl_id, - H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (vol_dt = H5VL_datatype_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + name, tapl_id, H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open datatype") /* Get an atom for the datatype */ - if ((ret_value = H5VL_create_datatype(dt, vol_plugin, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize datatype handle") + if((ret_value = H5VL_register_id(H5I_DATATYPE, vol_dt, obj->vol_info, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize datatype handle") done: - if (ret_value < 0 && dt) - if(H5VL_datatype_close (dt, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release dataset") + if (ret_value < 0 && vol_dt) + if(H5VL_datatype_close (vol_dt, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release datatype") FUNC_LEAVE_API(ret_value) } /* end H5Topen2() */ @@ -676,7 +638,7 @@ H5Tget_create_plist(hid_t dtype_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Check if the datatype is committed */ - if((status = H5T_committed(type)) < 0) + if((status = H5T_is_named(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't check whether datatype is committed") /* If the datatype is not committed, just copy the default @@ -691,18 +653,10 @@ H5Tget_create_plist(hid_t dtype_id) /* If the datatype is committed, let the VOL create the creation property list ID. */ else if(TRUE == status) { - H5VL_t *vol_plugin; /* VOL plugin information */ - - /* get the plugin pointer */ - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(dtype_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") - - /* get the named datatype object */ - if(NULL == (type = (H5T_t *)H5VL_get_object(dtype_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + H5VL_object_t *vol_dt = type->vol_obj; /* get the rest of the plist through the VOL */ - if(H5VL_datatype_get(type, vol_plugin->cls, H5VL_DATATYPE_GET_TCPL, + if(H5VL_datatype_get(vol_dt->vol_obj, vol_dt->vol_info->vol_cls, H5VL_DATATYPE_GET_TCPL, H5AC_ind_dxpl_id, H5_REQUEST_NULL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get datatype") } /* end if */ @@ -916,8 +870,7 @@ H5T_update_shared(H5T_t *dt) /*------------------------------------------------------------------------- * Function: H5T_get_named_type * - * Purpose: returns the VOL object or the named datatype structure - * if it exists + * Purpose: returns the VOL object for the named datatype if it exists * * Return: Success: Pointer to the VOL Datatype object * @@ -928,10 +881,10 @@ H5T_update_shared(H5T_t *dt) * *------------------------------------------------------------------------- */ -void * +H5VL_object_t * H5T_get_named_type(const H5T_t *dt) { - void *ret_value = NULL; /* Return value */ + H5VL_object_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -943,7 +896,40 @@ H5T_get_named_type(const H5T_t *dt) /*------------------------------------------------------------------------- - * Function: H5VL_create_datatype + * Function: H5T_get_actual_type + * + * Purpose: returns underlying native datatype created by native plugin + * if datatype is committed, otherwise return the datatype + * object associate with the ID. + * + * Return: Success: Pointer to the VOL Datatype object + * + * Failure: NULL + * + * Programmer: Mohamad Chaarawi + * September 2014 + * + *------------------------------------------------------------------------- + */ +H5T_t * +H5T_get_actual_type(const H5T_t *dt) +{ + H5T_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check if the datatype is committed */ + if(NULL == dt->vol_obj) + ret_value = dt; + else + ret_value = (H5T_t *)dt->vol_obj->vol_obj; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_get_actual_type() */ + + +/*------------------------------------------------------------------------- + * Function: H5T_construct_datatype * * Purpose: Create a Library datatype with a plugin specific datatype object * @@ -956,43 +942,42 @@ H5T_get_named_type(const H5T_t *dt) * *------------------------------------------------------------------------- */ -hid_t -H5VL_create_datatype(void *dt_obj, H5VL_t *vol_plugin, hbool_t app_ref) +H5T_t * +H5T_construct_datatype(H5VL_object_t *dt_obj) { ssize_t nalloc; void *buf = NULL; H5T_t *dt = NULL; /* datatype token from VOL plugin */ - hid_t ret_value = FAIL; + H5T_t *ret_value = NULL; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(NULL) /* get required buf size for encoding the datatype */ - if(H5VL_datatype_get(dt_obj, vol_plugin->cls, H5VL_DATATYPE_GET_BINARY, + if(H5VL_datatype_get(dt_obj->vol_obj, dt_obj->vol_info->vol_cls, H5VL_DATATYPE_GET_BINARY, H5AC_dxpl_id, H5_REQUEST_NULL, &nalloc, NULL, 0) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to get datatype serialized size") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to get datatype serialized size") /* allocate buffer to store binary description of the datatype */ if (NULL == (buf = (void *) H5MM_malloc ((size_t)nalloc))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate space for datatype") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for datatype") /* get binary description of the datatype */ - if(H5VL_datatype_get(dt_obj, vol_plugin->cls, H5VL_DATATYPE_GET_BINARY, + if(H5VL_datatype_get(dt_obj->vol_obj, dt_obj->vol_info->vol_cls, H5VL_DATATYPE_GET_BINARY, H5AC_dxpl_id, H5_REQUEST_NULL, &nalloc, buf, (size_t)nalloc) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to get serialized datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to get serialized datatype") + + if(NULL == (dt = H5T_decode((const unsigned char *)buf))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "can't decode datatype") - if(NULL == (dt = H5T_decode((const unsigned char *)buf))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't decode datatype") dt->vol_obj = dt_obj; H5MM_free(buf); - /* Get an atom for the datatype with the VOL information as the auxilary struct*/ - if((ret_value = H5VL_register_id(H5I_DATATYPE, dt, vol_plugin, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize datatype handle") + ret_value = dt; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_create_datatype() */ +} /* end H5T_construct_datatype() */ /*------------------------------------------------------------------------- @@ -1010,47 +995,29 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_close_datatype(void *type, H5VL_t *vol_plugin) +H5T_close_datatype(void *type) { H5T_t *dt = (H5T_t *)type; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - /* Close the datatype through the VOL*/ if (NULL != dt->vol_obj) { - if((ret_value = H5VL_datatype_close(dt->vol_obj, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) + H5VL_object_t *vol_dt = dt->vol_obj; + + /* Close the datatype through the VOL*/ + if((ret_value = H5VL_datatype_close(vol_dt->vol_obj, vol_dt->vol_info->vol_cls, + H5AC_dxpl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to close datatype") - /* decrement ref count on VOL ID */ - if(H5VL_free_id(vol_plugin) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin") + /* free attribute */ + if(H5VL_free_object(vol_dt) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to free VOL object") } + if((ret_value = H5T_close(dt)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to close datatype") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_close_datatype() */ - - -/*------------------------------------------------------------------------- - * Function: H5T_set_vol_object - * - * Purpose: Set the vol_object in the H5T_t struct. - * Called from outside the H5T package - * - * Return: Succeed - * - * Programmer: Mohamad Chaarawi - * June 2012 - * - *------------------------------------------------------------------------- - */ -herr_t -H5T_set_vol_object(H5T_t *type, void *vol_obj) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - type->vol_obj = vol_obj; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5T_set_vol_object() */ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 51c55f4..1691917 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -83,6 +83,10 @@ /* Local Variables */ /*******************/ +/* Declare a free list to manage the H5VL_t struct */ +H5FL_EXTERN(H5VL_t); +/* Declare a free list to manage the H5VL_object_t struct */ +H5FL_EXTERN(H5VL_object_t); /*-------------------------------------------------------------------------- @@ -149,12 +153,12 @@ H5T__term_deprec_interface(void) herr_t H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) { - void *dt = NULL; - H5T_t *type = NULL; - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *dt = NULL; /* datatype object created by VOL plugin */ + H5VL_object_t *new_obj = NULL; /* VOL object that holds the datatype object and the VOL info */ + H5T_t *type = NULL; /* high level datatype object that wraps the VOL object */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*si", loc_id, name, type_id); @@ -171,30 +175,25 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) loc_params.obj_type = H5I_get_type(loc_id); /* get the object from the loc_id */ - if(NULL == (obj = (void *)H5I_object(loc_id))) + if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object 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") /* commit the datatype through the VOL */ - if (NULL == (dt = H5VL_datatype_commit(obj, loc_params, vol_plugin->cls, name, type_id, - H5P_LINK_CREATE_DEFAULT, H5P_DATATYPE_CREATE_DEFAULT, - H5P_DATATYPE_ACCESS_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL))) + if (NULL == (dt = H5VL_datatype_commit(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + name, type_id, H5P_LINK_CREATE_DEFAULT, + H5P_DATATYPE_CREATE_DEFAULT, H5P_DATATYPE_ACCESS_DEFAULT, + H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to commit datatype") - /* attach the vol object created using the commit call to the - library datatype structure */ - /* set the committed type object to the VOL pluging pointer in the H5T_t struct */ - type->vol_obj = dt; - - /* attach VOL information to the ID */ - if (H5I_register_aux(type_id, vol_plugin) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") + /* setup VOL object */ + if(NULL == (new_obj = H5FL_CALLOC(H5VL_object_t))) + HGOTO_ERROR(H5E_VOL, H5E_NOSPACE, FAIL, "can't allocate top object structure") + new_obj->vol_info = obj->vol_info; + new_obj->vol_info->nrefs ++; + new_obj->vol_obj = dt; - vol_plugin->nrefs ++; - if(H5I_inc_ref(vol_plugin->id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin") + /* set the committed type object to the VOL pluging pointer in the H5T_t struct */ + type->vol_obj = new_obj; done: FUNC_LEAVE_API(ret_value) @@ -220,11 +219,11 @@ done: hid_t H5Topen1(hid_t loc_id, const char *name) { - void *dt = NULL; /* datatype token from VOL plugin */ - void *obj = NULL; /* object token of loc_id */ - H5VL_t *vol_plugin; /* VOL plugin information */ + void *vol_dt = NULL; /* datatype token created by VOL plugin */ + H5T_t *dt = NULL; /* upper level H5T_t for datatype */ + H5VL_object_t *obj = NULL; /* object token of loc_id */ H5VL_loc_params_t loc_params; - hid_t ret_value = FAIL; /* Return value */ + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); @@ -236,26 +235,25 @@ H5Topen1(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 file object */ - if(NULL == (obj = (void *)H5I_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_object_t *)H5I_object(loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") /* Create the datatype through the VOL */ - if(NULL == (dt = H5VL_datatype_open(obj, loc_params, vol_plugin->cls, name, - H5P_DATATYPE_ACCESS_DEFAULT, H5AC_dxpl_id, H5_REQUEST_NULL))) + if(NULL == (vol_dt = H5VL_datatype_open(obj->vol_obj, loc_params, obj->vol_info->vol_cls, + name, H5P_DATATYPE_ACCESS_DEFAULT, + H5AC_dxpl_id, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open datatype") /* Get an atom for the datatype */ - if ((ret_value = H5VL_create_datatype(dt, vol_plugin, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize datatype handle") + if((ret_value = H5VL_register_id(H5I_DATATYPE, vol_dt, obj->vol_info, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize datatype handle") done: if (ret_value < 0 && dt) - if(H5VL_datatype_close (dt, vol_plugin->cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) + if(H5VL_datatype_close (vol_dt, obj->vol_info->vol_cls, H5AC_dxpl_id, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release dataset") + FUNC_LEAVE_API(ret_value) } /* end H5Topen1() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Toh.c b/src/H5Toh.c index 2c6dacf..096e655 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -224,9 +224,8 @@ H5O_dtype_get_oloc(hid_t obj_id) /* Get the datatype */ if(NULL == (dt = (H5T_t *)H5I_object(obj_id))) HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID") - - if(NULL == (type = (H5T_t *)H5T_get_named_type(dt))) - type = dt; + /* If this is a named datatype, get the plugin pointer to the datatype */ + type = (const H5T_t *)H5T_get_actual_type(dt); /* Get the datatype's object header location */ if(NULL == (ret_value = H5T_oloc(type))) diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index adc70a6..11e3de1 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -393,7 +393,7 @@ struct H5T_t { H5T_shared_t *shared; /* all other information */ H5O_loc_t oloc; /* Object location, if the type is a named type */ H5G_name_t path; /* group hier. path if the type is a named type */ - void *vol_obj; + H5VL_object_t *vol_obj; }; /* The master list of soft conversion functions */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 3722af8..21179d1 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -30,6 +30,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Gprivate.h" /* Groups */ #include "H5Rprivate.h" /* References */ +#include "H5VLprivate.h" /* VOL */ /* Macro for size of temporary buffers to contain a single element */ #define H5T_ELEM_BUF_SIZE 256 @@ -140,15 +141,15 @@ H5_DLL uint32_t H5T_hash(H5F_t * file, const H5T_t *dt); H5_DLL herr_t H5T_set_latest_version(H5T_t *dt); H5_DLL herr_t H5T_patch_file(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt); -H5_DLL void * H5T_get_named_type(const H5T_t *dt); -H5_DLL herr_t H5T_set_vol_object(H5T_t *type, void *vol_obj); +H5_DLL H5T_t *H5T_construct_datatype(H5VL_object_t *dt_obj); +H5_DLL H5VL_object_t *H5T_get_named_type(const H5T_t *dt); +H5_DLL H5T_t *H5T_get_actual_type(const H5T_t *dt); /* Reference specific functions */ H5_DLL H5R_type_t H5T_get_ref_type(const H5T_t *dt); /* Operations on named datatypes */ H5_DLL H5T_t *H5T_open(const H5G_loc_t *loc, hid_t dxpl_id); -H5_DLL htri_t H5T_committed(const H5T_t *type); H5_DLL int H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id); H5_DLL herr_t H5T_update_shared(H5T_t *type); diff --git a/src/H5VL.c b/src/H5VL.c index aa0775a..65a8a8f 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -61,8 +61,7 @@ static const H5I_class_t H5I_VOL_CLS[1] = {{ H5I_VOL, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5VL_free_cls, /* Callback routine for closing objects of this class */ - NULL, /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5VL_free_cls /* Callback routine for closing objects of this class */ }}; @@ -544,8 +543,6 @@ done: hid_t H5VLobject_register(void *obj, H5I_type_t obj_type, hid_t plugin_id) { - H5VL_t *vol_plugin; /* VOL plugin information */ - H5VL_class_t *vol_cls = NULL; hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -553,16 +550,8 @@ H5VLobject_register(void *obj, H5I_type_t obj_type, hid_t plugin_id) if(NULL == obj) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object to register") - if(NULL == (vol_cls = (H5VL_class_t *)H5I_object_verify(plugin_id, H5I_VOL))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL plugin ID") - /* Build the vol plugin struct */ - if(NULL == (vol_plugin = (H5VL_t *)H5MM_calloc(sizeof(H5VL_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - vol_plugin->cls = vol_cls; - vol_plugin->id = plugin_id; - - if ((ret_value = H5VL_object_register(obj, obj_type, vol_plugin, TRUE)) < 0) + if ((ret_value = H5VL_object_register(obj, obj_type, plugin_id, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") done: @@ -587,7 +576,6 @@ done: herr_t H5VLget_object(hid_t obj_id, void **obj) { - H5VL_t *vol_plugin; hid_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -597,13 +585,6 @@ H5VLget_object(hid_t obj_id, void **obj) if(!obj) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid object pointer") - /* 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") - - if(NATIVE == vol_plugin->cls->value) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot call public function on library type") - if(NULL == (*obj = H5VL_get_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain a valid object") diff --git a/src/H5VLint.c b/src/H5VLint.c index ecb95f4..142c762 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -48,6 +48,45 @@ #include "H5VLpkg.h" /* VOL package header */ #include "H5VLprivate.h" /* VOL */ +/****************/ +/* Local Macros */ +/****************/ + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Declare a free list to manage the H5VL_t struct */ +H5FL_DEFINE(H5VL_t); + +/* Declare a free list to manage the H5VL_object_t struct */ +H5FL_DEFINE(H5VL_object_t); + /*-------------------------------------------------------------------------- NAME @@ -117,23 +156,23 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_register() */ - /*------------------------------------------------------------------------- - * Function: H5VL_register_id + * Function: H5VL_register_id * - * Purpose: Wrapper to register an object ID with a VOL aux struct - * and increment ref count on VOL plugin ID + * Purpose: Wrapper to register an object ID with a VOL aux struct + * and increment ref count on VOL plugin ID * - * Return: Success: Positive Identifier - * Failure: A negative value. + * Return: Success:Positive Identifier + * Failure: A negative value. * - * Programmer: Mohamad Chaarawi - * August, 2014 + * Programmer: Mohamad Chaarawi + * August, 2014 *------------------------------------------------------------------------- */ hid_t -H5VL_register_id(H5I_type_t type, const void *object, H5VL_t *vol_plugin, hbool_t app_ref) +H5VL_register_id(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t app_ref) { + H5VL_object_t *new_obj = NULL; hid_t ret_value = FAIL; FUNC_ENTER_NOAPI(FAIL) @@ -142,46 +181,62 @@ H5VL_register_id(H5I_type_t type, const void *object, H5VL_t *vol_plugin, hbool_ HDassert(object); HDassert(vol_plugin); - if((ret_value = H5I_register2(type, object, vol_plugin, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize handle") - + /* setup VOL object */ + if(NULL == (new_obj = H5FL_CALLOC(H5VL_object_t))) + HGOTO_ERROR(H5E_VOL, H5E_NOSPACE, FAIL, "can't allocate top object structure") + new_obj->vol_info = vol_plugin; vol_plugin->nrefs ++; - if(H5I_inc_ref(vol_plugin->id, FALSE) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin") + new_obj->vol_obj = object; + + if(H5I_DATATYPE == type) { + H5T_t *dt = NULL; + + if(NULL == (dt = H5T_construct_datatype(new_obj))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't construct datatype object"); + + if((ret_value = H5I_register(type, dt, app_ref)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize handle") + } + else { + if((ret_value = H5I_register(type, new_obj, app_ref)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize handle") + } done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_register_id() */ - /*------------------------------------------------------------------------- - * Function: H5VL_free_id + * Function: H5VL_free_id * - * Purpose: Wrapper to register an object ID with a VOL aux struct + * Purpose: Wrapper to register an object ID with a VOL aux struct * and increment ref count on VOL plugin ID * - * Return: Success: Positive Identifier - * Failure: A negative value. + * Return: Success:Positive Identifier + * Failure: A negative value. * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * August, 2014 *------------------------------------------------------------------------- */ -hid_t -H5VL_free_id(H5VL_t *vol_plugin) +herr_t +H5VL_free_object(H5VL_object_t *obj) { herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(SUCCEED) /* Check arguments */ - HDassert(vol_plugin); + HDassert(obj); - vol_plugin->nrefs --; - if(H5I_dec_ref(vol_plugin->id) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin") - if (0 == vol_plugin->nrefs) - vol_plugin = (H5VL_t *)H5MM_xfree(vol_plugin); + obj->vol_info->nrefs --; + if (0 == obj->vol_info->nrefs) { + if(H5I_dec_ref(obj->vol_info->vol_id) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin") + obj->vol_info = H5FL_FREE(H5VL_t, obj->vol_info); + } + + obj = H5FL_FREE(H5VL_object_t, obj); done: FUNC_LEAVE_NOAPI(ret_value) @@ -341,19 +396,22 @@ done: ssize_t H5VL_get_plugin_name(hid_t id, char *name/*out*/, size_t size) { - H5VL_t *vol_plugin; /* VOL structure attached to id */ + H5VL_object_t *obj = NULL; + const H5VL_class_t *vol_cls = NULL; size_t len; ssize_t ret_value; FUNC_ENTER_NOAPI(FAIL) - if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux (id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Object/File does not contain VOL information") + /* get the object pointer */ + if(NULL == (obj = H5VL_get_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - len = HDstrlen(vol_plugin->cls->name); + vol_cls = obj->vol_info->vol_cls; + len = HDstrlen(vol_cls->name); if(name) { - HDstrncpy(name, vol_plugin->cls->name, MIN(len + 1,size)); + HDstrncpy(name, vol_cls->name, MIN(len + 1,size)); if(len >= size) name[size-1]='\0'; } /* end if */ @@ -381,39 +439,130 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL_object_register(void *obj, H5I_type_t obj_type, H5VL_t *vol_plugin, hbool_t app_ref) +H5VL_object_register(void *obj, H5I_type_t obj_type, hid_t plugin_id, hbool_t app_ref) { + H5VL_class_t *vol_cls = NULL; + H5VL_t *vol_info = NULL; /* VOL info struct */ hid_t ret_value = FAIL; FUNC_ENTER_NOAPI(FAIL) - /* Get an atom for the object and attach VOL information and free function to the ID */ - switch(obj_type) { - case H5I_FILE: - if((ret_value = H5VL_register_id(obj_type, obj, vol_plugin, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") - break; + if(NULL == (vol_cls = (H5VL_class_t *)H5I_object_verify(plugin_id, H5I_VOL))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL plugin ID") - case H5I_ATTR: - if((ret_value = H5VL_register_id(obj_type, obj, vol_plugin, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") - break; + /* setup VOL info struct */ + if(NULL == (vol_info = H5FL_CALLOC(H5VL_t))) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate VL info struct") + vol_info->vol_cls = vol_cls; + vol_info->vol_id = plugin_id; + if(H5I_inc_ref(vol_info->vol_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin") - case H5I_GROUP: - if((ret_value = H5VL_register_id(obj_type, obj, vol_plugin, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize group handle") - break; + /* Get an atom for the object */ + if((ret_value = H5VL_register_id(obj_type, obj, vol_info, app_ref)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object handle") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_object_register() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_get_object + * + * Purpose: utility function to return the object pointer associated with + * an hid_t. This routine is the same as H5I_object for all types + * except for named datatypes, where the vol_obj is returned that + * is attached to the H5T_t struct. + * + * Return: Success: object pointer + * Failure: NULL + * + * Programmer: Mohamad Chaarawi + * June, 2012 + * + *------------------------------------------------------------------------- + */ +H5VL_object_t * +H5VL_get_object(hid_t id) +{ + void *obj = NULL; + H5I_type_t obj_type = H5I_get_type(id); + H5VL_object_t *ret_value = NULL; + + FUNC_ENTER_NOAPI(NULL) + if(H5I_FILE == obj_type || H5I_GROUP == obj_type || H5I_ATTR == obj_type || + H5I_DATASET == obj_type || H5I_DATATYPE == obj_type) { + /* get the object */ + if(NULL == (obj = H5I_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") + + /* if this is a datatype, get the VOL object attached to the H5T_t struct */ + if (H5I_DATATYPE == obj_type) { + if (NULL == (obj = H5T_get_named_type((H5T_t *)obj))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a named datatype") + } + } + else + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier type to function") + + + ret_value = (H5VL_object_t *)obj; +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_get_object() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_object + * + * Purpose: utility function to return the VOL object pointer associated with + * an hid_t. + * + * Return: Success: object pointer + * Failure: NULL + * + * Programmer: Mohamad Chaarawi + * September, 2014 + * + *------------------------------------------------------------------------- + */ +void * +H5VL_object(hid_t id) +{ + H5VL_object_t *obj = NULL; + void *ret_value = NULL; + + FUNC_ENTER_NOAPI(NULL) + + /* Get the symbol table entry */ + switch(H5I_get_type(id)) { + case H5I_GROUP: case H5I_DATASET: - if((ret_value = H5VL_register_id(obj_type, obj, vol_plugin, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") - break; + case H5I_FILE: + case H5I_ATTR: + /* get the object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") - case H5I_DATATYPE: - if ((ret_value = H5VL_create_datatype(obj, vol_plugin, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize datatype handle") + ret_value = obj->vol_obj; break; + case H5I_DATATYPE: + { + H5T_t *dt; + + /* get the object */ + if(NULL == (dt = (H5T_t *)H5I_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") + + /* Get the actual datatype object that should be the vol_obj */ + if(NULL == (obj = H5T_get_named_type(dt))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a named datatype") + ret_value = obj->vol_obj; + break; + } case H5I_UNINIT: case H5I_BADID: case H5I_DATASPACE: @@ -427,49 +576,88 @@ H5VL_object_register(void *obj, H5I_type_t obj_type, H5VL_t *vol_plugin, hbool_t case H5I_ERROR_STACK: case H5I_NTYPES: default: - HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "invalid object type") - } /* end switch */ - + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unknown data object type") + } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_object_register() */ +} /* end H5VL_object() */ /*------------------------------------------------------------------------- - * Function: H5VL_get_object + * Function: H5VL_object_verify * - * Purpose: utility function to return the object pointer associated with - * an hid_t. This routine is the same as H5I_object for all types - * except for named datatypes, where the vol_obj is returned that - * is attached to the H5T_t struct. + * Purpose: utility function to return the VOL object pointer associated with + * an hid_t. * * Return: Success: object pointer * Failure: NULL * * Programmer: Mohamad Chaarawi - * June, 2012 + * September, 2014 * *------------------------------------------------------------------------- */ void * -H5VL_get_object(hid_t id) +H5VL_object_verify(hid_t id, H5I_type_t obj_type) { + H5VL_object_t *obj = NULL; void *ret_value = NULL; FUNC_ENTER_NOAPI(NULL) - /* get the object */ - if(NULL == (ret_value = (void *)H5I_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") + /* Get the symbol table entry */ + switch(obj_type) { + case H5I_GROUP: + case H5I_DATASET: + case H5I_FILE: + case H5I_ATTR: + /* get the object */ + if(NULL == (obj = (H5VL_object_t *)H5I_object_verify(id, obj_type))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") + + ret_value = obj->vol_obj; + break; + case H5I_DATATYPE: + { + H5T_t *dt; - /* if this is a datatype, get the VOL object attached to the H5T_t struct */ - if (H5I_DATATYPE == H5I_get_type(id)) { - if (NULL == (ret_value = H5T_get_named_type((H5T_t *)ret_value))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a named datatype") + /* get the object */ + if(NULL == (dt = (H5T_t *)H5I_object_verify(id, obj_type))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") + + /* Get the actual datatype object that should be the vol_obj */ + if(NULL == (obj = H5T_get_named_type(dt))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a named datatype") + + ret_value = obj->vol_obj; + break; + } + case H5I_UNINIT: + case H5I_BADID: + case H5I_DATASPACE: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_VOL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: + default: + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unknown data object type") } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_get_object() */ +} /* end H5VL_object_verify() */ + +void * +H5VL_plugin_object(H5VL_object_t *obj) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + FUNC_LEAVE_NOAPI(obj->vol_obj) +} /* end H5VL_plugin_object() */ /*------------------------------------------------------------------------- @@ -1952,9 +2140,9 @@ H5VL_object_copy(void *src_obj, H5VL_loc_params_t loc_params1, const H5VL_class_ FUNC_ENTER_NOAPI(FAIL) - /* check if both objects are associated with the same VOL plugin */ - if(vol_cls1->value != vol_cls2->value) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be copied") + /* Make sure that the VOL plugins are the same */ + if (vol_cls1->value != vol_cls2->value) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked") if(NULL == vol_cls1->object_cls.copy) HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `object copy' method") diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 7277a92..18bd09e 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -354,37 +354,47 @@ done: hid_t H5VL_native_register(H5I_type_t type, void *obj, hbool_t app_ref) { - H5VL_t *vol_plugin; /* VOL plugin information */ hid_t ret_value = FAIL; FUNC_ENTER_NOAPI_NOINIT HDassert(obj); - /* Build the vol plugin struct */ - if(NULL == (vol_plugin = (H5VL_t *)H5MM_calloc(sizeof(H5VL_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - vol_plugin->cls = &H5VL_native_g; - vol_plugin->id = H5VL_NATIVE_g; + /* make sure this is from the internal Native plugin not from the API */ + if(type == H5I_DATATYPE) { + HDassert(((H5T_t *)obj)->vol_obj == NULL); + } /* Get an atom for the object */ - if(type == H5I_DATATYPE && ((H5T_t *)obj)->vol_obj == NULL) { - if ((ret_value = H5VL_object_register(obj, type, vol_plugin, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object handle") - } + if ((ret_value = H5VL_object_register(obj, type, H5VL_NATIVE_g, app_ref)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize object handle") + +#if 0 else { - if((ret_value = H5VL_register_id(type, obj, vol_plugin, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register object") + H5VL_t *vol_info = NULL; /* VOL info struct */ + H5VL_object_t *new_obj = NULL; + + /* setup VOL object */ + if(NULL == (new_obj = H5FL_CALLOC(H5VL_object_t))) + HGOTO_ERROR(H5E_VOL, H5E_NOSPACE, NULL, "can't allocate top object structure") + new_obj->vol_obj = obj; + + /* setup VOL info struct */ + if(NULL == (vol_info = H5FL_CALLOC(H5VL_t))) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate VL info struct") + vol_info->vol_cls = &H5VL_native_g; + vol_info->nrefs = 1; + vol_info->vol_id = H5VL_NATIVE_g; + if(H5I_inc_ref(vol_info->id, FALSE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, NULL, "unable to increment ref count on VOL plugin") + new_obj->vol_info = vol_info; + + if((ret_value = H5I_register(obj_type, new_obj, app_ref)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register object ID") } +#endif done: - if(ret_value < 0) { - if(vol_plugin) { - if(vol_plugin->id && H5I_dec_ref(vol_plugin->id) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "can't decrement reference count for plugin") - H5MM_xfree(vol_plugin); - } - } FUNC_LEAVE_NOAPI(ret_value) } /* H5VL_native_register */ @@ -404,18 +414,18 @@ done: herr_t H5VL_native_unregister(hid_t obj_id) { - H5VL_t *vol_plugin; /* VOL plugin information */ + H5VL_object_t *obj = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT /* 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") + if (NULL == (obj = (H5VL_object_t *)H5VL_get_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid ID") - /* decrement ref count on VOL ID */ - if(H5VL_free_id(vol_plugin) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin") + /* free object */ + if(H5VL_free_object(obj) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object") done: FUNC_LEAVE_NOAPI(ret_value) @@ -498,11 +508,10 @@ H5VL_native_attr_create(void *obj, H5VL_loc_params_t loc_params, const char *att if(0 == (H5F_INTENT(loc.oloc->file) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_ARGS, H5E_WRITEERROR, NULL, "no write intent on file") - if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a type") - /* Get the actual datatype object if this is a named datatype */ - if(NULL == (type = (H5T_t *)H5T_get_named_type(dt))) - type = dt; + if(NULL == (dt = (H5T_t *)H5I_object(type_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype") + /* If this is a named datatype, get the plugin pointer to the datatype */ + type = (H5T_t *)H5T_get_actual_type(dt); if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data space") diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h index 1234eb9..92e90d7 100644 --- a/src/H5VLprivate.h +++ b/src/H5VLprivate.h @@ -33,16 +33,21 @@ #define H5_REQUEST_NULL NULL #define H5_EVENT_STACK_NULL ((hid_t)-1) -/* - * The main datatype for each plugin. - */ +/* Internal struct to track VOL information with objects */ typedef struct H5VL_t { - const H5VL_class_t *cls; /* constant class info */ - unsigned long feature_flags; /* VOL Driver feature Flags */ + const H5VL_class_t *vol_cls; /* constant plugin class info */ int nrefs; /* number of references by objects using this struct */ - hid_t id; /* identifier for the VOL class */ + hid_t vol_id; /* identifier for the VOL class */ } H5VL_t; +/* The internal vol object structure returned to the API */ +typedef struct H5VL_object_t { + void *vol_obj; /* pointer to object created by plugin */ + H5VL_t *vol_info; /* pointer to VOL info struct */ +} H5VL_object_t; + + + /*****************************/ /* Library Private Variables */ /*****************************/ @@ -57,13 +62,15 @@ struct H5F_t; H5_DLL herr_t H5VL_init(void); H5_DLL int H5VL_term_interface(void); +H5_DLL hid_t H5VL_register_id(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t app_ref); +H5_DLL herr_t H5VL_free_object(H5VL_object_t *obj); H5_DLL hid_t H5VL_register(const void *cls, size_t size, hbool_t app_ref); -H5_DLL hid_t H5VL_object_register(void *obj, H5I_type_t obj_type, H5VL_t *vol_plugin, hbool_t app_ref); -H5_DLL hid_t H5VL_create_datatype(void *dt_obj, H5VL_t *vol_plugin, hbool_t app_ref); -H5_DLL hid_t H5VL_register_id(H5I_type_t type, const void *object, H5VL_t *vol_plugin, hbool_t app_ref); -H5_DLL hid_t H5VL_free_id(H5VL_t *vol_plugin); +H5_DLL hid_t H5VL_object_register(void *obj, H5I_type_t obj_type, hid_t plugin_id, hbool_t app_ref); H5_DLL ssize_t H5VL_get_plugin_name(hid_t id, char *name/*out*/, size_t size); -H5_DLL void *H5VL_get_object(hid_t id); +H5_DLL H5VL_object_t *H5VL_get_object(hid_t id); +H5_DLL void *H5VL_object(hid_t id); +H5_DLL void *H5VL_object_verify(hid_t id, H5I_type_t obj_type); +H5_DLL void *H5VL_plugin_object(H5VL_object_t *obj); H5_DLL void *H5VL_attr_create(void *obj, H5VL_loc_params_t loc_params, const H5VL_class_t *vol_cls, const char *attr_name, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req); H5_DLL void *H5VL_attr_open(void *obj, H5VL_loc_params_t loc_params, const H5VL_class_t *vol_cls, const char *name, hid_t aapl_id, hid_t dxpl_id, void **req); @@ -131,11 +138,11 @@ H5_DLL herr_t H5VL_fapl_open(struct H5P_genplist_t *plist, hid_t vol_id, const v H5_DLL herr_t H5VL_fapl_copy(hid_t vol_id, const void *vol_info, void **copied_info); H5_DLL herr_t H5VL_fapl_close(hid_t vol_id, void *vol_info); -H5_DLL herr_t H5F_close_file(void *file, H5VL_t *vol_plugin); -H5_DLL herr_t H5A_close_attr(void *attr, H5VL_t *vol_plugin); -H5_DLL herr_t H5D_close_dataset(void *dset, H5VL_t *vol_plugin); -H5_DLL herr_t H5G_close_group(void *grp, H5VL_t *vol_plugin); -H5_DLL herr_t H5T_close_datatype(void *dt, H5VL_t *vol_plugin); +H5_DLL herr_t H5F_close_file(void *file); +H5_DLL herr_t H5A_close_attr(void *attr); +H5_DLL herr_t H5D_close_dataset(void *dset); +H5_DLL herr_t H5G_close_group(void *grp); +H5_DLL herr_t H5T_close_datatype(void *dt); H5_DLL hid_t H5VL_native_register(H5I_type_t type, void *obj, hbool_t app_ref); H5_DLL herr_t H5VL_native_unregister(hid_t obj_id); diff --git a/test/accum.c b/test/accum.c index a924517..b76f92f 100644 --- a/test/accum.c +++ b/test/accum.c @@ -93,7 +93,7 @@ main(void) if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get H5F_t * to internal file structure */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR /* We'll be writing lots of garbage data, so extend the file a ways. 10MB should do. */ diff --git a/test/btree2.c b/test/btree2.c index d8abc84..7c5f54a 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -104,7 +104,7 @@ create_file(hid_t *file, H5F_t **f, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2806,7 +2806,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2845,7 +2845,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6375,7 +6375,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6531,7 +6531,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6627,7 +6627,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6716,7 +6716,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6802,7 +6802,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7153,7 +7153,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7198,7 +7198,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7256,7 +7256,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7314,7 +7314,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ diff --git a/test/cache_api.c b/test/cache_api.c index b1ccef1..34a3cbc 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -234,7 +234,7 @@ check_fapl_mdc_api_calls(void) /* get a pointer to the files internal data structure */ if ( pass ) { - file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); + file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE); if ( file_ptr == NULL ) { @@ -383,7 +383,7 @@ check_fapl_mdc_api_calls(void) /* get a pointer to the files internal data structure */ if ( pass ) { - file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); + file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE); if ( file_ptr == NULL ) { diff --git a/test/cache_common.c b/test/cache_common.c index 7b26714..90c640b 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -2555,7 +2555,7 @@ setup_cache(size_t max_cache_size, } else { - file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE); + file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE); if ( file_ptr == NULL ) { @@ -2757,7 +2757,7 @@ takedown_cache(H5F_t * file_ptr, if ( H5F_addr_defined(saved_actual_base_addr) ) { if ( NULL == file_ptr ) { - file_ptr = (H5F_t *)H5I_object_verify(saved_fid, H5I_FILE); + file_ptr = (H5F_t *)H5VL_object_verify(saved_fid, H5I_FILE); HDassert ( file_ptr ); } @@ -5125,7 +5125,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, /* get a pointer to the files internal data structure */ if ( pass ) { - file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); + file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE); if ( file_ptr == NULL ) { @@ -5263,7 +5263,7 @@ check_and_validate_cache_size(hid_t file_id, /* get a pointer to the files internal data structure */ if ( pass ) { - file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); + file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE); if ( file_ptr == NULL ) { @@ -5446,7 +5446,7 @@ validate_mdc_config(hid_t file_id, /* get a pointer to the files internal data structure */ if ( pass ) { - file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); + file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE); if ( file_ptr == NULL ) { diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 30ca1de..bd34c70 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -237,7 +237,7 @@ static int print_index(hid_t fid) { H5C_cache_entry_t *next_entry_ptr = NULL; /* entry pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR; cache_ptr = f->shared->cache; /* Initial (debugging) loop */ @@ -294,7 +294,7 @@ static int verify_no_unknown_tags(hid_t fid) H5C_cache_entry_t *next_entry_ptr = NULL; /* entry pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR; cache_ptr = f->shared->cache; for (i = 0; i < H5C__HASH_TABLE_LEN; i++) { @@ -346,7 +346,7 @@ static int mark_all_entries_investigated(hid_t fid) H5C_cache_entry_t *next_entry_ptr = NULL; /* entry pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR; cache_ptr = f->shared->cache; for (i = 0; i < H5C__HASH_TABLE_LEN; i++) { @@ -403,7 +403,7 @@ static int verify_tag(hid_t fid, int id, haddr_t tag) H5C_cache_entry_t *next_entry_ptr = NULL; /* entry pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR; cache_ptr = f->shared->cache; for (i = 0; i < H5C__HASH_TABLE_LEN; i++) { @@ -448,7 +448,7 @@ static int evict_entries(hid_t fid) H5F_t * f = NULL; /* File Pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR; /* Mark all entries investigated */ mark_all_entries_investigated(fid); @@ -493,7 +493,7 @@ static int get_new_object_header_tag(hid_t fid, haddr_t *tag) int found = FALSE; /* If entry is found */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR; cache_ptr = f->shared->cache; for (i = 0; i < H5C__HASH_TABLE_LEN; i++) { @@ -3845,7 +3845,7 @@ check_invalid_tag_application(void) if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; /* Get internal file pointer*/ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR; /* Create dxpl */ if ( (dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; diff --git a/test/earray.c b/test/earray.c index 2d0a399..4831f5f 100644 --- a/test/earray.c +++ b/test/earray.c @@ -319,7 +319,7 @@ create_file(hid_t fapl, hid_t *file, H5F_t **f) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -451,7 +451,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -1156,7 +1156,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f2 = (H5F_t *)H5I_object(file2))) + if(NULL == (f2 = (H5F_t *)H5VL_object(file2))) FAIL_STACK_ERROR /* Open the extensible array through the second file handle */ diff --git a/test/farray.c b/test/farray.c index 7a79aaa..160aa8c 100644 --- a/test/farray.c +++ b/test/farray.c @@ -155,7 +155,7 @@ create_file(hid_t fapl, hid_t *file, H5F_t **f) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -291,7 +291,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -675,7 +675,7 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f2 = (H5F_t *)H5I_object(file2))) + if(NULL == (f2 = (H5F_t *)H5VL_object(file2))) FAIL_STACK_ERROR /* Open the fixed array through the second file handle */ diff --git a/test/fheap.c b/test/fheap.c index 96b0673..32c8f05 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -597,7 +597,7 @@ reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -648,7 +648,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, /* Check for deleting the entire heap */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -690,7 +690,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -1860,7 +1860,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -1977,7 +1977,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2020,7 +2020,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2126,7 +2126,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tp FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2178,7 +2178,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tp FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f2 = (H5F_t *)H5I_object(file2))) + if(NULL == (f2 = (H5F_t *)H5VL_object(file2))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2296,7 +2296,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *t FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2369,7 +2369,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *t FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2455,7 +2455,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2798,7 +2798,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2841,7 +2841,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2921,7 +2921,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2975,7 +2975,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3064,7 +3064,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file1))) + if(NULL == (f = (H5F_t *)H5VL_object(file1))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3108,7 +3108,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object (file1) */ - if(NULL == (f = (H5F_t *)H5I_object(file1))) + if(NULL == (f = (H5F_t *)H5VL_object(file1))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3130,7 +3130,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam) /* Get a pointer to the internal file object (file2) */ - if(NULL == (f = (H5F_t *)H5I_object(file2))) + if(NULL == (f = (H5F_t *)H5VL_object(file2))) FAIL_STACK_ERROR /* Reopen the heap */ @@ -3203,7 +3203,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3313,7 +3313,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3414,7 +3414,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3511,7 +3511,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3610,7 +3610,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3716,7 +3716,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3823,7 +3823,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3934,7 +3934,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4030,7 +4030,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4133,7 +4133,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4234,7 +4234,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4345,7 +4345,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4442,7 +4442,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4538,7 +4538,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4640,7 +4640,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4750,7 +4750,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4853,7 +4853,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4964,7 +4964,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5072,7 +5072,7 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Create absolute heap */ @@ -5170,7 +5170,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5279,7 +5279,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5382,7 +5382,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5492,7 +5492,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5603,7 +5603,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5710,7 +5710,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5818,7 +5818,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5933,7 +5933,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6053,7 +6053,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6165,7 +6165,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6280,7 +6280,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6414,7 +6414,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6567,7 +6567,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6608,7 +6608,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6731,7 +6731,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6772,7 +6772,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6924,7 +6924,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6965,7 +6965,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7093,7 +7093,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7134,7 +7134,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7337,7 +7337,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7378,7 +7378,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7636,7 +7636,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -13839,7 +13839,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15019,7 +15019,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15205,7 +15205,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15269,7 +15269,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15305,7 +15305,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15342,7 +15342,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15378,7 +15378,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -16019,7 +16019,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -16086,7 +16086,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -16251,7 +16251,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -16281,7 +16281,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ diff --git a/test/freespace.c b/test/freespace.c index 9ab0d75..456cc48 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -480,7 +480,7 @@ test_fs_create(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* initialize creation parameters for free-space manager */ @@ -619,7 +619,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -680,7 +680,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -750,7 +750,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ @@ -819,7 +819,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ @@ -940,7 +940,7 @@ test_fs_sect_find(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1324,7 +1324,7 @@ test_fs_sect_merge(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1451,7 +1451,7 @@ test_fs_sect_merge(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1553,7 +1553,7 @@ test_fs_sect_merge(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1788,7 +1788,7 @@ test_fs_sect_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1887,7 +1887,7 @@ test_fs_sect_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1987,7 +1987,7 @@ test_fs_sect_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -2124,7 +2124,7 @@ test_fs_sect_change_class(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -2230,7 +2230,7 @@ test_fs_sect_change_class(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -2412,7 +2412,7 @@ test_fs_sect_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* @@ -2763,7 +2763,7 @@ test_fs_sect_iterate(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); diff --git a/test/gheap.c b/test/gheap.c index f30935a..d1323c3 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -92,7 +92,7 @@ test_1 (hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5VL_object(file))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -187,7 +187,7 @@ test_2 (hid_t fapl) h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5VL_object(file))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -274,7 +274,7 @@ test_3 (hid_t fapl) h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5VL_object(file))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -353,7 +353,7 @@ test_4 (hid_t fapl) h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5VL_object(file))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -440,7 +440,7 @@ test_ooo_indices(hid_t fapl) h5_fixname(FILENAME[4], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5VL_object(file))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -481,7 +481,7 @@ test_ooo_indices(hid_t fapl) if (H5Fclose(file)<0) goto error; if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5VL_object(file))) { H5_FAILED(); puts(" Unable to open file"); goto error; diff --git a/test/lheap.c b/test/lheap.c index 51ae25b..10f5ca3 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -79,7 +79,7 @@ main(void) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5VL_object(file))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -127,7 +127,7 @@ main(void) TESTING("local heap read"); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5VL_object(file))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; diff --git a/test/mf.c b/test/mf.c index 93667de..0c45c35 100644 --- a/test/mf.c +++ b/test/mf.c @@ -228,7 +228,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -270,7 +270,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30); @@ -371,7 +371,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -403,7 +403,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -448,7 +448,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -497,7 +497,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -540,7 +540,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -650,7 +650,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -681,7 +681,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* should succeed */ @@ -728,7 +728,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -847,7 +847,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Retrieve the file's maxaddr */ @@ -901,7 +901,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 1/3 of the file as temporary address space */ @@ -1008,7 +1008,7 @@ test_mf_fs_start(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up free-space manager */ @@ -1126,7 +1126,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1213,7 +1213,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1298,7 +1298,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1484,7 +1484,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1602,7 +1602,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1715,7 +1715,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1828,7 +1828,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -2020,7 +2020,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -2090,7 +2090,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -2219,7 +2219,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2255,7 +2255,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Free the two blocks */ @@ -2350,7 +2350,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -2396,7 +2396,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50+TEST_BLOCK_SIZE2058); @@ -2504,7 +2504,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2665,7 +2665,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2811,7 +2811,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2943,7 +2943,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -3108,7 +3108,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ @@ -3269,7 +3269,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ @@ -3360,7 +3360,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ @@ -3430,7 +3430,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -3562,7 +3562,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ @@ -3609,7 +3609,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ @@ -3668,7 +3668,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ @@ -3815,7 +3815,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -3897,7 +3897,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* allocate a block of 50 from meta_aggr */ @@ -3919,7 +3919,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* shrink the block */ @@ -3952,7 +3952,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* allocate a block of 50 */ @@ -3974,7 +3974,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* try to extend the block */ @@ -4078,7 +4078,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -4148,7 +4148,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -4238,7 +4238,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -4463,7 +4463,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -4721,7 +4721,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -5063,7 +5063,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -5362,7 +5362,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* get alignment setting */ @@ -5575,7 +5575,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* get alignment setting */ @@ -5841,7 +5841,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* get alignment setting */ @@ -6018,7 +6018,7 @@ test_mf_fs_persist(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 6 blocks */ @@ -6052,7 +6052,7 @@ test_mf_fs_persist(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that H5FD_MEM_SUPER free-space manager is there */ @@ -6094,7 +6094,7 @@ test_mf_fs_persist(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that H5FD_MEM_SUPER free-space manager is there */ @@ -6144,7 +6144,7 @@ test_mf_fs_gone(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 4 blocks */ @@ -6178,7 +6178,7 @@ test_mf_fs_gone(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is not there */ @@ -6197,7 +6197,7 @@ test_mf_fs_gone(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that H5FD_MEM_SUPER free-space manager is there */ @@ -6231,7 +6231,7 @@ test_mf_fs_gone(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is not there */ @@ -6279,7 +6279,7 @@ test_mf_fs_split(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_SUPER */ @@ -6324,7 +6324,7 @@ test_mf_fs_split(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is there */ @@ -6408,7 +6408,7 @@ test_mf_fs_split(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the free-space manager for H5FD_MEM_DRAW is not there */ @@ -6452,7 +6452,7 @@ test_mf_fs_split(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is there */ @@ -6514,7 +6514,7 @@ test_mf_fs_multi(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_SUPER */ @@ -6559,7 +6559,7 @@ test_mf_fs_multi(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is there */ @@ -6641,7 +6641,7 @@ test_mf_fs_multi(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the free-space manager for H5FD_MEM_SUPER is there */ @@ -6707,7 +6707,7 @@ test_mf_fs_multi(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* If H5FD_MEM_SUPER is there, should not find block #1 & #3 */ @@ -6972,7 +6972,7 @@ test_filespace_strategy_threshold(hid_t fapl_new) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 6 blocks */ @@ -7016,7 +7016,7 @@ test_filespace_strategy_threshold(hid_t fapl_new) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR switch(fs_type) { @@ -7124,7 +7124,7 @@ test_filespace_gone(hid_t fapl_new) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 6 blocks */ @@ -7192,7 +7192,7 @@ test_filespace_gone(hid_t fapl_new) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* free-space manager should be empty */ @@ -7391,7 +7391,7 @@ test_dichotomy(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate the first block of type H5FD_MEM_SUPER */ diff --git a/test/ohdr.c b/test/ohdr.c index 502a8b1..0e29e71 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -73,7 +73,7 @@ test_cont(char *filename, hid_t fapl) /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR if (H5AC_ignore_tags(f) < 0) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); @@ -200,7 +200,7 @@ test_ohdr_cache(char *filename, hid_t fapl) FAIL_STACK_ERROR if(H5Pclose(my_fapl) < 0) FAIL_STACK_ERROR - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR if(H5AC_ignore_tags(f) < 0) FAIL_STACK_ERROR @@ -348,7 +348,7 @@ main(void) /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR if (H5AC_ignore_tags(f) < 0) { H5_FAILED(); @@ -449,7 +449,7 @@ main(void) FAIL_STACK_ERROR if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR if (H5AC_ignore_tags(f) < 0) FAIL_STACK_ERROR diff --git a/test/testfiles/err_compat_1 b/test/testfiles/err_compat_1 index d4ba66b..cea08f7 100644 --- a/test/testfiles/err_compat_1 +++ b/test/testfiles/err_compat_1 @@ -12,7 +12,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): minor: Bad value HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dcreate2(): not a location ID + #000: (file name) line (number) in H5Dcreate2(): invalid location identifier major: Invalid arguments to routine minor: Inappropriate type @@ -31,7 +31,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Invalid arguments to routine minor: Inappropriate type HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dcreate2(): not a location ID + #000: (file name) line (number) in H5Dcreate2(): invalid location identifier major: Invalid arguments to routine minor: Inappropriate type diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 7ce148a..c56abe9 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -3921,7 +3921,7 @@ setup_cache_for_test(hid_t * fid_ptr, world_mpi_rank, fcn_name); } } else { - file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE); + file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE); } if ( file_ptr == NULL ) { diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 617e614..5967954 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -256,7 +256,7 @@ main(int argc, char *argv[]) HDfprintf(stderr, "cannot open file\n"); HDexit(1); } /* end if */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) { + if(NULL == (f = (H5F_t *)H5VL_object(fid))) { HDfprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); } /* end if */ -- cgit v0.12