Switch driver | plugin => connector.

This commit is contained in:
Quincey Koziol 2018-11-04 01:27:23 -05:00
parent deb75622ca
commit 1daa7b830a
33 changed files with 1232 additions and 1230 deletions

View File

@ -40,12 +40,12 @@ static herr_t H5VL_log_group_close(void *grp, hid_t dxpl_id, void **req);
static void *H5VL_log_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *opened_type, hid_t dxpl_id, void **req);
static herr_t H5VL_log_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
hid_t native_plugin_id = -1;
hid_t native_connector_id = -1;
static const H5VL_class_t H5VL_log_g = {
0, /* VOL class struct version */
LOG, /* ID of plugin */
"log", /* Name of plugin */
LOG, /* ID of connector */
"log", /* Name of connector */
0, /* capability flags */
H5VL_log_init, /* initialize */
H5VL_log_term, /* terminate */
@ -137,7 +137,7 @@ visit_cb(hid_t oid, const char *name, const H5O_info_t *oinfo, void *udata)
char n[25];
if(H5Iget_type(oid) == H5I_GROUP) {
len = H5VLget_plugin_name(oid, n, 50);
len = H5VLget_connector_name(oid, n, 50);
printf("Visiting GROUP VOL name = %s %zd\n", n, len);
}
if(H5Iget_type(oid) == H5I_DATASET)
@ -175,42 +175,42 @@ main(int argc, char **argv)
under_fapl = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_native(under_fapl);
assert(H5VLis_plugin_registered("native") == 1);
assert(H5VLis_connector_registered("native") == 1);
vol_id = H5VLregister_plugin(&H5VL_log_g, H5P_DEFAULT);
vol_id = H5VLregister_connector(&H5VL_log_g, H5P_DEFAULT);
assert(vol_id > 0);
assert(H5VLis_plugin_registered("log") == 1);
assert(H5VLis_connector_registered("log") == 1);
vol_id2 = H5VLget_plugin_id("log");
vol_id2 = H5VLget_connector_id("log");
H5VLclose(vol_id2);
native_plugin_id = H5VLget_plugin_id("native");
assert(native_plugin_id > 0);
native_connector_id = H5VLget_connector_id("native");
assert(native_connector_id > 0);
acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
H5Pset_vol(acc_tpl, vol_id, &under_fapl);
file_id = H5Fcreate(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
len = H5VLget_plugin_name(file_id, name, 25);
len = H5VLget_connector_name(file_id, name, 25);
printf("FILE VOL name = %s %zd\n", name, len);
group_id = H5Gcreate2(file_id, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
len = H5VLget_plugin_name(group_id, name, 50);
len = H5VLget_connector_name(group_id, name, 50);
printf("GROUP VOL name = %s %zd\n", name, len);
int_id = H5Tcopy(H5T_NATIVE_INT);
H5Tcommit2(file_id, "int", int_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
len = H5VLget_plugin_name(int_id, name, 50);
len = H5VLget_connector_name(int_id, name, 50);
printf("DT COMMIT name = %s %zd\n", name, len);
H5Tclose(int_id);
int_id = H5Topen2(file_id, "int", H5P_DEFAULT);
len = H5VLget_plugin_name(int_id, name, 50);
len = H5VLget_connector_name(int_id, name, 50);
printf("DT OPEN name = %s %zd\n", name, len);
H5Tclose(int_id);
int_id = H5Oopen(file_id,"int",H5P_DEFAULT);
len = H5VLget_plugin_name(int_id, name, 50);
len = H5VLget_connector_name(int_id, name, 50);
printf("DT OOPEN name = %s %zd\n", name, len);
len = H5Fget_name(file_id, name, 50);
@ -228,7 +228,7 @@ main(int argc, char **argv)
datasetId = H5Dcreate2(file_id,fullpath,H5T_NATIVE_INT,dataspaceId,H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
H5Sclose(dataspaceId);
len = H5VLget_plugin_name(datasetId, name, 50);
len = H5VLget_connector_name(datasetId, name, 50);
printf("DSET name = %s %zd\n", name, len);
H5Dwrite(datasetId, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
@ -244,9 +244,9 @@ main(int argc, char **argv)
H5Pclose(acc_tpl);
H5Pclose(under_fapl);
H5VLclose(native_plugin_id);
H5VLunregister_plugin(vol_id);
assert(H5VLis_plugin_registered("log") == 0);
H5VLclose(native_connector_id);
H5VLunregister_connector(vol_id);
assert(H5VLis_connector_registered("log") == 0);
return EXIT_SUCCESS;
}
@ -300,7 +300,7 @@ H5VL_log_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, void **re
{
H5VL_log_t *f = (H5VL_log_t *)file;
H5VLfile_get(f->under_object, native_plugin_id, get_type, dxpl_id, req, arguments);
H5VLfile_get(f->under_object, native_connector_id, get_type, dxpl_id, req, arguments);
printf("------- LOG H5Fget %d\n", get_type);
return 1;
@ -311,7 +311,7 @@ H5VL_log_file_close(void *file, hid_t dxpl_id, void **req)
{
H5VL_log_t *f = (H5VL_log_t *)file;
H5VLfile_close(f->under_object, native_plugin_id, dxpl_id, req);
H5VLfile_close(f->under_object, native_connector_id, dxpl_id, req);
free(f);
printf("------- LOG H5Fclose\n");
@ -327,7 +327,7 @@ H5VL_log_group_create(void *obj, H5VL_loc_params_t loc_params, const char *name,
group = (H5VL_log_t *)calloc(1, sizeof(H5VL_log_t));
group->under_object = H5VLgroup_create(o->under_object, loc_params, native_plugin_id, name, gcpl_id, gapl_id, dxpl_id, req);
group->under_object = H5VLgroup_create(o->under_object, loc_params, native_connector_id, name, gcpl_id, gapl_id, dxpl_id, req);
printf("------- LOG H5Gcreate\n");
return (void *)group;
@ -338,7 +338,7 @@ H5VL_log_group_close(void *grp, hid_t dxpl_id, void **req)
{
H5VL_log_t *g = (H5VL_log_t *)grp;
H5VLgroup_close(g->under_object, native_plugin_id, dxpl_id, req);
H5VLgroup_close(g->under_object, native_connector_id, dxpl_id, req);
free(g);
printf("------- LOG H5Gclose\n");
@ -354,7 +354,7 @@ H5VL_log_datatype_commit(void *obj, H5VL_loc_params_t loc_params, const char *na
dt = (H5VL_log_t *)calloc(1, sizeof(H5VL_log_t));
dt->under_object = H5VLdatatype_commit(o->under_object, loc_params, native_plugin_id, name,
dt->under_object = H5VLdatatype_commit(o->under_object, loc_params, native_connector_id, name,
type_id, lcpl_id, tcpl_id, tapl_id, dxpl_id, req);
printf("------- LOG H5Tcommit\n");
@ -369,7 +369,7 @@ H5VL_log_datatype_open(void *obj, H5VL_loc_params_t loc_params, const char *name
dt = (H5VL_log_t *)calloc(1, sizeof(H5VL_log_t));
dt->under_object = H5VLdatatype_open(o->under_object, loc_params, native_plugin_id, name, tapl_id, dxpl_id, req);
dt->under_object = H5VLdatatype_open(o->under_object, loc_params, native_connector_id, name, tapl_id, dxpl_id, req);
printf("------- LOG H5Topen\n");
return (void *)dt;
@ -381,7 +381,7 @@ H5VL_log_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxpl_id, voi
H5VL_log_t *o = (H5VL_log_t *)dt;
herr_t ret_value;
ret_value = H5VLdatatype_get(o->under_object, native_plugin_id, get_type, dxpl_id, req, arguments);
ret_value = H5VLdatatype_get(o->under_object, native_connector_id, get_type, dxpl_id, req, arguments);
printf("------- LOG datatype get\n");
return ret_value;
@ -394,7 +394,7 @@ H5VL_log_datatype_close(void *dt, hid_t dxpl_id, void **req)
assert(type->under_object);
H5VLdatatype_close(type->under_object, native_plugin_id, dxpl_id, req);
H5VLdatatype_close(type->under_object, native_connector_id, dxpl_id, req);
free(type);
printf("------- LOG H5Tclose\n");
@ -409,7 +409,7 @@ H5VL_log_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *opened
new_obj = (H5VL_log_t *)calloc(1, sizeof(H5VL_log_t));
new_obj->under_object = H5VLobject_open(o->under_object, loc_params, native_plugin_id, opened_type, dxpl_id, req);
new_obj->under_object = H5VLobject_open(o->under_object, loc_params, native_connector_id, opened_type, dxpl_id, req);
printf("------- LOG H5Oopen\n");
return (void *)new_obj;
@ -421,7 +421,7 @@ H5VL_log_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object_sp
{
H5VL_log_t *o = (H5VL_log_t *)obj;
H5VLobject_specific(o->under_object, loc_params, native_plugin_id, specific_type, dxpl_id, req, arguments);
H5VLobject_specific(o->under_object, loc_params, native_connector_id, specific_type, dxpl_id, req, arguments);
printf("------- LOG Object specific\n");
return 1;
@ -435,7 +435,7 @@ H5VL_log_dataset_create(void *obj, H5VL_loc_params_t loc_params, const char *nam
dset = (H5VL_log_t *)calloc(1, sizeof(H5VL_log_t));
dset->under_object = H5VLdataset_create(o->under_object, loc_params, native_plugin_id, name, dcpl_id, dapl_id, dxpl_id, req);
dset->under_object = H5VLdataset_create(o->under_object, loc_params, native_connector_id, name, dcpl_id, dapl_id, dxpl_id, req);
printf("------- LOG H5Dcreate\n");
return (void *)dset;
@ -449,7 +449,7 @@ H5VL_log_dataset_open(void *obj, H5VL_loc_params_t loc_params, const char *name,
dset = (H5VL_log_t *)calloc(1, sizeof(H5VL_log_t));
dset->under_object = H5VLdataset_open(o->under_object, loc_params, native_plugin_id, name, dapl_id, dxpl_id, req);
dset->under_object = H5VLdataset_open(o->under_object, loc_params, native_connector_id, name, dapl_id, dxpl_id, req);
printf("------- LOG H5Dopen\n");
return (void *)dset;
@ -461,7 +461,7 @@ H5VL_log_dataset_read(void *dset, hid_t mem_type_id, hid_t mem_space_id,
{
H5VL_log_t *d = (H5VL_log_t *)dset;
H5VLdataset_read(d->under_object, native_plugin_id, mem_type_id, mem_space_id, file_space_id,
H5VLdataset_read(d->under_object, native_connector_id, mem_type_id, mem_space_id, file_space_id,
plist_id, buf, req);
printf("------- LOG H5Dread\n");
@ -474,7 +474,7 @@ H5VL_log_dataset_write(void *dset, hid_t mem_type_id, hid_t mem_space_id,
{
H5VL_log_t *d = (H5VL_log_t *)dset;
H5VLdataset_write(d->under_object, native_plugin_id, mem_type_id, mem_space_id, file_space_id,
H5VLdataset_write(d->under_object, native_connector_id, mem_type_id, mem_space_id, file_space_id,
plist_id, buf, req);
printf("------- LOG H5Dwrite\n");
@ -486,7 +486,7 @@ H5VL_log_dataset_close(void *dset, hid_t dxpl_id, void **req)
{
H5VL_log_t *d = (H5VL_log_t *)dset;
H5VLdataset_close(d->under_object, native_plugin_id, dxpl_id, req);
H5VLdataset_close(d->under_object, native_connector_id, dxpl_id, req);
free(d);
printf("------- LOG H5Dclose\n");

View File

@ -300,7 +300,7 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id,
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to create attribute")
/* Register the new attribute and get an ID for it */
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
done:
@ -348,7 +348,7 @@ 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 *attr = NULL; /* attr token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5P_genplist_t *plist; /* Property list pointer */
H5VL_loc_params_t loc_params;
@ -405,7 +405,7 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to create attribute")
/* Register the new attribute and get an ID for it */
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
done:
@ -440,7 +440,7 @@ 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 *attr = NULL; /* attr token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
hid_t ret_value = H5I_INVALID_HID;
@ -473,7 +473,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id)
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute: '%s'", attr_name)
/* Register the attribute and get an ID for it */
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
done:
@ -511,7 +511,7 @@ 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 *attr = NULL; /* attr token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
hid_t ret_value = H5I_INVALID_HID;
@ -555,7 +555,7 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "can't open attribute")
/* Register the attribute and get an ID for it */
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
done:
@ -646,7 +646,7 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute")
/* Register the attribute and get an ID for it */
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
done:

View File

@ -114,7 +114,7 @@ hid_t
H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
hid_t acpl_id)
{
void *attr = NULL; /* attr token from VOL plugin */
void *attr = NULL; /* attr token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
H5P_genplist_t *plist; /* Property list pointer */
@ -160,7 +160,7 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to create attribute")
/* Register the new attribute and get an ID for it */
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID")
done:
@ -198,7 +198,7 @@ done:
hid_t
H5Aopen_name(hid_t loc_id, const char *name)
{
void *attr = NULL; /* attr token from VOL plugin */
void *attr = NULL; /* attr token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
hid_t ret_value = H5I_INVALID_HID; /* Return value */
@ -225,7 +225,7 @@ H5Aopen_name(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute")
/* Register the attribute and get an ID for it */
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
done:
@ -263,7 +263,7 @@ done:
hid_t
H5Aopen_idx(hid_t loc_id, unsigned idx)
{
void *attr = NULL; /* attr token from VOL plugin */
void *attr = NULL; /* attr token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
hid_t ret_value = H5I_INVALID_HID; /* Return value */
@ -293,7 +293,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx)
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute")
/* Register the attribute and get an ID for it */
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
done:

View File

@ -162,7 +162,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset")
/* Get an atom for the dataset */
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize dataset handle")
done:
@ -210,7 +210,7 @@ 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 *dset = NULL; /* dset token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
H5P_genplist_t *plist; /* Property list pointer */
@ -253,7 +253,7 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id,
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset")
/* Get an atom for the dataset */
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset")
done:
@ -284,7 +284,7 @@ done:
hid_t
H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id)
{
void *dset = NULL; /* dset token from VOL plugin */
void *dset = NULL; /* dset token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
hid_t ret_value = H5I_INVALID_HID; /* Return value */
@ -315,7 +315,7 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open dataset")
/* Register an atom for the dataset */
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register dataset atom")
done:

View File

@ -40,7 +40,7 @@
#include "H5Dpkg.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* IDs */
#include "H5VLprivate.h" /* VOL plugins */
#include "H5VLprivate.h" /* Virtual Object Layer */
/****************/
@ -113,7 +113,7 @@ 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 *dset = NULL; /* dset token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
H5P_genplist_t *plist; /* Property list pointer */
@ -165,7 +165,7 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset")
/* Get an atom for the dataset */
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset")
done:
@ -197,7 +197,7 @@ done:
hid_t
H5Dopen1(hid_t loc_id, const char *name)
{
void *dset = NULL; /* dset token from VOL plugin */
void *dset = NULL; /* dset token from VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
hid_t ret_value = H5I_INVALID_HID; /* Return value */
@ -224,7 +224,7 @@ H5Dopen1(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open dataset")
/* Get an atom for the dataset */
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register dataset atom")
done:

View File

@ -609,7 +609,7 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
H5P_genplist_t *plist; /* Property list pointer */
H5VL_class_t *cls = NULL; /* VOL Class structure for callback info */
H5VL_plugin_prop_t plugin_prop; /* Property for VOL plugin ID & info */
H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
hid_t ret_value; /* return value */
FUNC_ENTER_API(H5I_INVALID_HID)
@ -643,10 +643,10 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
/* get the VOL info from the fapl */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a file access property list")
if(H5P_peek(plist, H5F_ACS_VOL_DRV_NAME, &plugin_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL plugin info")
if(NULL == (cls = (H5VL_class_t *)H5I_object_verify(plugin_prop.plugin_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a VOL plugin ID")
if(H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL connector info")
if(NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_prop.connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a VOL connector ID")
/* Adjust bit flags by turning on the creation bit and making sure that
* the EXCL or TRUNC bit is set. All newly-created files are opened for
@ -661,7 +661,7 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to create file")
/* Get an atom for the file */
if((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, plugin_prop.plugin_id, TRUE)) < 0)
if((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
done:
@ -693,7 +693,7 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id)
{
void *new_file = NULL; /* file struct for new file */
H5P_genplist_t *plist; /* Property list pointer */
H5VL_plugin_prop_t plugin_prop; /* Property for VOL plugin ID & info */
H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
H5VL_class_t *cls = NULL; /* VOL class structure for callback info */
hid_t ret_value; /* return value */
@ -722,17 +722,17 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id)
/* Get the VOL info from the fapl */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a file access property list")
if(H5P_peek(plist, H5F_ACS_VOL_DRV_NAME, &plugin_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL plugin info")
if(NULL == (cls = (H5VL_class_t *)H5I_object_verify(plugin_prop.plugin_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid VOL plugin ID")
if(H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL connector info")
if(NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_prop.connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid VOL connector ID")
/* Open the file through the VOL layer */
if(NULL == (new_file = H5VL_file_open(cls, filename, flags, fapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file")
/* Get an ID for the file */
if((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, plugin_prop.plugin_id, TRUE)) < 0)
if((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
done:
@ -836,7 +836,7 @@ hid_t
H5Freopen(hid_t file_id)
{
H5VL_object_t *vol_obj = NULL;
void *file; /* File token from VOL plugin */
void *file; /* File token from VOL connector */
hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
@ -848,14 +848,14 @@ H5Freopen(hid_t file_id)
/* Reopen the file */
if(H5VL_file_specific(vol_obj, H5VL_FILE_REOPEN, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &file) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to reopen file via the VOL plugin")
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to reopen file via the VOL connector")
/* Make sure that worked */
if(NULL == file)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to reopen file")
/* Get an atom for the file */
if((ret_value = H5VL_register(H5I_FILE, file, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_FILE, file, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
done:

View File

@ -37,8 +37,8 @@
#include "H5Pprivate.h" /* Property lists */
#include "H5SMprivate.h" /* Shared Object Header Messages */
#include "H5Tprivate.h" /* Datatypes */
#include "H5VLprivate.h" /* VOL plugins */
#include "H5VLnative_private.h" /* Native VOL plugin */
#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VLnative_private.h" /* Native VOL connector */
/****************/
@ -2175,7 +2175,7 @@ H5F_get_id(H5F_t *file)
HDassert(file);
if(H5I_find_id(file, H5I_FILE, &ret_value) < 0 || H5I_INVALID_HID == ret_value) {
/* resurrect the ID - Register an ID with the native driver */
/* resurrect the ID - Register an ID with the native connector */
{
void *vol_wrap_ctx = NULL; /* Object wrapping context */
@ -3243,7 +3243,7 @@ H5F__start_swmr_write(H5F_t *f)
H5G_name_t *obj_paths = NULL; /* Group hierarchy path */
size_t u; /* Local index variable */
hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */
H5VL_t *vol_plugin = NULL; /* VOL plugin for the file */
H5VL_t *vol_connector = NULL; /* VOL connector for the file */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@ -3308,7 +3308,7 @@ H5F__start_swmr_write(H5F_t *f)
if(H5F_get_obj_ids(f, H5F_OBJ_GROUP|H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, &grp_dset_count) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed")
/* Save the VOL plugin and the object wrapping context for the refresh step */
/* Save the VOL connector and the object wrapping context for the refresh step */
if(grp_dset_count > 0) {
H5VL_object_t *vol_obj;
@ -3317,12 +3317,12 @@ H5F__start_swmr_write(H5F_t *f)
HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "invalid object identifier")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
/* Get the (top) plugin for the ID */
vol_plugin = vol_obj->plugin;
/* Get the (top) connector for the ID */
vol_connector = vol_obj->connector;
} /* end if */
/* Gather information about opened objects (groups, datasets) in the file */
@ -3388,7 +3388,7 @@ H5F__start_swmr_write(H5F_t *f)
/* Refresh (reopen) the objects (groups & datasets) in the file */
for(u = 0; u < grp_dset_count; u++)
if(H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], vol_plugin, TRUE) < 0)
if(H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], vol_connector, TRUE) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't refresh-close object")
/* Unlock the file */
@ -3539,10 +3539,10 @@ H5F_get_file_id(hid_t obj_id, H5I_type_t type)
if(H5I_find_id(file, H5I_FILE, &ret_value) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "getting file ID failed")
/* If the ID does not exist, register it with the VOL plugin */
/* If the ID does not exist, register it with the VOL connector */
if(H5I_INVALID_HID == ret_value) {
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;

View File

@ -477,9 +477,9 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id)
if(NULL == (child_vol_obj = (H5VL_object_t *)H5I_object(child_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get child object")
/* Check if both objects are associated with the same VOL plugin */
if(loc_vol_obj->plugin->cls->value != child_vol_obj->plugin->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL plugin")
/* Check if both objects are associated with the same VOL connector */
if(loc_vol_obj->connector->cls->value != child_vol_obj->connector->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL connector")
/* Perform the mount operation */
if(H5VL_file_specific(loc_vol_obj, H5VL_FILE_MOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, loc_type, name, child_vol_obj->data, plist_id) < 0)

View File

@ -479,7 +479,7 @@ typedef struct H5F_t H5F_t;
#define H5F_ACS_SDATA_BLOCK_SIZE_NAME "sdata_block_size" /* Minimum "small data" allocation block size (when aggregating "small" raw data allocations) */
#define H5F_ACS_GARBG_COLCT_REF_NAME "gc_ref" /* Garbage-collect references */
#define H5F_ACS_FILE_DRV_NAME "vfd_info" /* File driver ID & info */
#define H5F_ACS_VOL_DRV_NAME "vol_driver_info" /* VOL driver ID & info */
#define H5F_ACS_VOL_CONN_NAME "vol_connector_info" /* VOL connector ID & info */
#define H5F_ACS_CLOSE_DEGREE_NAME "close_degree" /* File close degree */
#define H5F_ACS_FAMILY_OFFSET_NAME "family_offset" /* Offset position in file for family file driver */
#define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */

View File

@ -369,7 +369,7 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id,
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group")
/* Get an atom for the group */
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize group handle")
done:
@ -448,7 +448,7 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group")
/* Get an atom for the group */
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize group handle")
done:
@ -509,7 +509,7 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open group")
/* Register an ID for the group */
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group")
done:
@ -812,7 +812,7 @@ H5Grefresh(hid_t group_id)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;

View File

@ -43,7 +43,7 @@
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
#include "H5Pprivate.h" /* Property lists */
#include "H5VLprivate.h" /* VOL plugins */
#include "H5VLprivate.h" /* Virtual Object Layer */
/****************/
@ -239,7 +239,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group")
/* Get an atom for the group */
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group")
done:
@ -300,7 +300,7 @@ H5Gopen1(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open group")
/* Get an atom for the group */
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group")
done:
@ -372,7 +372,7 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new
/* Construct a temporary VOL object */
tmp_vol_obj.data = NULL;
tmp_vol_obj.plugin = vol_obj->plugin;
tmp_vol_obj.connector = vol_obj->connector;
/* Create the link through the VOL */
if(H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, loc_params2, lcpl_id, H5P_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
@ -850,7 +850,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op,
HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, (-1), "invalid identifier")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, (-1), "can't set VOL wrapper info")
vol_wrapper_set = TRUE;

View File

@ -2146,7 +2146,7 @@ done:
*
* Failure: -1
*
* NOTE: Not safe for arbitrary VOL plugins as it relies on
* NOTE: Not safe for arbitrary VOL connectors as it relies on
* private H5G calls.
*
* Comments: Public function
@ -2181,7 +2181,7 @@ H5Iget_name(hid_t id, char *name/*out*/, size_t size)
HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, (-1), "invalid identifier")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, (-1), "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
@ -2260,7 +2260,7 @@ H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
HDassert(item);
HDassert(udata);
/* Get a pointer to the VOL plugin's data */
/* Get a pointer to the VOL connector's data */
obj_ptr = H5I__unwrap(item->obj_ptr, type);
/* Check for a match */
@ -2337,7 +2337,7 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */
H5I_type_t type = *(H5I_type_t *)_udata; /* User data */
H5G_name_t *path = NULL; /* Path to file object */
const void *obj_ptr = NULL; /* Pointer to VOL plugin object */
const void *obj_ptr = NULL; /* Pointer to VOL connector object */
FUNC_ENTER_STATIC_NOERR
@ -2352,7 +2352,7 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
const H5VL_object_t *vol_obj = (const H5VL_object_t *)item->obj_ptr;
obj_ptr = H5VL_object_data(vol_obj);
if(H5_VOL_NATIVE == vol_obj->plugin->cls->value)
if(H5_VOL_NATIVE == vol_obj->connector->cls->value)
path = H5G_nameof((const H5G_t *)obj_ptr);
break;
}
@ -2362,7 +2362,7 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
const H5VL_object_t *vol_obj = (const H5VL_object_t *)item->obj_ptr;
obj_ptr = H5VL_object_data(vol_obj);
if(H5_VOL_NATIVE == vol_obj->plugin->cls->value)
if(H5_VOL_NATIVE == vol_obj->connector->cls->value)
path = H5D_nameof((const H5D_t *)obj_ptr);
break;
}

View File

@ -34,7 +34,7 @@
#include "H5Oprivate.h" /* File objects */
#include "H5Pprivate.h" /* Property lists */
#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VLnative_private.h" /* Native VOL driver */
#include "H5VLnative_private.h" /* Native VOL connector */
/****************/
@ -325,10 +325,10 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
if (NULL == (vol_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 */
/* Make sure that the VOL connectors are the same */
if (vol_obj1 && vol_obj2)
if (vol_obj1->plugin->cls->value != vol_obj2->plugin->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked")
if (vol_obj1->connector->cls->value != vol_obj2->connector->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL connectors and can't be linked")
/* Move the link */
if(H5VL_link_move(vol_obj1, loc_params1, vol_obj2, loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
@ -408,14 +408,14 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
if(NULL == (vol_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 */
/* Make sure that the VOL connectors are the same */
if(vol_obj1 && vol_obj2)
if(vol_obj1->plugin->cls->value != vol_obj2->plugin->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked")
if(vol_obj1->connector->cls->value != vol_obj2->connector->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL connectors and can't be linked")
/* Construct a temporary source VOL object */
tmp_vol_obj.data = (vol_obj1 ? vol_obj1->data : NULL);
tmp_vol_obj.plugin = (vol_obj1 ? vol_obj1->plugin : vol_obj2->plugin);
tmp_vol_obj.connector = (vol_obj1 ? vol_obj1->connector : vol_obj2->connector);
/* Copy the link */
if(H5VL_link_copy(&tmp_vol_obj, loc_params1, vol_obj2, loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
@ -579,10 +579,10 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name,
if(NULL == (vol_obj2 = (H5VL_object_t *)H5VL_vol_object(new_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Make sure that the VOL plugins are the same */
/* Make sure that the VOL connectors are the same */
if(vol_obj1 && vol_obj2)
if(vol_obj1->plugin->cls->value != vol_obj2->plugin->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked")
if(vol_obj1->connector->cls->value != vol_obj2->connector->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL connectors and can't be linked")
/* Get the link creation plist structure */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(lcpl_id)))
@ -596,7 +596,7 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name,
/* Construct a temporary VOL object */
tmp_vol_obj.data = (vol_obj2 ? (vol_obj2->data) : NULL);
tmp_vol_obj.plugin = (vol_obj1 != NULL ? vol_obj1->plugin : vol_obj2->plugin);
tmp_vol_obj.connector = (vol_obj1 != NULL ? vol_obj1->connector : vol_obj2->connector);
/* Create the link */
if(H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
@ -735,7 +735,7 @@ H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
@ -864,7 +864,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
@ -989,7 +989,7 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
@ -1050,7 +1050,7 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
@ -1120,7 +1120,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
@ -1384,7 +1384,7 @@ H5Literate(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
loc_params.obj_type = H5I_get_type(group_id);
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
@ -1464,7 +1464,7 @@ H5Literate_by_name(hid_t loc_id, const char *group_name,
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
@ -1542,7 +1542,7 @@ H5Lvisit(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
@ -1627,7 +1627,7 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type,
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;

View File

@ -34,7 +34,7 @@
#include "H5Opublic.h" /* File objects */
#include "H5Pprivate.h" /* Property lists */
#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VLnative_private.h" /* Native VOL driver */
#include "H5VLnative_private.h" /* Native VOL connector */
/****************/

View File

@ -134,7 +134,7 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id)
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object")
/* Get an atom for the object */
if((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize object handle")
done:
@ -206,7 +206,7 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type,
if(NULL == (opened_obj = H5VL_object_open(vol_obj, loc_params, &opened_type, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object")
if((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize object handle")
done:
@ -274,7 +274,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr)
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object")
/* Register the dataset ID */
if((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize object handle")
done:
@ -356,10 +356,10 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id,
if(NULL == (vol_obj2 = H5VL_vol_object(new_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Make sure that the VOL plugins are the same */
/* Make sure that the VOL connectors are the same */
if(vol_obj1 && vol_obj2)
if (vol_obj1->plugin->cls->value != vol_obj2->plugin->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL plugins and can't be linked")
if (vol_obj1->connector->cls->value != vol_obj2->connector->cls->value)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL connectors and can't be linked")
/* Get the plist structure */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(lcpl_id)))
@ -373,7 +373,7 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id,
/* Construct a temporary VOL object */
tmp_vol_obj.data = vol_obj2->data;
tmp_vol_obj.plugin = (vol_obj1 != NULL ? vol_obj1->plugin : vol_obj2->plugin);
tmp_vol_obj.connector = (vol_obj1 != NULL ? vol_obj1->connector : vol_obj2->connector);
/* Create a link to the object */
if(H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)

View File

@ -248,7 +248,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
loc_params2.obj_type = H5I_get_type(dst_loc_id);
/* Set wrapper info in API context */
if(H5VL_set_vol_wrapper(vol_obj1->data, vol_obj1->plugin) < 0)
if(H5VL_set_vol_wrapper(vol_obj1->data, vol_obj1->connector) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;

View File

@ -299,7 +299,7 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc)
H5O_loc_t obj_oloc;
H5G_name_t obj_path;
H5O_shared_t cached_H5O_shared;
H5VL_t *plugin = NULL;
H5VL_t *connector = NULL;
/* Create empty object location */
obj_loc.oloc = &obj_oloc;
@ -317,29 +317,29 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc)
if(H5T_save_refresh_state(oid, &cached_H5O_shared) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to save datatype state")
/* Get the VOL object from the ID and cache a pointer to the plugin.
/* Get the VOL object from the ID and cache a pointer to the connector.
* The vol_obj will disappear when the underlying object is closed, so
* we can't use that directly.
*/
if(NULL == (vol_obj = H5VL_vol_object(oid)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
plugin = vol_obj->plugin;
connector = vol_obj->connector;
/* Bump the number of references on the VOL plugin.
* If you don't do this, VDS refreshes can accidentally close the plugin.
/* Bump the number of references on the VOL connector.
* If you don't do this, VDS refreshes can accidentally close the connector.
*/
plugin->nrefs++;
connector->nrefs++;
/* Close object & evict its metadata */
if((H5O__refresh_metadata_close(oid, oloc, &obj_loc)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object")
/* Re-open the object, re-fetching its metadata */
if((H5O_refresh_metadata_reopen(oid, &obj_loc, plugin, FALSE)) < 0)
if((H5O_refresh_metadata_reopen(oid, &obj_loc, connector, FALSE)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object")
/* Restore the number of references on the VOL plugin */
plugin->nrefs--;
/* Restore the number of references on the VOL connector */
connector->nrefs--;
/* Restore important datatype state */
if(H5I_get_type(oid) == H5I_DATATYPE)
@ -442,7 +442,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, H5VL_t *vol_plugin, hbool_t start_swmr)
H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, H5VL_t *vol_connector, hbool_t start_swmr)
{
void *object = NULL; /* Object for this operation */
H5I_type_t type; /* Type of object for the ID */
@ -452,7 +452,7 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, H5VL_t *vol_plugin, h
/* Sanity check */
HDassert(obj_loc);
HDassert(vol_plugin);
HDassert(vol_connector);
/* Get object's type */
type = H5I_get_type(oid);
@ -499,7 +499,7 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, H5VL_t *vol_plugin, h
} /* end switch */
/* Re-register ID for the object */
if((H5VL_register_using_existing_id(type, object, vol_plugin, TRUE, oid)) < 0)
if((H5VL_register_using_existing_id(type, object, vol_connector, TRUE, oid)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to re-register object ID after refresh")
done:

View File

@ -39,7 +39,7 @@
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory Management */
#include "H5Ppkg.h" /* Property lists */
#include "H5VLprivate.h" /* VOL plugins */
#include "H5VLprivate.h" /* Virtual Object Layer */
/* Includes needed to set as default file driver */
#include "H5FDsec2.h" /* POSIX unbuffered I/O */
@ -48,8 +48,8 @@
#include "H5FDwindows.h" /* Win32 I/O */
#endif
/* Includes needed to set the default VOL plugin */
#include "H5VLnative_private.h" /* Native VOL plugin */
/* Includes needed to set the default VOL connector */
#include "H5VLnative_private.h" /* Native VOL connector */
/****************/
@ -262,16 +262,16 @@
#define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF 0
#define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_ENC H5P__encode_unsigned
#define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEC H5P__decode_unsigned
/* Definition for file VOL plugin properties (ID, etc.) */
#define H5F_ACS_VOL_SIZE sizeof(H5VL_plugin_prop_t)
#define H5F_ACS_VOL_DEF {H5_DEFAULT_VOL, NULL}
#define H5F_ACS_VOL_CRT H5P__facc_vol_create
#define H5F_ACS_VOL_SET H5P__facc_vol_set
#define H5F_ACS_VOL_GET H5P__facc_vol_get
#define H5F_ACS_VOL_DEL H5P__facc_vol_del
#define H5F_ACS_VOL_COPY H5P__facc_vol_copy
#define H5F_ACS_VOL_CMP H5P__facc_vol_cmp
#define H5F_ACS_VOL_CLOSE H5P__facc_vol_close
/* Definition for file VOL connector properties (ID, etc.) */
#define H5F_ACS_VOL_CONN_SIZE sizeof(H5VL_connector_prop_t)
#define H5F_ACS_VOL_CONN_DEF {H5_DEFAULT_VOL, NULL}
#define H5F_ACS_VOL_CONN_CRT H5P__facc_vol_create
#define H5F_ACS_VOL_CONN_SET H5P__facc_vol_set
#define H5F_ACS_VOL_CONN_GET H5P__facc_vol_get
#define H5F_ACS_VOL_CONN_DEL H5P__facc_vol_del
#define H5F_ACS_VOL_CONN_COPY H5P__facc_vol_copy
#define H5F_ACS_VOL_CONN_CMP H5P__facc_vol_cmp
#define H5F_ACS_VOL_CONN_CLOSE H5P__facc_vol_close
/******************/
@ -334,7 +334,7 @@ static int H5P__facc_cache_image_config_cmp(const void *_config1, const void *_c
static herr_t H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size);
static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value);
/* VOL plugin callbacks */
/* VOL connector callbacks */
static herr_t H5P__facc_vol_create(const char *name, size_t size, void *value);
static herr_t H5P__facc_vol_set(hid_t prop_id, const char *name, size_t size, void *value);
static herr_t H5P__facc_vol_get(hid_t prop_id, const char *name, size_t size, void *value);
@ -437,7 +437,7 @@ static herr_t
H5P__facc_reg_prop(H5P_genclass_t *pclass)
{
const H5FD_driver_prop_t def_driver_prop = H5F_ACS_FILE_DRV_DEF; /* Default VFL driver ID & info (initialized from a variable) */
const H5VL_plugin_prop_t def_vol_prop = H5F_ACS_VOL_DEF; /* Default VOL plugin ID & info (initialized from a variable) */
const H5VL_connector_prop_t def_vol_prop = H5F_ACS_VOL_CONN_DEF; /* Default VOL connector ID & info (initialized from a variable) */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@ -668,11 +668,11 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass)
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the file VOL plugin ID & info */
/* Register the file VOL connector ID & info */
/* (Note: this property should not have an encode/decode callback -QAK) */
if(H5P__register_real(pclass, H5F_ACS_VOL_DRV_NAME, H5F_ACS_VOL_SIZE, &def_vol_prop,
H5F_ACS_VOL_CRT, H5F_ACS_VOL_SET, H5F_ACS_VOL_GET, NULL, NULL,
H5F_ACS_VOL_DEL, H5F_ACS_VOL_COPY, H5F_ACS_VOL_CMP, H5F_ACS_VOL_CLOSE) < 0)
if(H5P__register_real(pclass, H5F_ACS_VOL_CONN_NAME, H5F_ACS_VOL_CONN_SIZE, &def_vol_prop,
H5F_ACS_VOL_CONN_CRT, H5F_ACS_VOL_CONN_SET, H5F_ACS_VOL_CONN_GET, NULL, NULL,
H5F_ACS_VOL_CONN_DEL, H5F_ACS_VOL_CONN_COPY, H5F_ACS_VOL_CONN_CMP, H5F_ACS_VOL_CONN_CLOSE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
done:
@ -4974,7 +4974,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P_set_vol
*
* Purpose: Set the VOL plugin for a file access property list
* Purpose: Set the VOL connector for a file access property list
* (PLIST_ID). The VOL properties will
* be copied into the property list and the reference count on
* the VOL will be incremented.
@ -4991,18 +4991,18 @@ H5P_set_vol(H5P_genplist_t *plist, hid_t vol_id, const void *vol_info)
FUNC_ENTER_NOAPI(FAIL)
if(NULL == H5I_object_verify(vol_id, H5I_VOL))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL plugin ID")
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
H5VL_plugin_prop_t vol_prop; /* Property for VOL ID & info */
H5VL_connector_prop_t vol_prop; /* Property for VOL ID & info */
/* Prepare the VOL plugin property */
vol_prop.plugin_id = vol_id;
vol_prop.plugin_info = vol_info;
/* Prepare the VOL connector property */
vol_prop.connector_id = vol_id;
vol_prop.connector_info = vol_info;
/* Set the plugin ID & info property */
if(H5P_set(plist, H5F_ACS_VOL_DRV_NAME, &vol_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VOL plugin ID & info")
/* Set the connector ID & info property */
if(H5P_set(plist, H5F_ACS_VOL_CONN_NAME, &vol_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VOL connector ID & info")
} /* end if */
else
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
@ -5015,7 +5015,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pset_vol
*
* Purpose: Set the file VOL plugin (VOL_ID) for a file access
* Purpose: Set the file VOL connector (VOL_ID) for a file access
* property list (PLIST_ID)
*
* Return: Success: Non-negative
@ -5050,7 +5050,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pget_vol_id
*
* Purpose: Returns the ID of the current VOL plugin.
* Purpose: Returns the ID of the current VOL connector.
* This ID should be closed with H5VLclose().
*
* Return: Success: Non-negative
@ -5073,18 +5073,18 @@ H5Pget_vol_id(hid_t plist_id, hid_t *vol_id)
/* Get the current VOL ID */
if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
H5VL_plugin_prop_t plugin_prop; /* Property for VOL plugin ID & info */
H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
/* Get the plugin property */
if(H5P_peek(plist, H5F_ACS_VOL_DRV_NAME, &plugin_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get VOL plugin info")
/* Get the connector property */
if(H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get VOL connector info")
/* Increment the VOL ID's ref count */
if(H5I_inc_ref(plugin_prop.plugin_id, TRUE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin ID")
if(H5I_inc_ref(connector_prop.connector_id, TRUE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINC, FAIL, "unable to increment ref count on VOL connector ID")
/* Set the plugin ID to return */
*vol_id = plugin_prop.plugin_id;
/* Set the connector ID to return */
*vol_id = connector_prop.connector_id;
} /* end if */
else
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
@ -5097,8 +5097,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pget_vol_info
*
* Purpose: Returns a copy of the VOL info for a plugin.
* This information should be freed with H5VLfree_plugin_info.
* Purpose: Returns a copy of the VOL info for a connector.
* This information should be freed with H5VLfree_connector_info.
*
* Return: Success: Non-negative
* Failure: Negative
@ -5120,28 +5120,28 @@ H5Pget_vol_info(hid_t plist_id, void **vol_info)
/* Get the current VOL info */
if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
void *new_plugin_info = NULL; /* Copy of plugin info */
H5VL_plugin_prop_t plugin_prop; /* Property for VOL plugin ID & info */
void *new_connector_info = NULL; /* Copy of connector info */
H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
/* Get the plugin property */
if(H5P_peek(plist, H5F_ACS_VOL_DRV_NAME, &plugin_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get VOL plugin info")
/* Get the connector property */
if(H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get VOL connector info")
/* Copy plugin info, if it exists */
if(plugin_prop.plugin_info) {
H5VL_class_t *plugin; /* Pointer to plugin */
/* Copy connector info, if it exists */
if(connector_prop.connector_info) {
H5VL_class_t *connector; /* Pointer to connector */
/* Retrieve the plugin for the ID */
if(NULL == (plugin = (H5VL_class_t *)H5I_object(plugin_prop.plugin_id)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL plugin ID")
/* Retrieve the connector for the ID */
if(NULL == (connector = (H5VL_class_t *)H5I_object(connector_prop.connector_id)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Allocate and copy plugin info */
if(H5VL_copy_plugin_info(plugin, &new_plugin_info, plugin_prop.plugin_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "plugin info copy failed")
/* Allocate and copy connector info */
if(H5VL_copy_connector_info(connector, &new_connector_info, connector_prop.connector_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "connector info copy failed")
} /* end if */
/* Set the plugin info */
*vol_info = new_plugin_info;
/* Set the connector info */
*vol_info = new_connector_info;
} /* end if */
else
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
@ -5154,7 +5154,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P__vol_copy
*
* Purpose: Copy VOL plugin ID & info.
* Purpose: Copy VOL connector ID & info.
*
* Note: This is an "in-place" copy, since this routine gets called
* after the top-level copy has been performed and this routine
@ -5173,29 +5173,29 @@ H5P__vol_copy(void *value)
FUNC_ENTER_STATIC
if(value) {
H5VL_plugin_prop_t *plugin_prop = (H5VL_plugin_prop_t *)value; /* Driver ID & info struct */
H5VL_connector_prop_t *connector_prop = (H5VL_connector_prop_t *)value; /* connector ID & info struct */
/* Copy the plugin ID & info, if there is one */
if(plugin_prop->plugin_id > 0) {
/* Increment the reference count on plugin ID and copy plugin info */
if(H5I_inc_ref(plugin_prop->plugin_id, FALSE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin ID")
/* Copy the connector ID & info, if there is one */
if(connector_prop->connector_id > 0) {
/* Increment the reference count on connector ID and copy connector info */
if(H5I_inc_ref(connector_prop->connector_id, FALSE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINC, FAIL, "unable to increment ref count on VOL connector ID")
/* Copy plugin info, if it exists */
if(plugin_prop->plugin_info) {
H5VL_class_t *plugin; /* Pointer to plugin */
void *new_plugin_info = NULL; /* Copy of plugin info */
/* Copy connector info, if it exists */
if(connector_prop->connector_info) {
H5VL_class_t *connector; /* Pointer to connector */
void *new_connector_info = NULL; /* Copy of connector info */
/* Retrieve the plugin for the ID */
if(NULL == (plugin = (H5VL_class_t *)H5I_object(plugin_prop->plugin_id)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL plugin ID")
/* Retrieve the connector for the ID */
if(NULL == (connector = (H5VL_class_t *)H5I_object(connector_prop->connector_id)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Allocate and copy plugin info */
if(H5VL_copy_plugin_info(plugin, &new_plugin_info, plugin_prop->plugin_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "plugin info copy failed")
/* Allocate and copy connector info */
if(H5VL_copy_connector_info(connector, &new_connector_info, connector_prop->connector_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "connector info copy failed")
/* Set the plugin info to the copy */
plugin_prop->plugin_info = new_plugin_info;
/* Set the connector info to the copy */
connector_prop->connector_info = new_connector_info;
} /* end if */
} /* end if */
} /* end if */
@ -5208,7 +5208,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P__vol_free
*
* Purpose: Free VOL plugin ID & info.
* Purpose: Free VOL connector ID & info.
*
* Return: Success: Non-negative
* Failure: Negative
@ -5223,25 +5223,25 @@ H5P__vol_free(void *value)
FUNC_ENTER_STATIC
if(value) {
H5VL_plugin_prop_t *info = (H5VL_plugin_prop_t *)value; /* Driver ID & info struct */
H5VL_connector_prop_t *info = (H5VL_connector_prop_t *)value; /* connector ID & info struct */
/* Free the plugin info (if it exists) and decrement the ID */
if(info->plugin_id > 0) {
if(info->plugin_info) {
H5VL_class_t *plugin; /* Pointer to plugin */
/* Free the connector info (if it exists) and decrement the ID */
if(info->connector_id > 0) {
if(info->connector_info) {
H5VL_class_t *connector; /* Pointer to connector */
/* Retrieve the plugin for the ID */
if(NULL == (plugin = (H5VL_class_t *)H5I_object(info->plugin_id)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL plugin ID")
/* Retrieve the connector for the ID */
if(NULL == (connector = (H5VL_class_t *)H5I_object(info->connector_id)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Free the plugin info */
if(H5VL_free_plugin_info(plugin, (void *)info->plugin_info) < 0) /* Casting away const OK - QAK */
HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to release VOL plugin info object")
/* Free the connector info */
if(H5VL_free_connector_info(connector, (void *)info->connector_info) < 0) /* Casting away const OK - QAK */
HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to release VOL connector info object")
} /* end if */
/* Decrement reference count for plugin ID */
if(H5I_dec_ref(info->plugin_id) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTDEC, FAIL, "can't decrement reference count for plugin ID")
/* Decrement reference count for connector ID */
if(H5I_dec_ref(info->connector_id) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTDEC, FAIL, "can't decrement reference count for connector ID")
} /* end if */
} /* end if */
@ -5253,7 +5253,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P__facc_vol_create
*
* Purpose: Create callback for the VOL plugin ID & info property.
connectorose: Create callback for the VOL connector ID & info property.
*
* Return: Success: Non-negative
* Failure: Negative
@ -5267,9 +5267,9 @@ H5P__facc_vol_create(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size
FUNC_ENTER_STATIC
/* Make copy of the VOL plugin */
/* Make copy of the VOL connector */
if(H5P__vol_copy(value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy VOL plugin")
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy VOL connector")
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -5279,7 +5279,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P__facc_vol_set
*
* Purpose: Copies a VOL plugin property when it's set for a property list
* Purpose: Copies a VOL connector property when it's set for a property list
*
* Return: Success: Non-negative
* Failure: Negative
@ -5297,9 +5297,9 @@ H5P__facc_vol_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
/* Sanity check */
HDassert(value);
/* Make copy of VOL plugin ID & info */
/* Make copy of VOL connector ID & info */
if(H5P__vol_copy(value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy VOL plugin")
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy VOL connector")
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -5309,7 +5309,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P__facc_vol_get
*
* Purpose: Copies a VOL plugin property when it's retrieved from a property list
* Purpose: Copies a VOL connector property when it's retrieved from a property list
*
* Return: Success: Non-negative
* Failure: Negative
@ -5327,9 +5327,9 @@ H5P__facc_vol_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
/* Sanity check */
HDassert(value);
/* Make copy of VOL plugin */
/* Make copy of VOL connector */
if(H5P__vol_copy(value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy VOL plugin")
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy VOL connector")
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -5339,7 +5339,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P__facc_vol_del
*
* Purpose: Frees memory used to store the VOL plugin ID & info property
* Purpose: Frees memory used to store the VOL connector ID & info property
*
* Return: Success: Non-negative
* Failure: Negative
@ -5353,9 +5353,9 @@ H5P__facc_vol_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
FUNC_ENTER_STATIC
/* Free the VOL plugin ID & info */
/* Free the VOL connector ID & info */
if(H5P__vol_free(value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "can't release VOL plugin")
HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "can't release VOL connector")
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -5365,7 +5365,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P__facc_vol_copy
*
* Purpose: Copy callback for the VOL plugin ID & info property.
* Purpose: Copy callback for the VOL connector ID & info property.
*
* Return: Success: Non-negative
* Failure: Negative
@ -5379,9 +5379,9 @@ H5P__facc_vol_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size,
FUNC_ENTER_STATIC
/* Make copy of VOL plugin */
/* Make copy of VOL connector */
if(H5P__vol_copy(value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy VOL plugin")
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy VOL connector")
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -5391,7 +5391,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P__facc_vol_cmp
*
* Purpose: Callback routine which is called whenever the VOL plugin
* Purpose: Callback routine which is called whenever the VOL connector
* ID & info property in the file access property list
* is compared.
*
@ -5404,9 +5404,9 @@ done:
static int
H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED size)
{
const H5VL_plugin_prop_t *info1 = (const H5VL_plugin_prop_t *)_info1; /* Create local aliases for values */
const H5VL_plugin_prop_t *info2 = (const H5VL_plugin_prop_t *)_info2;
H5VL_class_t *cls1, *cls2; /* Driver class for each property */
const H5VL_connector_prop_t *info1 = (const H5VL_connector_prop_t *)_info1; /* Create local aliases for values */
const H5VL_connector_prop_t *info2 = (const H5VL_connector_prop_t *)_info2;
H5VL_class_t *cls1, *cls2; /* connector class for each property */
int cmp_value; /* Value from comparison */
int ret_value = 0; /* Return value */
@ -5415,18 +5415,18 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED
/* Sanity check */
HDassert(info1);
HDassert(info2);
HDassert(size == sizeof(H5VL_plugin_prop_t));
HDassert(size == sizeof(H5VL_connector_prop_t));
/* Compare plugins */
if(NULL == (cls1 = (H5VL_class_t *)H5I_object(info1->plugin_id)))
/* Compare connectors */
if(NULL == (cls1 = (H5VL_class_t *)H5I_object(info1->connector_id)))
HGOTO_DONE(-1)
if(NULL == (cls2 = (H5VL_class_t *)H5I_object(info2->plugin_id)))
if(NULL == (cls2 = (H5VL_class_t *)H5I_object(info2->connector_id)))
HGOTO_DONE(1)
if(0 != (cmp_value = H5VL_cmp_plugin_cls(cls1, cls2)))
if(0 != (cmp_value = H5VL_cmp_connector_cls(cls1, cls2)))
HGOTO_DONE(cmp_value);
/* At this point, we should be able to assume that we are dealing with
* the same plugin class struct (or a copies of the same class struct)
* the same connector class struct (or a copies of the same class struct)
*/
@ -5434,7 +5434,7 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED
* info objects
*/
HDassert(cls1->info_cmp == cls2->info_cmp);
if(0 != (cmp_value = H5VL_cmp_plugin_info(cls1, info1->plugin_info, info2->plugin_info)))
if(0 != (cmp_value = H5VL_cmp_connector_info(cls1, info1->connector_info, info2->connector_info)))
HGOTO_DONE(cmp_value);
done:
@ -5445,7 +5445,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P__facc_vol_close
*
* Purpose: Close callback for the VOL plugin ID & info property.
* Purpose: Close callback for the VOL connector ID & info property.
*
* Return: Success: Non-negative
* Failure: Negative
@ -5459,9 +5459,9 @@ H5P__facc_vol_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size,
FUNC_ENTER_STATIC
/* Free the VOL plugin */
/* Free the VOL connector */
if(H5P__vol_free(value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "can't release VOL plugin")
HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "can't release VOL connector")
done:
FUNC_LEAVE_NOAPI(ret_value)

View File

@ -201,7 +201,7 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r
if(NULL == (opened_obj = H5VL_object_open(vol_obj, loc_params, &opened_type, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to dereference object")
if((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle")
done:

View File

@ -37,13 +37,13 @@
#include "H5Ppublic.h" /* Property lists */
/* Private headers needed by this file */
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gprivate.h" /* Groups */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gprivate.h" /* Groups */
#include "H5Iprivate.h" /* IDs */
#include "H5Oprivate.h" /* Object headers */
#include "H5Oprivate.h" /* Object headers */
#include "H5Rpkg.h" /* References */
@ -186,7 +186,7 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to dereference object")
/* Get an atom for the object */
if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize object handle")
done:

View File

@ -1609,10 +1609,10 @@ H5T__close_cb(H5T_t *dt)
HDassert(dt->shared);
/* If this datatype is VOL-managed (i.e.: has a VOL object),
* close it through the VOL plugin.
* close it through the VOL connector.
*/
if(NULL != dt->vol_obj) {
/* Close the plugin-managed datatype data */
/* Close the connector-managed datatype data */
if(H5VL_datatype_close(dt->vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to close datatype")
@ -3671,7 +3671,7 @@ done:
* Purpose: Frees a datatype and all associated memory.
*
* Note: Does _not_ deal with open named datatypes, etc. so this
* should never see a type managed by a VOL plugin.
* should never see a type managed by a VOL connector.
*
* Return: Non-negative on success/Negative on failure
*

View File

@ -156,11 +156,11 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id,
/* Set up 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->plugin = vol_obj->plugin;
new_obj->plugin->nrefs ++;
new_obj->connector = vol_obj->connector;
new_obj->connector->nrefs ++;
new_obj->data = data;
/* Set the committed type object to the VOL plugin pointer in the H5T_t struct */
/* Set the committed type object to the VOL connector pointer in the H5T_t struct */
dt->vol_obj = new_obj;
done:
@ -267,7 +267,7 @@ done:
herr_t
H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
{
void *dt = NULL; /* datatype object created by VOL plugin */
void *dt = NULL; /* datatype object created by VOL connector */
H5VL_object_t *new_obj = NULL; /* VOL object that holds the datatype object and the VOL info */
H5T_t *type = NULL; /* Datatype created */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
@ -309,11 +309,11 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_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->plugin = vol_obj->plugin;
new_obj->plugin->nrefs ++;
new_obj->connector = vol_obj->connector;
new_obj->connector->nrefs ++;
new_obj->data = dt;
/* Set the committed type object to the VOL plugin pointer in the H5T_t struct */
/* Set the committed type object to the VOL connector pointer in the H5T_t struct */
type->vol_obj = new_obj;
done:
@ -564,7 +564,7 @@ done:
hid_t
H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id)
{
void *dt = NULL; /* datatype token created by VOL plugin */
void *dt = NULL; /* datatype token created by VOL connector */
H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
H5VL_loc_params_t loc_params;
hid_t ret_value = H5I_INVALID_HID; /* Return value */
@ -595,7 +595,7 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype")
/* Register the type and return the ID */
if((ret_value = H5VL_register(H5I_DATATYPE, dt, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_DATATYPE, dt, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype")
done:
@ -1080,7 +1080,7 @@ H5T_update_shared(H5T_t *dt)
/*-------------------------------------------------------------------------
* Function: H5T_construct_datatype
*
* Purpose: Create a Library datatype with a plugin specific datatype object
* Purpose: Create a Library datatype with a connector specific datatype object
*
* Return: Success: A type structure
* Failure: NULL
@ -1092,7 +1092,7 @@ H5T_construct_datatype(H5VL_object_t *vol_obj)
{
ssize_t nalloc;
void *buf = NULL;
H5T_t *dt = NULL; /* datatype token from VOL plugin */
H5T_t *dt = NULL; /* datatype token from VOL connector */
H5T_t *ret_value = NULL;
FUNC_ENTER_NOAPI(NULL)
@ -1151,7 +1151,7 @@ H5T_get_named_type(const H5T_t *dt)
/*-------------------------------------------------------------------------
* Function: H5T_get_actual_type
*
* Purpose: Returns underlying native datatype created by native plugin
* Purpose: Returns underlying native datatype created by native connector
* if datatype is committed, otherwise return the datatype
* object associate with the ID.
*

View File

@ -43,7 +43,7 @@
#include "H5Iprivate.h" /* IDs */
#include "H5Ppublic.h" /* Property Lists */
#include "H5Tpkg.h" /* Datatypes */
#include "H5VLprivate.h" /* VOL plugins */
#include "H5VLprivate.h" /* Virtual Object Layer */
/****************/
@ -143,11 +143,11 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id)
/* Set up 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->plugin = vol_obj->plugin;
new_obj->plugin->nrefs ++;
new_obj->connector = vol_obj->connector;
new_obj->connector->nrefs ++;
new_obj->data = data;
/* Set the committed type object to the VOL pluging pointer in the H5T_t struct */
/* Set the committed type object to the VOL connectorg pointer in the H5T_t struct */
dt->vol_obj = new_obj;
done:
@ -174,7 +174,7 @@ done:
hid_t
H5Topen1(hid_t loc_id, const char *name)
{
void *dt = NULL; /* Datatype token created by VOL plugin */
void *dt = NULL; /* Datatype token created by VOL connector */
H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */
H5VL_loc_params_t loc_params;
hid_t ret_value = H5I_INVALID_HID; /* Return value */
@ -198,7 +198,7 @@ H5Topen1(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype")
/* Register the type and return the ID */
if((ret_value = H5VL_register(H5I_DATATYPE, dt, vol_obj->plugin, TRUE)) < 0)
if((ret_value = H5VL_register(H5I_DATATYPE, dt, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype")
done:

View File

@ -45,21 +45,21 @@
/* Local Typedefs */
/******************/
/* Information needed for iterating over the registered VOL plugin hid_t IDs.
* The name of the new VOL plugin that is being registered is stored in the
/* Information needed for iterating over the registered VOL connector hid_t IDs.
* The name of the new VOL connector that is being registered is stored in the
* name field and the found_id field is initialized to H5I_INVALID_HID (-1).
* If we find a VOL plugin with the same name, we set the found_id field to
* If we find a VOL connector with the same name, we set the found_id field to
* the existing ID for return to the function.
*/
typedef struct {
const char *name; /* The name of the VOL plugin to check */
const char *name; /* The name of the VOL connector to check */
hid_t found_id; /* The library ID if we found a match */
} H5VL_get_plugin_ud_t;
} H5VL_get_connector_ud_t;
/********************/
/* Local Prototypes */
/********************/
static int H5VL__get_plugin_cb(void *obj, hid_t id, void *_op_data);
static int H5VL__get_connector_cb(void *obj, hid_t id, void *_op_data);
/*********************/
/* Package Variables */
@ -75,7 +75,7 @@ static int H5VL__get_plugin_cb(void *obj, hid_t id, void *_op_data);
/*-------------------------------------------------------------------------
* Function: H5VL__get_plugin_cb
* Function: H5VL__get_connector_cb
*
* Purpose: Callback routine to search through registered VOLs
*
@ -87,9 +87,9 @@ static int H5VL__get_plugin_cb(void *obj, hid_t id, void *_op_data);
*-------------------------------------------------------------------------
*/
static int
H5VL__get_plugin_cb(void *obj, hid_t id, void *_op_data)
H5VL__get_connector_cb(void *obj, hid_t id, void *_op_data)
{
H5VL_get_plugin_ud_t *op_data = (H5VL_get_plugin_ud_t *)_op_data; /* User data for callback */
H5VL_get_connector_ud_t *op_data = (H5VL_get_connector_ud_t *)_op_data; /* User data for callback */
H5VL_class_t *cls = (H5VL_class_t *)obj;
int ret_value = H5_ITER_CONT; /* Callback return value */
@ -101,17 +101,17 @@ H5VL__get_plugin_cb(void *obj, hid_t id, void *_op_data)
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL__get_plugin_cb() */
} /* end H5VL__get_connector_cb() */
/*-------------------------------------------------------------------------
* Function: H5VLregister_plugin
* Function: H5VLregister_connector
*
* Purpose: Registers a new VOL plugin as a member of the virtual object
* Purpose: Registers a new VOL connector as a member of the virtual object
* layer class.
*
* Return: Success: A VOL plugin ID which is good until the
* library is closed or the plugin is
* Return: Success: A VOL connector ID which is good until the
* library is closed or the connector is
* unregistered.
*
* Failure: H5I_INVALID_HID
@ -119,9 +119,9 @@ H5VL__get_plugin_cb(void *obj, hid_t id, void *_op_data)
*-------------------------------------------------------------------------
*/
hid_t
H5VLregister_plugin(const H5VL_class_t *cls, hid_t vipl_id)
H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id)
{
H5VL_get_plugin_ud_t op_data; /* Callback info for plugin search */
H5VL_get_connector_ud_t op_data; /* Callback info for connector search */
hid_t ret_value = H5I_INVALID_HID;
FUNC_ENTER_API(H5I_INVALID_HID)
@ -129,48 +129,48 @@ H5VLregister_plugin(const H5VL_class_t *cls, hid_t vipl_id)
/* Check arguments */
if (!cls)
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "VOL plugin class pointer cannot be NULL")
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "VOL connector class pointer cannot be NULL")
if (!cls->name)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL plugin class name cannot be the NULL pointer")
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL connector class name cannot be the NULL pointer")
if (0 == HDstrlen(cls->name))
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL plugin class name cannot be the empty string")
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL connector class name cannot be the empty string")
if (cls->info_copy && !cls->info_free)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL plugin must provide free callback for VOL info objects when a copy callback is provided")
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL connector must provide free callback for VOL info objects when a copy callback is provided")
if (cls->get_wrap_ctx && !cls->free_wrap_ctx)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL plugin must provide free callback for object wrapping contexts when a get callback is provided")
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL connector must provide free callback for object wrapping contexts when a get callback is provided")
op_data.found_id = H5I_INVALID_HID;
op_data.name = cls->name;
/* check if plugin is already registered */
if (H5I_iterate(H5I_VOL, H5VL__get_plugin_cb, &op_data, TRUE) < 0)
/* check if connector is already registered */
if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0)
HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL IDs")
/* Increment the ref count on the existing VOL plugin ID, if it's already registered */
/* Increment the ref count on the existing VOL connector ID, if it's already registered */
if(op_data.found_id != H5I_INVALID_HID) {
if (H5I_inc_ref(op_data.found_id, TRUE) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL plugin")
HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector")
ret_value = op_data.found_id;
} /* end if */
else {
/* Create a new class ID */
if ((ret_value = H5VL_register_plugin(cls, TRUE, vipl_id)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL plugin")
if ((ret_value = H5VL_register_connector(cls, TRUE, vipl_id)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector")
} /* end else */
done:
FUNC_LEAVE_API(ret_value)
} /* end H5VLregister_plugin() */
} /* end H5VLregister_connector() */
/*-------------------------------------------------------------------------
* Function: H5VLregister_plugin_by_name
* Function: H5VLregister_connector_by_name
*
* Purpose: Registers a new VOL plugin as a member of the virtual object
* Purpose: Registers a new VOL connector as a member of the virtual object
* layer class.
*
* Return: Success: A VOL plugin ID which is good until the
* library is closed or the plugin is
* Return: Success: A VOL connector ID which is good until the
* library is closed or the connector is
* unregistered.
*
* Failure: H5I_INVALID_HID
@ -178,9 +178,9 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
H5VLregister_plugin_by_name(const char *name, hid_t vipl_id)
H5VLregister_connector_by_name(const char *name, hid_t vipl_id)
{
H5VL_get_plugin_ud_t op_data; /* Callback info for plugin search */
H5VL_get_connector_ud_t op_data; /* Callback info for connector search */
hid_t ret_value = H5I_INVALID_HID;
FUNC_ENTER_API(H5I_INVALID_HID)
@ -188,44 +188,44 @@ H5VLregister_plugin_by_name(const char *name, hid_t vipl_id)
/* Check arguments */
if (!name)
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "null VOL plugin name is disallowed")
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "null VOL connector name is disallowed")
if (0 == HDstrlen(name))
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "zero-length VOL plugin name is disallowed")
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "zero-length VOL connector name is disallowed")
op_data.found_id = H5I_INVALID_HID;
op_data.name = name;
/* Check if plugin is already registered */
if (H5I_iterate(H5I_VOL, H5VL__get_plugin_cb, &op_data, TRUE) < 0)
/* Check if connector is already registered */
if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0)
HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL ids")
/* If plugin alread registered, increment ref count on ID and return ID */
/* If connector alread registered, increment ref count on ID and return ID */
if (op_data.found_id != H5I_INVALID_HID) {
if (H5I_inc_ref(op_data.found_id, TRUE) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL plugin")
HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector")
ret_value = op_data.found_id;
} /* end if */
else {
H5PL_key_t key;
const H5VL_class_t *cls;
/* Try loading the plugin */
/* Try loading the connector */
key.name = name;
if (NULL == (cls = (const H5VL_class_t *)H5PL_load(H5PL_TYPE_VOL, key)))
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to load VOL plugin")
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to load VOL connector")
/* Register the plugin we loaded */
if ((ret_value = H5VL_register_plugin(cls, TRUE, vipl_id)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL plugin ID")
/* Register the connector we loaded */
if ((ret_value = H5VL_register_connector(cls, TRUE, vipl_id)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector ID")
} /* end else */
done:
FUNC_LEAVE_API(ret_value)
} /* end H5VLregister_plugin_by_name() */
} /* end H5VLregister_connector_by_name() */
/*-------------------------------------------------------------------------
* Function: H5VLis_plugin_registered
* Function: H5VLis_connector_registered
*
* Purpose: Tests whether a VOL class has been registered or not
*
@ -238,9 +238,9 @@ done:
*-------------------------------------------------------------------------
*/
htri_t
H5VLis_plugin_registered(const char *name)
H5VLis_connector_registered(const char *name)
{
H5VL_get_plugin_ud_t op_data; /* Callback info for plugin search */
H5VL_get_connector_ud_t op_data; /* Callback info for connector search */
htri_t ret_value = FALSE; /* Return value */
FUNC_ENTER_API(FAIL)
@ -250,7 +250,7 @@ H5VLis_plugin_registered(const char *name)
op_data.name = name;
/* Check arguments */
if (H5I_iterate(H5I_VOL, H5VL__get_plugin_cb, &op_data, TRUE) < 0)
if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0)
HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "can't iterate over VOL ids")
if (op_data.found_id != H5I_INVALID_HID)
@ -258,13 +258,13 @@ H5VLis_plugin_registered(const char *name)
done:
FUNC_LEAVE_API(ret_value)
} /* end H5VLis_plugin_registered() */
} /* end H5VLis_connector_registered() */
/*-------------------------------------------------------------------------
* Function: H5VLget_plugin_id
* Function: H5VLget_connector_id
*
* Purpose: Retrieves the ID for a registered VOL plugin.
* Purpose: Retrieves the ID for a registered VOL connector.
*
* Return: Positive if the VOL class has been registered
* Negative on error (if the class is not a valid class or not registered)
@ -272,9 +272,9 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
H5VLget_plugin_id(const char *name)
H5VLget_connector_id(const char *name)
{
H5VL_get_plugin_ud_t op_data; /* Callback info for plugin search */
H5VL_get_connector_ud_t op_data; /* Callback info for connector search */
hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
@ -284,55 +284,55 @@ H5VLget_plugin_id(const char *name)
op_data.name = name;
/* Check arguments */
if (H5I_iterate(H5I_VOL, H5VL__get_plugin_cb, &op_data, TRUE) < 0)
HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL plugin IDs")
if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0)
HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL connector IDs")
if (op_data.found_id != H5I_INVALID_HID) {
if (H5I_inc_ref(op_data.found_id, TRUE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL plugin")
HGOTO_ERROR(H5E_FILE, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector")
ret_value = op_data.found_id;
} /* end if */
done:
FUNC_LEAVE_API(ret_value)
} /* end H5VLget_plugin_id() */
} /* end H5VLget_connector_id() */
/*-------------------------------------------------------------------------
* Function: H5VLget_plugin_name
* Function: H5VLget_connector_name
*
* Purpose: Returns the plugin name for the VOL associated with the
* Purpose: Returns the connector name for the VOL associated with the
* object or file ID
*
* Return: Success: The length of the plugin name
* Return: Success: The length of the connector name
*
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
ssize_t
H5VLget_plugin_name(hid_t obj_id, char *name/*out*/, size_t size)
H5VLget_connector_name(hid_t obj_id, char *name/*out*/, size_t size)
{
ssize_t ret_value = -1;
FUNC_ENTER_API(FAIL)
H5TRACE3("Zs", "ixz", obj_id, name, size);
if ((ret_value = H5VL_get_plugin_name(obj_id, name, size)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "Can't get plugin name")
if ((ret_value = H5VL_get_connector_name(obj_id, name, size)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "Can't get connector name")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5VLget_plugin_name() */
} /* end H5VLget_connector_name() */
/*-------------------------------------------------------------------------
* Function: H5VLclose
*
* Purpose: Closes a VOL plugin ID. This in no way affects
* Purpose: Closes a VOL connector ID. This in no way affects
* file access property lists which have been defined to use
* this VOL plugin or files which are already opened under with
* this plugin.
* this VOL connector or files which are already opened under with
* this connector.
*
* Return: Success: Non-negative
* Failure: Negative
@ -349,11 +349,11 @@ H5VLclose(hid_t vol_id)
/* Check args */
if(NULL == H5I_object_verify(vol_id, H5I_VOL))
HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a VOL plugin")
HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a VOL connector")
/* Decrement the ref count on the ID, possibly releasing the VOL plugin */
/* Decrement the ref count on the ID, possibly releasing the VOL connector */
if(H5I_dec_app_ref(vol_id) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to close VOL plugin ID")
HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to close VOL connector ID")
done:
FUNC_LEAVE_API(ret_value)
@ -361,12 +361,12 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VLunregister_plugin
* Function: H5VLunregister_connector
*
* Purpose: Removes a VOL plugin ID from the library. This in no way affects
* Purpose: Removes a VOL connector ID from the library. This in no way affects
* file access property lists which have been defined to use
* this VOL plugin or files which are already opened under with
* this plugin.
* this VOL connector or files which are already opened under with
* this connector.
*
* Return: Success: Non-negative
*
@ -375,7 +375,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5VLunregister_plugin(hid_t vol_id)
H5VLunregister_connector(hid_t vol_id)
{
herr_t ret_value = SUCCEED; /* Return value */
@ -384,25 +384,25 @@ H5VLunregister_plugin(hid_t vol_id)
/* Check arguments */
if(NULL == H5I_object_verify(vol_id, H5I_VOL))
HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a VOL plugin")
HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a VOL connector")
/* The H5VL_class_t struct will be freed by this function */
if (H5I_dec_app_ref(vol_id) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to unregister VOL plugin")
HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to unregister VOL connector")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5VLunregister_plugin() */
} /* end H5VLunregister_connector() */
/*---------------------------------------------------------------------------
* Function: H5VLcmp_plugin_cls
* Function: H5VLcmp_connector_cls
*
* Purpose: Compares two plugin classes
* Purpose: Compares two connector classes
*
* Return: Success: Non-negative, with *cmp set to positive if
* plugin_id1 is greater than plugin_id2, negative if plugin_id2
* is greater than plugin_id1 and zero if plugin_id1 and plugin_id2
* connector_id1 is greater than connector_id2, negative if connector_id2
* is greater than connector_id1 and zero if connector_id1 and connector_id2
* are equal.
*
* Failure: Negative
@ -410,24 +410,24 @@ done:
*---------------------------------------------------------------------------
*/
herr_t
H5VLcmp_plugin_cls(int *cmp, hid_t plugin_id1, hid_t plugin_id2)
H5VLcmp_connector_cls(int *cmp, hid_t connector_id1, hid_t connector_id2)
{
H5VL_class_t *cls1, *cls2; /* Plugins for IDs */
H5VL_class_t *cls1, *cls2; /* connectors for IDs */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "*Isii", cmp, plugin_id1, plugin_id2);
H5TRACE3("e", "*Isii", cmp, connector_id1, connector_id2);
/* Check args and get class pointers */
if(NULL == (cls1 = (H5VL_class_t *)H5I_object_verify(plugin_id1, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL plugin ID")
if(NULL == (cls2 = (H5VL_class_t *)H5I_object_verify(plugin_id2, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL plugin ID")
if(NULL == (cls1 = (H5VL_class_t *)H5I_object_verify(connector_id1, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
if(NULL == (cls2 = (H5VL_class_t *)H5I_object_verify(connector_id2, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Compare the two VOL plugin classes */
*cmp = H5VL_cmp_plugin_cls(cls1, cls2);
/* Compare the two VOL connector classes */
*cmp = H5VL_cmp_connector_cls(cls1, cls2);
done:
FUNC_LEAVE_API(ret_value)
} /* H5VLcmp_plugin_cls() */
} /* H5VLcmp_connector_cls() */

File diff suppressed because it is too large Load Diff

View File

@ -51,8 +51,8 @@
/* Object wrapping context info */
typedef struct H5VL_wrap_ctx_t {
unsigned rc; /* Ref. count for the # of times the context was set / reset */
const H5VL_t *plugin; /* VOL plugin for "outermost" class to start wrap */
void *obj_wrap_ctx; /* "wrap context" for outermost plugin */
const H5VL_t *connector; /* VOL connector for "outermost" class to start wrap */
void *obj_wrap_ctx; /* "wrap context" for outermost connector */
} H5VL_wrap_ctx_t;
@ -67,7 +67,7 @@ typedef struct H5VL_wrap_ctx_t {
static herr_t H5VL__free_cls(H5VL_class_t *cls);
static void *H5VL__wrap_obj(void *obj);
static H5VL_object_t *H5VL__new_vol_obj(H5I_type_t type, void *object,
H5VL_t *vol_plugin, hbool_t wrap_obj);
H5VL_t *vol_connector, hbool_t wrap_obj);
static void *H5VL__object(hid_t id, H5I_type_t obj_type);
@ -185,7 +185,7 @@ H5VL_term_package(void)
n++;
} /* end if */
else {
/* Destroy the VOL plugin ID group */
/* Destroy the VOL connector ID group */
n += (H5I_dec_type_ref(H5I_VOL) > 0);
/* Mark interface as closed */
@ -220,9 +220,9 @@ H5VL__free_cls(H5VL_class_t *cls)
/* Sanity check */
HDassert(cls);
/* Shut down the VOL plugin */
/* Shut down the VOL connector */
if(cls->terminate && cls->terminate() < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "VOL plugin did not terminate cleanly")
HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "VOL connector did not terminate cleanly")
/* Release the class */
H5MM_xfree(cls->name);
@ -236,8 +236,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VL__wrap_obj
*
* Purpose: Wraps a library object with possible VOL plugin wrappers, to
* match the VOL plugin stack for the file.
* Purpose: Wraps a library object with possible VOL connector wrappers, to
* match the VOL connector stack for the file.
*
* Return: Success: Wrapped object pointer
* Failure: NULL
@ -265,7 +265,7 @@ H5VL__wrap_obj(void *obj)
/* If there is a VOL object wrapping context, wrap the object */
if(vol_wrap_ctx) {
/* Wrap object, using the VOL callback */
if(NULL == (ret_value = H5VL_wrap_object(vol_wrap_ctx->plugin->cls, vol_wrap_ctx->obj_wrap_ctx, obj)))
if(NULL == (ret_value = H5VL_wrap_object(vol_wrap_ctx->connector->cls, vol_wrap_ctx->obj_wrap_ctx, obj)))
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't wrap object")
} /* end if */
else
@ -290,7 +290,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5VL_object_t *
H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t wrap_obj)
H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t wrap_obj)
{
H5VL_object_t *new_vol_obj = NULL; /* Pointer to new VOL object */
H5VL_object_t *ret_value = NULL; /* Return value */
@ -299,7 +299,7 @@ H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t wra
/* Check arguments */
HDassert(object);
HDassert(vol_plugin);
HDassert(vol_connector);
/* Make sure type number is valid */
if(type != H5I_ATTR && type != H5I_DATASET && type != H5I_DATATYPE && type != H5I_FILE && type != H5I_GROUP)
@ -308,7 +308,7 @@ H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t wra
/* Create the new VOL object */
if(NULL == (new_vol_obj = H5FL_CALLOC(H5VL_object_t)))
HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate memory for VOL object")
new_vol_obj->plugin = vol_plugin;
new_vol_obj->connector = vol_connector;
if(wrap_obj) {
if(NULL == (new_vol_obj->data = H5VL__wrap_obj(object)))
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "can't wrap library object")
@ -316,8 +316,8 @@ H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t wra
else
new_vol_obj->data = object;
/* Bump the reference count on the VOL plugin */
vol_plugin->nrefs++;
/* Bump the reference count on the VOL connector */
vol_connector->nrefs++;
/* If this is a datatype, we have to hide the VOL object under the H5T_t pointer */
if(H5I_DATATYPE == type) {
@ -345,7 +345,7 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t app_ref)
H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ref)
{
H5VL_object_t *vol_obj = NULL; /* VOL object wrapper for library object */
hid_t ret_value = H5I_INVALID_HID; /* Return value */
@ -354,11 +354,11 @@ H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t app_ref
/* Check arguments */
HDassert(object);
HDassert(vol_plugin);
HDassert(vol_connector);
/* Set up VOL object for the passed-in data */
/* (Does not wrap object, since it's from a VOL callback) */
if(NULL == (vol_obj = H5VL__new_vol_obj(type, object, vol_plugin, FALSE)))
if(NULL == (vol_obj = H5VL__new_vol_obj(type, object, vol_connector, FALSE)))
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create VOL object")
/* Register VOL object as _object_ type, for future object API calls */
@ -389,7 +389,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t app_ref, hid_t existing_id)
H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ref, hid_t existing_id)
{
H5VL_object_t *new_vol_obj = NULL; /* Pointer to new VOL object */
herr_t ret_value = SUCCEED; /* Return value */
@ -398,11 +398,11 @@ H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_plugi
/* Check arguments */
HDassert(object);
HDassert(vol_plugin);
HDassert(vol_connector);
/* Set up VOL object for the passed-in data */
/* (Wraps object, since it's a library object) */
if(NULL == (new_vol_obj = H5VL__new_vol_obj(type, object, vol_plugin, TRUE)))
if(NULL == (new_vol_obj = H5VL__new_vol_obj(type, object, vol_connector, TRUE)))
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create VOL object")
/* Call the underlying H5I function to complete the registration */
@ -418,8 +418,8 @@ done:
* Function: H5VL_register_using_vol_id
*
* Purpose: Utility function to create a user ID for an object created
* or opened through the VOL. Uses the VOL plugin's ID to
* get the plugin information instead of it being passed in.
* or opened through the VOL. Uses the VOL connector's ID to
* get the connector information instead of it being passed in.
*
* Return: Success: A valid HDF5 ID
* Failure: H5I_INVALID_HID
@ -427,28 +427,28 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t plugin_id, hbool_t app_ref)
H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id, hbool_t app_ref)
{
H5VL_class_t *cls = NULL;
H5VL_t *plugin = NULL; /* VOL plugin struct */
H5VL_t *connector = NULL; /* VOL connector struct */
hid_t ret_value = H5I_INVALID_HID;
FUNC_ENTER_NOAPI(FAIL)
/* Get the VOL class object from the plugin's ID */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(plugin_id, H5I_VOL)))
HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "not a VOL plugin ID")
/* Get the VOL class object from the connector's ID */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "not a VOL connector ID")
/* Setup VOL info struct */
if (NULL == (plugin = H5FL_CALLOC(H5VL_t)))
if (NULL == (connector = H5FL_CALLOC(H5VL_t)))
HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, H5I_INVALID_HID, "can't allocate VOL info struct")
plugin->cls = cls;
plugin->id = plugin_id;
if (H5I_inc_ref(plugin->id, FALSE) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL plugin")
connector->cls = cls;
connector->id = connector_id;
if (H5I_inc_ref(connector->id, FALSE) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector")
/* Get an ID for the VOL object */
if ((ret_value = H5VL_register(type, obj, plugin, app_ref)) < 0)
if ((ret_value = H5VL_register(type, obj, connector, app_ref)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle")
done:
@ -460,7 +460,7 @@ done:
* Function: H5VL_free_object
*
* Purpose: Wrapper to unregister an object ID with a VOL aux struct
* and decrement ref count on VOL plugin ID
* and decrement ref count on VOL connector ID
*
* Return: SUCCEED/FAIL
*
@ -476,12 +476,12 @@ H5VL_free_object(H5VL_object_t *vol_obj)
/* Check arguments */
HDassert(vol_obj);
vol_obj->plugin->nrefs --;
vol_obj->connector->nrefs --;
if(0 == vol_obj->plugin->nrefs) {
if(H5I_dec_ref(vol_obj->plugin->id) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL plugin")
vol_obj->plugin = H5FL_FREE(H5VL_t, vol_obj->plugin);
if(0 == vol_obj->connector->nrefs) {
if(H5I_dec_ref(vol_obj->connector->id) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL connector")
vol_obj->connector = H5FL_FREE(H5VL_t, vol_obj->connector);
} /* end if */
vol_obj = H5FL_FREE(H5VL_object_t, vol_obj);
@ -492,20 +492,20 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VL_register_plugin
* Function: H5VL_register_connector
*
* Purpose: Registers a new VOL plugin as a member of the virtual object
* Purpose: Registers a new VOL connector as a member of the virtual object
* layer class.
*
* Return: Success: A VOL plugin ID which is good until the
* library is closed or the plugin is unregistered.
* Return: Success: A VOL connector ID which is good until the
* library is closed or the connector is unregistered.
*
* Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
hid_t
H5VL_register_plugin(const void *_cls, hbool_t app_ref, hid_t vipl_id)
H5VL_register_connector(const void *_cls, hbool_t app_ref, hid_t vipl_id)
{
const H5VL_class_t *cls = (const H5VL_class_t *)_cls;
H5VL_class_t *saved = NULL;
@ -518,18 +518,18 @@ H5VL_register_plugin(const void *_cls, hbool_t app_ref, hid_t vipl_id)
/* Copy the class structure so the caller can reuse or free it */
if (NULL == (saved = H5FL_CALLOC(H5VL_class_t)))
HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, H5I_INVALID_HID, "memory allocation failed for VOL plugin class struct")
HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, H5I_INVALID_HID, "memory allocation failed for VOL connector class struct")
HDmemcpy(saved, cls, sizeof(H5VL_class_t));
if(NULL == (saved->name = H5MM_strdup(cls->name)))
HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, H5I_INVALID_HID, "memory allocation failed for VOL plugin name")
HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, H5I_INVALID_HID, "memory allocation failed for VOL connector name")
/* Initialize the VOL plugin */
/* Initialize the VOL connector */
if(cls->initialize && cls->initialize(vipl_id) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to init VOL plugin")
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to init VOL connector")
/* Create the new class ID */
if ((ret_value = H5I_register(H5I_VOL, saved, app_ref)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL plugin ID")
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector ID")
done:
if (ret_value < 0)
@ -537,21 +537,21 @@ done:
H5FL_FREE(H5VL_class_t, saved);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_register_plugin() */
} /* end H5VL_register_connector() */
/*-------------------------------------------------------------------------
* Function: H5VL_get_plugin_name
* Function: H5VL_get_connector_name
*
* Purpose: Private version of H5VLget_plugin_name
* Purpose: Private version of H5VLget_connector_name
*
* Return: Success: The length of the plugin name
* Return: Success: The length of the connector name
* Failure: Negative
*
*-------------------------------------------------------------------------
*/
ssize_t
H5VL_get_plugin_name(hid_t id, char *name /*out*/, size_t size)
H5VL_get_connector_name(hid_t id, char *name /*out*/, size_t size)
{
H5VL_object_t *vol_obj;
const H5VL_class_t *cls;
@ -564,7 +564,7 @@ H5VL_get_plugin_name(hid_t id, char *name /*out*/, size_t size)
if (NULL == (vol_obj = H5VL_vol_object(id)))
HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "invalid VOL identifier")
cls = vol_obj->plugin->cls;
cls = vol_obj->connector->cls;
len = HDstrlen(cls->name);
if(name) {
@ -578,7 +578,7 @@ H5VL_get_plugin_name(hid_t id, char *name /*out*/, size_t size)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_get_plugin_name() */
} /* end H5VL_get_connector_name() */
/*-------------------------------------------------------------------------
@ -629,7 +629,7 @@ done:
* Function: H5VL_object_data
*
* Purpose: Correctly retrieve the 'data' field for a VOL object (H5VL_object),
* even for nested / stacked VOL plugins.
* even for nested / stacked VOL connectors.
*
* Return: Success: object pointer
* Failure: NULL
@ -643,9 +643,9 @@ H5VL_object_data(const H5VL_object_t *vol_obj)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check for 'get_object' callback in plugin */
if(vol_obj->plugin->cls->get_object)
ret_value = (vol_obj->plugin->cls->get_object)(vol_obj->data);
/* Check for 'get_object' callback in connector */
if(vol_obj->connector->cls->get_object)
ret_value = (vol_obj->connector->cls->get_object)(vol_obj->data);
else
ret_value = vol_obj->data;
@ -780,9 +780,9 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VL_cmp_plugin_cls
* Function: H5VL_cmp_connector_cls
*
* Purpose: Compare VOL class for a plugin
* Purpose: Compare VOL class for a connector
*
* Return: Positive if VALUE1 is greater than VALUE2, negative if
* VALUE2 is greater than VALUE1 and zero if VALUE1 and
@ -791,7 +791,7 @@ done:
*-------------------------------------------------------------------------
*/
int
H5VL_cmp_plugin_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls2)
H5VL_cmp_connector_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls2)
{
int cmp_value; /* Value from comparison */
int ret_value = 0; /* Return value */
@ -802,14 +802,14 @@ H5VL_cmp_plugin_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls2)
HDassert(cls1);
HDassert(cls1);
/* Compare plugin "values" */
/* Compare connector "values" */
if(cls1->value < cls2->value)
HGOTO_DONE(-1)
if(cls1->value > cls2->value)
HGOTO_DONE(1)
HDassert(cls1->value == cls2->value);
/* Compare plugin names */
/* Compare connector names */
if(cls1->name == NULL && cls2->name != NULL)
HGOTO_DONE(-1);
if(cls1->name != NULL && cls2->name == NULL)
@ -817,14 +817,14 @@ H5VL_cmp_plugin_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls2)
if(0 != (cmp_value = HDstrcmp(cls1->name, cls2->name)))
HGOTO_DONE(cmp_value);
/* Compare plugin VOL API versions */
/* Compare connector VOL API versions */
if(cls1->version < cls2->version)
HGOTO_DONE(-1)
if(cls1->version > cls2->version)
HGOTO_DONE(1)
HDassert(cls1->version == cls2->version);
/* Compare plugin info */
/* Compare connector info */
if(cls1->info_size < cls2->info_size)
HGOTO_DONE(-1)
if(cls1->info_size > cls2->info_size)
@ -833,30 +833,30 @@ H5VL_cmp_plugin_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls2)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_cmp_plugin_cls() */
} /* end H5VL_cmp_connector_cls() */
/*-------------------------------------------------------------------------
* Function: H5VL_set_vol_wrapper
*
* Purpose: Set up object wrapping context for current VOL plugin
* Purpose: Set up object wrapping context for current VOL connector
*
* Return: SUCCEED / FAIL
*
*-------------------------------------------------------------------------
*/
herr_t
H5VL_set_vol_wrapper(void *obj, const H5VL_t *plugin)
H5VL_set_vol_wrapper(void *obj, const H5VL_t *connector)
{
H5VL_wrap_ctx_t *vol_wrap_ctx = NULL; /* Object wrapping context */
void *obj_wrap_ctx = NULL; /* VOL plugin's wrapping context */
void *obj_wrap_ctx = NULL; /* VOL connector's wrapping context */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(obj);
HDassert(plugin);
HDassert(connector);
/* Retrieve the VOL object wrap context */
if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0)
@ -864,14 +864,14 @@ H5VL_set_vol_wrapper(void *obj, const H5VL_t *plugin)
/* Check for existing wrapping context */
if(NULL == vol_wrap_ctx) {
/* Check if the plugin can create a wrap context */
if(plugin->cls->get_wrap_ctx) {
/* Check if the connector can create a wrap context */
if(connector->cls->get_wrap_ctx) {
/* Sanity check */
HDassert(plugin->cls->free_wrap_ctx);
HDassert(connector->cls->free_wrap_ctx);
/* Get the wrap context from the plugin */
if((plugin->cls->get_wrap_ctx)(obj, &obj_wrap_ctx) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't retrieve VOL plugin's object wrap context")
/* Get the wrap context from the connector */
if((connector->cls->get_wrap_ctx)(obj, &obj_wrap_ctx) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't retrieve VOL connector's object wrap context")
} /* end if */
/* Allocate VOL object wrapper context */
@ -880,7 +880,7 @@ H5VL_set_vol_wrapper(void *obj, const H5VL_t *plugin)
/* Set up VOL object wrapper context */
vol_wrap_ctx->rc = 1;;
vol_wrap_ctx->plugin = plugin;
vol_wrap_ctx->connector = connector;
vol_wrap_ctx->obj_wrap_ctx = obj_wrap_ctx;
} /* end if */
else
@ -903,7 +903,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VL_reset_vol_wrapper
*
* Purpose: Reset object wrapping context for current VOL plugin
* Purpose: Reset object wrapping context for current VOL connector
*
* Return: SUCCEED / FAIL
*
@ -930,11 +930,11 @@ H5VL_reset_vol_wrapper(void)
/* Release context if the ref count drops to zero */
if(0 == vol_wrap_ctx->rc) {
/* If there is a VOL plugin object wrapping context, release it */
/* If there is a VOL connector object wrapping context, release it */
if(vol_wrap_ctx->obj_wrap_ctx) {
/* Release the VOL plugin's object wrapping context */
if((*vol_wrap_ctx->plugin->cls->free_wrap_ctx)(vol_wrap_ctx->obj_wrap_ctx) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release plugin's object wrapping context")
/* Release the VOL connector's object wrapping context */
if((*vol_wrap_ctx->connector->cls->free_wrap_ctx)(vol_wrap_ctx->obj_wrap_ctx) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release connector's object wrapping context")
} /* end if */
/* Release object wrapping context */
@ -983,18 +983,18 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref)
if(TRUE == H5T_already_vol_managed((const H5T_t *)obj))
HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype")
/* Wrap the object with VOL plugin info */
/* Wrap the object with VOL connector info */
if(NULL == (new_obj = H5VL__wrap_obj(obj)))
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't wrap library object")
/* Retrieve the VOL object wrapping context */
if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context")
if(NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->plugin)
HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, "VOL object wrap context or its plugin is NULL???")
if(NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector)
HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, "VOL object wrap context or its connector is NULL???")
/* Get an ID for the object */
if((ret_value = H5VL_register_using_vol_id(type, new_obj, vol_wrap_ctx->plugin->id, app_ref)) < 0)
if((ret_value = H5VL_register_using_vol_id(type, new_obj, vol_wrap_ctx->connector->id, app_ref)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get an ID for the object")
done:

View File

@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Purpose: The native VOL plugin where access is to a single HDF5 file
* Purpose: The native VOL connector where access is to a single HDF5 file
* using HDF5 VFDs.
*/
@ -40,11 +40,11 @@
#include "H5Rpkg.h" /* References */
#include "H5SMprivate.h" /* Shared Object Header Messages */
#include "H5Tpkg.h" /* Datatypes */
#include "H5VLprivate.h" /* VOL drivers */
#include "H5VLnative_private.h" /* Native VOL plugin */
#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VLnative_private.h" /* Native VOL connector */
/*
* The VOL plugin identification number.
* The VOL connector identification number.
*/
static hid_t H5VL_NATIVE_ID_g = H5I_INVALID_HID;
@ -117,7 +117,7 @@ static herr_t H5VL__native_datatype_get(void *dt, H5VL_datatype_get_t get_type,
static herr_t H5VL__native_datatype_specific(void *dt, H5VL_datatype_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
static herr_t H5VL__native_datatype_close(void *dt, hid_t dxpl_id, void **req);
/* Native VOL plugin class struct */
/* Native VOL connector class struct */
static H5VL_class_t H5VL_native_cls_g = {
H5VL_NATIVE_VERSION, /* version */
H5VL_NATIVE_VALUE, /* value */
@ -206,10 +206,10 @@ static H5VL_class_t H5VL_native_cls_g = {
/*-------------------------------------------------------------------------
* Function: H5VL_native_init
*
* Purpose: Initialize this VOL plugin by registering it with the
* Purpose: Initialize this VOL connector by registering it with the
* library.
*
* Return: Success: The ID for the native plugin
* Return: Success: The ID for the native connector
* Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
@ -221,10 +221,10 @@ H5VL_native_init(hid_t vipl_id)
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
/* Register the native VOL plugin, if it isn't already */
/* Register the native VOL connector, if it isn't already */
if(NULL == H5I_object_verify(H5VL_NATIVE_ID_g, H5I_VOL))
if((H5VL_NATIVE_ID_g = H5VL_register_plugin((const H5VL_class_t *)&H5VL_native_cls_g, TRUE, vipl_id)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, H5I_INVALID_HID, "can't create ID for native VOL plugin")
if((H5VL_NATIVE_ID_g = H5VL_register_connector((const H5VL_class_t *)&H5VL_native_cls_g, TRUE, vipl_id)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, H5I_INVALID_HID, "can't create ID for native VOL connector")
/* Set return value */
ret_value = H5VL_NATIVE_ID_g;
@ -259,7 +259,7 @@ H5VL__native_term(void)
* Function: H5Pset_fapl_native
*
* Purpose: Modify the file access property list to use the H5VL_NATIVE
* plugin defined in this source file.
* connector defined in this source file.
*
* Return: SUCCEED/FAIL
*
@ -288,7 +288,7 @@ done:
* Function: H5VL__native_get_file
*
* Purpose: Utility routine to get file struct for an object via the
* native VOL plugin.
* native VOL connector.
*
* Returns: SUCCESS: A pointer to the H5F_t struct for the file
* associated with the object.
@ -414,7 +414,7 @@ H5VL__native_attr_create(void *obj, H5VL_loc_params_t loc_params, const char *at
if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype")
/* If this is a named datatype, get the plugin's pointer to the datatype */
/* If this is a named datatype, get the connector's pointer to the datatype */
type = H5T_get_actual_type(dt);
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
@ -1275,7 +1275,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VL__native_dataset_optional
*
* Purpose: Perform a plugin-specific operation on a native dataset
* Purpose: Perform a connector-specific operation on a native dataset
*
* Return: SUCCEED/FAIL
*
@ -1741,7 +1741,7 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type,
void **ret = va_arg(arguments, void **);
H5F_t *new_file = NULL;
/* Reopen the file through the VOL plugin */
/* Reopen the file through the VOL connector */
if(NULL == (new_file = H5F__reopen((H5F_t *)obj)))
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file")
new_file->id_exists = TRUE;
@ -1810,7 +1810,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VL__native_file_optional
*
* Purpose: Perform a plugin-specific operation on a native file
* Purpose: Perform a connector-specific operation on a native file
*
* Return: SUCCEED/FAIL
*
@ -3116,7 +3116,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VL__native_object_specific
*
* Purpose: Perform a plugin-specific operation for an objectibute
* Purpose: Perform a connector-specific operation for an objectibute
*
* Return: SUCCEED/FAIL
*
@ -3239,7 +3239,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VL__native_object_optional
*
* Purpose: Perform a plugin-specific operation for an objectibute
* Purpose: Perform a connector-specific operation for an objectibute
*
* Return: Success: 0
* Failure: -1

View File

@ -11,13 +11,13 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Purpose: The public header file for the native VOL driver.
* Purpose: The public header file for the native VOL connector.
*/
#ifndef _H5VLnative_H
#define _H5VLnative_H
/* Characteristics of the native VOL driver */
/* Characteristics of the native VOL connector */
#define H5VL_NATIVE_NAME "native"
#define H5VL_NATIVE_VALUE H5_VOL_NATIVE /* enum value */
#define H5VL_NATIVE_VERSION 0

View File

@ -11,16 +11,16 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Purpose: The private header file for the native VOL driver.
* Purpose: The private header file for the native VOL connector.
*/
#ifndef _H5VLnative_private_H
#define _H5VLnative_private_H
/* Include driver's public header */
/* Include connector's public header */
#include "H5VLnative.h"
/* Initializer function for native VOL driver */
/* Initializer function for native VOL connector */
#define H5VL_NATIVE (H5VL_native_init(H5P_DEFAULT))

View File

@ -26,24 +26,24 @@
/* Library Private Typedefs */
/****************************/
/* Internal struct to track VOL plugin information for objects */
/* Internal struct to track VOL connector information for objects */
typedef struct H5VL_t {
const H5VL_class_t *cls; /* Pointer to plugin class struct */
const H5VL_class_t *cls; /* Pointer to connector class struct */
int64_t nrefs; /* Number of references by objects using this struct */
hid_t id; /* Identifier for the VOL plugin */
hid_t id; /* Identifier for the VOL connector */
} H5VL_t;
/* Internal vol object structure returned to the API */
typedef struct H5VL_object_t {
void *data; /* Pointer to plugin-managed data for this object */
H5VL_t *plugin; /* Pointer to VOL plugin struct */
void *data; /* Pointer to connector-managed data for this object */
H5VL_t *connector; /* Pointer to VOL connector struct */
} H5VL_object_t;
/* Internal structure to hold the plugin ID & info for FAPLs */
typedef struct H5VL_plugin_prop_t {
hid_t plugin_id; /* VOL plugin's ID */
const void *plugin_info; /* VOL plugin info, for open callbacks */
} H5VL_plugin_prop_t;
/* Internal structure to hold the connector ID & info for FAPLs */
typedef struct H5VL_connector_prop_t {
hid_t connector_id; /* VOL connector's ID */
const void *connector_info; /* VOL connector info, for open callbacks */
} H5VL_connector_prop_t;
/*****************************/
/* Library Private Variables */
@ -55,16 +55,16 @@ typedef struct H5VL_plugin_prop_t {
/* Utility functions */
H5_DLL herr_t H5VL_init(void);
H5_DLL int H5VL_cmp_plugin_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls);
H5_DLL int H5VL_copy_plugin_info(const H5VL_class_t *plugin, void **dst_info,
H5_DLL int H5VL_cmp_connector_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls);
H5_DLL int H5VL_copy_connector_info(const H5VL_class_t *connector, void **dst_info,
const void *src_info);
H5_DLL int H5VL_cmp_plugin_info(const H5VL_class_t *plugin, const void *info1,
H5_DLL int H5VL_cmp_connector_info(const H5VL_class_t *connector, const void *info1,
const void *info2);
H5_DLL herr_t H5VL_free_plugin_info(const H5VL_class_t *plugin, void *info);
H5_DLL herr_t H5VL_free_connector_info(const H5VL_class_t *connector, void *info);
/* Functions that deal with VOL plugins */
H5_DLL hid_t H5VL_register_plugin(const void *cls, hbool_t app_ref, hid_t vipl_id);
H5_DLL ssize_t H5VL_get_plugin_name(hid_t id, char *name/*out*/, size_t size);
/* Functions that deal with VOL connectors */
H5_DLL hid_t H5VL_register_connector(const void *cls, hbool_t app_ref, hid_t vipl_id);
H5_DLL ssize_t H5VL_get_connector_name(hid_t id, char *name/*out*/, size_t size);
/* NOTE: The object and ID functions below deal in VOL objects (i.e.;
* H5VL_object_t). Similar non-VOL calls exist in H5Iprivate.h. Use
@ -84,22 +84,22 @@ H5_DLL H5VL_object_t *H5VL_vol_object(hid_t id);
H5_DLL herr_t H5VL_free_object(H5VL_object_t *obj);
/* Functions that wrap / unwrap VOL objects */
H5_DLL herr_t H5VL_get_wrap_ctx(const H5VL_class_t *plugin, void *obj,
H5_DLL herr_t H5VL_get_wrap_ctx(const H5VL_class_t *connector, void *obj,
void **wrap_ctx);
H5_DLL herr_t H5VL_free_wrap_ctx(const H5VL_class_t *plugin, void *wrap_ctx);
H5_DLL herr_t H5VL_set_vol_wrapper(void *obj, const H5VL_t *vol_plugin);
H5_DLL herr_t H5VL_free_wrap_ctx(const H5VL_class_t *connector, void *wrap_ctx);
H5_DLL herr_t H5VL_set_vol_wrapper(void *obj, const H5VL_t *vol_connector);
H5_DLL herr_t H5VL_reset_vol_wrapper(void);
H5_DLL void * H5VL_wrap_object(const H5VL_class_t *plugin, void *wrap_ctx,
H5_DLL void * H5VL_wrap_object(const H5VL_class_t *connector, void *wrap_ctx,
void *obj);
/* ID registration functions */
H5_DLL hid_t H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_plugin, hbool_t app_ref);
H5_DLL hid_t H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ref);
H5_DLL hid_t H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref);
H5_DLL hid_t H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t driver_id, hbool_t app_ref);
H5_DLL herr_t H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_driver, hbool_t app_ref, hid_t existing_id);
H5_DLL hid_t H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id, hbool_t app_ref);
H5_DLL herr_t H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ref, hid_t existing_id);
/******************************
* VOL plugin callback wrappers
* VOL connector callback wrappers
*****************************/
/* Attribute functions */

View File

@ -52,7 +52,7 @@
/* Group creation property names */
#define H5VL_PROP_GRP_LCPL_ID "group_lcpl_id"
/* Default VOL plugin value */
/* Default VOL connector value */
#define H5VL_VOL_DEFAULT 0
@ -345,47 +345,47 @@ typedef struct H5VL_request_class_t {
} H5VL_request_class_t;
/* enum value to identify the class of a VOL plugin (mostly for comparison purposes) */
/* enum value to identify the class of a VOL connector (mostly for comparison purposes) */
typedef enum H5VL_class_value_t {
H5_VOL_NATIVE = 0, /* This should be first */
H5_VOL_MAX_LIB_VALUE = 128 /* This should be last */
} H5VL_class_value_t;
/* Capability flags for plugins */
#define H5VL_CAP_FLAG_NONE 0 /* No special plugin capabilities */
#define H5VL_CAP_FLAG_THREADSAFE 0x01 /* Plugin is threadsafe */
/* Capability flags for connector */
#define H5VL_CAP_FLAG_NONE 0 /* No special connector capabilities */
#define H5VL_CAP_FLAG_THREADSAFE 0x01 /* Connector is threadsafe */
/* Class information for each VOL plugin */
/* Class information for each VOL connector */
/* XXX: We should consider adding a UUID/GUID field to this struct
* as well as a H5VLregister_by_uuid() API call for people who
* really care about getting a particular VOL plugin.
* really care about getting a particular VOL connector.
* XXX: We should also consider adding enough information so that
* files can be opened without specifying the VOL plugin.
* files can be opened without specifying the VOL connector.
* e.g.: If we stored a UUID and version, we could search for
* a matching VOL plugin so a user did not have to make any
* a matching VOL connector so a user did not have to make any
* H5VL calls.
*/
typedef struct H5VL_class_t {
/* XXX: How do we identify unique VOL plugin?
/* XXX: How do we identify unique VOL connector?
* This is unclear, but for now we'll keep
* all the ID fields from the original VOL
* branch.
*/
unsigned int version; /* VOL plugin API version # */
H5VL_class_value_t value; /* value to identify plugin */
const char *name; /* Plugin name (MUST be unique!) */
unsigned cap_flags; /* capability flags for plugin */
herr_t (*initialize)(hid_t vipl_id); /* Plugin initialization callback */
herr_t (*terminate)(void); /* Plugin termination callback */
unsigned int version; /* VOL connector API version # */
H5VL_class_value_t value; /* value to identify connector */
const char *name; /* connector name (MUST be unique!) */
unsigned cap_flags; /* capability flags for connector */
herr_t (*initialize)(hid_t vipl_id); /* Connector initialization callback */
herr_t (*terminate)(void); /* Connector termination callback */
size_t info_size; /* size of the vol info */
void * (*info_copy)(const void *info); /* callback to create a copy of the vol info */
int (*info_cmp)(const void *info1, const void *info2); /* callback to compare vol info */
herr_t (*info_free)(void *info); /* callback to release the vol info copy */
void * (*get_object)(const void *obj); /* callback to retrieve underlying object */
herr_t (*get_wrap_ctx)(const void *obj, void **wrap_ctx); /* callback to retrieve the object wrapping context for the plugin */
herr_t (*free_wrap_ctx)(void *wrap_ctx); /* callback to release the object wrapping context for the plugin */
herr_t (*get_wrap_ctx)(const void *obj, void **wrap_ctx); /* callback to retrieve the object wrapping context for the connector */
herr_t (*free_wrap_ctx)(void *wrap_ctx); /* callback to release the object wrapping context for the connector */
void* (*wrap_object)(void *obj, void *wrap_ctx); /* callback to wrap an object */
/* Data Model */
@ -417,109 +417,109 @@ typedef struct H5VL_class_t {
extern "C" {
#endif
/* VOL Plugin Functionality */
H5_DLL hid_t H5VLregister_plugin(const H5VL_class_t *cls, hid_t vipl_id);
H5_DLL hid_t H5VLregister_plugin_by_name(const char *plugin_name, hid_t vipl_id);
H5_DLL htri_t H5VLis_plugin_registered(const char *name);
H5_DLL hid_t H5VLget_plugin_id(const char *name);
H5_DLL ssize_t H5VLget_plugin_name(hid_t id, char *name/*out*/, size_t size);
H5_DLL herr_t H5VLclose(hid_t plugin_id);
H5_DLL herr_t H5VLunregister_plugin(hid_t plugin_id);
/* VOL Connector Functionality */
H5_DLL hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id);
H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vipl_id);
H5_DLL htri_t H5VLis_connector_registered(const char *name);
H5_DLL hid_t H5VLget_connector_id(const char *name);
H5_DLL ssize_t H5VLget_connector_name(hid_t id, char *name/*out*/, size_t size);
H5_DLL herr_t H5VLclose(hid_t connector_id);
H5_DLL herr_t H5VLunregister_connector(hid_t connector_id);
/*****************************************************************************
* VOL callback wrappers and helper routines, for _VOL_plugin_ authors only! *
* VOL callback wrappers and helper routines, for _VOL_connector_ authors only! *
* (Not part of the public API for _application_ developers) *
*****************************************************************************/
/* Helper routines for VOL plugin authors */
H5_DLL herr_t H5VLcmp_plugin_cls(int *cmp, hid_t plugin_id1, hid_t plugin_id2);
/* Helper routines for VOL connector authors */
H5_DLL herr_t H5VLcmp_connector_cls(int *cmp, hid_t connector_id1, hid_t connector_id2);
/* Public wrappers for generic callbacks */
H5_DLL herr_t H5VLinitialize(hid_t plugin_id, hid_t vipl_id);
H5_DLL herr_t H5VLterminate(hid_t plugin_id);
H5_DLL herr_t H5VLget_cap_flags(hid_t plugin_id, unsigned *cap_flags);
H5_DLL herr_t H5VLcopy_plugin_info(hid_t plugin_id, void **dst_vol_info, void *src_vol_info);
H5_DLL herr_t H5VLcmp_plugin_info(int *cmp, hid_t plugin_id, const void *info1,
H5_DLL herr_t H5VLinitialize(hid_t connector_id, hid_t vipl_id);
H5_DLL herr_t H5VLterminate(hid_t connector_id);
H5_DLL herr_t H5VLget_cap_flags(hid_t connector_id, unsigned *cap_flags);
H5_DLL herr_t H5VLcopy_connector_info(hid_t connector_id, void **dst_vol_info, void *src_vol_info);
H5_DLL herr_t H5VLcmp_connector_info(int *cmp, hid_t connector_id, const void *info1,
const void *info2);
H5_DLL herr_t H5VLfree_plugin_info(hid_t plugin_id, void *vol_info);
H5_DLL void *H5VLget_object(void *obj, hid_t plugin_id);
H5_DLL herr_t H5VLget_wrap_ctx(void *obj, hid_t plugin_id, void **wrap_ctx);
H5_DLL herr_t H5VLfree_wrap_ctx(void *wrap_ctx, hid_t plugin_id);
H5_DLL void *H5VLwrap_object(void *obj, hid_t plugin_id, void *wrap_ctx);
H5_DLL herr_t H5VLfree_connector_info(hid_t connector_id, void *vol_info);
H5_DLL void *H5VLget_object(void *obj, hid_t connector_id);
H5_DLL herr_t H5VLget_wrap_ctx(void *obj, hid_t connector_id, void **wrap_ctx);
H5_DLL herr_t H5VLfree_wrap_ctx(void *wrap_ctx, hid_t connector_id);
H5_DLL void *H5VLwrap_object(void *obj, hid_t connector_id, void *wrap_ctx);
/* Public wrappers for attribute callbacks */
H5_DLL void *H5VLattr_create(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, const char *attr_name, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLattr_open(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, const char *name, hid_t aapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLattr_read(void *attr, hid_t plugin_id, hid_t dtype_id, void *buf, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLattr_write(void *attr, hid_t plugin_id, hid_t dtype_id, const void *buf, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLattr_get(void *obj, hid_t plugin_id, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLattr_specific(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLattr_optional(void *obj, hid_t plugin_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLattr_close(void *attr, hid_t plugin_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLattr_create(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, const char *attr_name, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLattr_open(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, const char *name, hid_t aapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLattr_read(void *attr, hid_t connector_id, hid_t dtype_id, void *buf, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLattr_write(void *attr, hid_t connector_id, hid_t dtype_id, const void *buf, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLattr_get(void *obj, hid_t connector_id, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLattr_specific(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLattr_optional(void *obj, hid_t connector_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLattr_close(void *attr, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for dataset callbacks */
H5_DLL void *H5VLdataset_create(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, const char *name, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLdataset_open(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, const char *name, hid_t dapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLdataset_read(void *dset, hid_t plugin_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf, void **req);
H5_DLL herr_t H5VLdataset_write(void *dset, hid_t plugin_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf, void **req);
H5_DLL herr_t H5VLdataset_get(void *dset, hid_t plugin_id, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdataset_specific(void *obj, hid_t plugin_id, H5VL_dataset_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdataset_optional(void *obj, hid_t plugin_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdataset_close(void *dset, hid_t plugin_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLdataset_create(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, const char *name, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLdataset_open(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, const char *name, hid_t dapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLdataset_read(void *dset, hid_t connector_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf, void **req);
H5_DLL herr_t H5VLdataset_write(void *dset, hid_t connector_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf, void **req);
H5_DLL herr_t H5VLdataset_get(void *dset, hid_t connector_id, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdataset_specific(void *obj, hid_t connector_id, H5VL_dataset_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdataset_optional(void *obj, hid_t connector_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdataset_close(void *dset, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for file callbacks */
H5_DLL void *H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLfile_get(void *file, hid_t plugin_id, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLfile_specific(void *obj, hid_t plugin_id, H5VL_file_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLfile_optional(void *obj, hid_t plugin_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLfile_close(void *file, hid_t plugin_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLfile_get(void *file, hid_t connector_id, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLfile_specific(void *obj, hid_t connector_id, H5VL_file_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLfile_optional(void *obj, hid_t connector_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLfile_close(void *file, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for group callbacks */
H5_DLL void *H5VLgroup_create(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, const char *name, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLgroup_open(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, const char *name, hid_t gapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLgroup_get(void *obj, hid_t plugin_id, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLgroup_specific(void *obj, hid_t plugin_id, H5VL_group_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLgroup_optional(void *obj, hid_t plugin_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLgroup_close(void *grp, hid_t plugin_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLgroup_create(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, const char *name, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLgroup_open(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, const char *name, hid_t gapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLgroup_specific(void *obj, hid_t connector_id, H5VL_group_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLgroup_optional(void *obj, hid_t connector_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLgroup_close(void *grp, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for link callbacks */
H5_DLL herr_t H5VLlink_create(H5VL_link_create_type_t create_type, void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLlink_create(H5VL_link_create_type_t create_type, void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLlink_copy(void *src_obj, H5VL_loc_params_t loc_params1,
void *dst_obj, H5VL_loc_params_t loc_params2, hid_t plugin_id,
void *dst_obj, H5VL_loc_params_t loc_params2, hid_t connector_id,
hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLlink_move(void *src_obj, H5VL_loc_params_t loc_params1,
void *dst_obj, H5VL_loc_params_t loc_params2, hid_t plugin_id,
void *dst_obj, H5VL_loc_params_t loc_params2, hid_t connector_id,
hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLlink_get(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, H5VL_link_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLlink_specific(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLlink_optional(void *obj, hid_t plugin_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLlink_get(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, H5VL_link_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLlink_specific(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLlink_optional(void *obj, hid_t connector_id, hid_t dxpl_id, void **req, va_list arguments);
/* Public wrappers for object callbacks */
H5_DLL void *H5VLobject_open(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, H5I_type_t *opened_type, hid_t dxpl_id, void **req);
H5_DLL void *H5VLobject_open(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, H5I_type_t *opened_type, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLobject_copy(void *src_obj, H5VL_loc_params_t loc_params1, const char *src_name,
void *dst_obj, H5VL_loc_params_t loc_params2, const char *dst_name,
hid_t plugin_id, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLobject_get(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, H5VL_object_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLobject_specific(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLobject_optional(void *obj, hid_t plugin_id, hid_t dxpl_id, void **req, va_list arguments);
hid_t connector_id, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLobject_get(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, H5VL_object_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLobject_specific(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLobject_optional(void *obj, hid_t connector_id, hid_t dxpl_id, void **req, va_list arguments);
/* Public wrappers for named datatype callbacks */
H5_DLL void *H5VLdatatype_commit(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLdatatype_open(void *obj, H5VL_loc_params_t loc_params, hid_t plugin_id, const char *name, hid_t tapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLdatatype_get(void *dt, hid_t plugin_id, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdatatype_specific(void *obj, hid_t plugin_id, H5VL_datatype_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdatatype_optional(void *obj, hid_t plugin_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdatatype_close(void *dt, hid_t plugin_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLdatatype_commit(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req);
H5_DLL void *H5VLdatatype_open(void *obj, H5VL_loc_params_t loc_params, hid_t connector_id, const char *name, hid_t tapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLdatatype_get(void *dt, hid_t connector_id, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdatatype_specific(void *obj, hid_t connector_id, H5VL_datatype_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdatatype_optional(void *obj, hid_t connector_id, hid_t dxpl_id, void **req, va_list arguments);
H5_DLL herr_t H5VLdatatype_close(void *dt, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for asynchronous request callbacks */
H5_DLL herr_t H5VLrequest_wait(void *req, hid_t plugin_id, uint64_t timeout, H5ES_status_t *status);
H5_DLL herr_t H5VLrequest_cancel(void *req, hid_t plugin_id);
H5_DLL herr_t H5VLrequest_specific(void *req, hid_t plugin_id, H5VL_request_specific_t specific_type, va_list arguments);
H5_DLL herr_t H5VLrequest_optional(void *req, hid_t plugin_id, va_list arguments);
H5_DLL herr_t H5VLrequest_free(void *req, hid_t plugin_id);
H5_DLL herr_t H5VLrequest_wait(void *req, hid_t connector_id, uint64_t timeout, H5ES_status_t *status);
H5_DLL herr_t H5VLrequest_cancel(void *req, hid_t connector_id);
H5_DLL herr_t H5VLrequest_specific(void *req, hid_t connector_id, H5VL_request_specific_t specific_type, va_list arguments);
H5_DLL herr_t H5VLrequest_optional(void *req, hid_t connector_id, va_list arguments);
H5_DLL herr_t H5VLrequest_free(void *req, hid_t connector_id);
#ifdef __cplusplus
}

View File

@ -3481,15 +3481,15 @@ test_misc19(void)
HDfree(vfd_cls);
/* Check H5I operations on virtual object plugins */
/* Check H5I operations on virtual object connectors */
/* Get a VOL class to register */
vol_cls = h5_get_dummy_vol_class();
CHECK(vol_cls, NULL, "h5_get_dummy_vol_class");
/* Register a VOL plugin */
volid = H5VLregister_plugin(vol_cls, H5P_DEFAULT);
CHECK(volid, FAIL, "H5VLregister_plugin");
/* Register a VOL connector */
volid = H5VLregister_connector(vol_cls, H5P_DEFAULT);
CHECK(volid, FAIL, "H5VLregister_connector");
/* Check the reference count */
rc = H5Iget_ref(volid);
@ -3499,23 +3499,23 @@ test_misc19(void)
rc = H5Iinc_ref(volid);
VERIFY(rc, 2, "H5Iinc_ref");
/* Unregister the VOL plugin normally */
ret = H5VLunregister_plugin(volid);
CHECK(ret, FAIL, "H5VLunregister_plugin");
/* Unregister the VOL connector normally */
ret = H5VLunregister_connector(volid);
CHECK(ret, FAIL, "H5VLunregister_connector");
/* Check the reference count */
rc = H5Iget_ref(volid);
VERIFY(rc, 1, "H5Iget_ref");
/* Unregister the VOL plugin by decrementing the reference count */
/* Unregister the VOL connector by decrementing the reference count */
rc = H5Idec_ref(volid);
VERIFY(rc, 0, "H5Idec_ref");
/* Try unregistering the VOL plugin again (should fail) */
/* Try unregistering the VOL connector again (should fail) */
H5E_BEGIN_TRY {
ret = H5VLunregister_plugin(volid);
ret = H5VLunregister_connector(volid);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5VLunregister_plugin");
VERIFY(ret, FAIL, "H5VLunregister_connector");
HDfree(vol_cls);

View File

@ -113,10 +113,12 @@ static const H5VL_class_t fake_vol_g = {
NULL, /* specific */
NULL /* optional */
},
{ /* async_cls */
{ /* request_cls */
NULL, /* wait */
NULL, /* cancel */
NULL, /* test */
NULL /* wait */
NULL, /* specific */
NULL, /* optional */
NULL /* free */
},
NULL /* optional */
};
@ -126,7 +128,7 @@ static const H5VL_class_t fake_vol_g = {
* Function: test_vol_registration()
*
* Purpose: Tests if we can load, register, and close a simple
* VOL plugin.
* VOL connector.
*
* Return: SUCCEED/FAIL
*
@ -140,44 +142,44 @@ test_vol_registration(void)
TESTING("VOL registration");
/* The test/fake VOL plugin should not be registered at the start of the test */
if ((is_registered = H5VLis_plugin_registered(FAKE_VOL_NAME)) < 0)
/* The test/fake VOL connector should not be registered at the start of the test */
if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
FAIL_STACK_ERROR;
if (is_registered > 0)
FAIL_PUTS_ERROR("native VOL plugin is inappropriately registered");
FAIL_PUTS_ERROR("native VOL connector is inappropriately registered");
/* Load a VOL interface */
if ((vol_id = H5VLregister_plugin(&fake_vol_g, H5P_DEFAULT)) < 0)
if ((vol_id = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR;
/* The test/fake VOL plugin should be registered now */
if ((is_registered = H5VLis_plugin_registered(FAKE_VOL_NAME)) < 0)
/* The test/fake VOL connector should be registered now */
if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
FAIL_STACK_ERROR;
if (0 == is_registered)
FAIL_PUTS_ERROR("native VOL plugin is un-registered");
FAIL_PUTS_ERROR("native VOL connector is un-registered");
/* Re-register a VOL plugin */
if ((vol_id2 = H5VLregister_plugin(&fake_vol_g, H5P_DEFAULT)) < 0)
/* Re-register a VOL connector */
if ((vol_id2 = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR;
/* The test/fake VOL plugin should still be registered now */
if ((is_registered = H5VLis_plugin_registered(FAKE_VOL_NAME)) < 0)
/* The test/fake VOL connector should still be registered now */
if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
FAIL_STACK_ERROR;
if (0 == is_registered)
FAIL_PUTS_ERROR("native VOL plugin is un-registered");
FAIL_PUTS_ERROR("native VOL connector is un-registered");
/* Unregister the second test/fake VOL ID */
if (H5VLunregister_plugin(vol_id2) < 0)
if (H5VLunregister_connector(vol_id2) < 0)
FAIL_STACK_ERROR;
/* The test/fake VOL plugin should still be registered now */
if ((is_registered = H5VLis_plugin_registered(FAKE_VOL_NAME)) < 0)
/* The test/fake VOL connector should still be registered now */
if ((is_registered = H5VLis_connector_registered(FAKE_VOL_NAME)) < 0)
FAIL_STACK_ERROR;
if (0 == is_registered)
FAIL_PUTS_ERROR("native VOL plugin is un-registered");
FAIL_PUTS_ERROR("native VOL connector is un-registered");
/* Unregister the original test/fake VOL ID */
if (H5VLunregister_plugin(vol_id) < 0)
if (H5VLunregister_connector(vol_id) < 0)
FAIL_STACK_ERROR;
PASSED();
@ -185,7 +187,7 @@ test_vol_registration(void)
error:
H5E_BEGIN_TRY {
H5VLunregister_plugin(vol_id);
H5VLunregister_connector(vol_id);
} H5E_END_TRY;
return FAIL;
@ -195,7 +197,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_native_vol_init()
*
* Purpose: Tests if the native VOL plugin gets initialized.
* Purpose: Tests if the native VOL connector gets initialized.
*
* Return: SUCCEED/FAIL
*
@ -206,13 +208,13 @@ test_native_vol_init(void)
{
htri_t is_registered;
TESTING("Native VOL plugin initialization");
TESTING("Native VOL connector initialization");
/* The native VOL plugin should always be registered */
if ((is_registered = H5VLis_plugin_registered(H5VL_NATIVE_NAME)) < 0)
/* The native VOL connector should always be registered */
if ((is_registered = H5VLis_connector_registered(H5VL_NATIVE_NAME)) < 0)
FAIL_STACK_ERROR;
if (0 == is_registered)
FAIL_PUTS_ERROR("native VOL plugin is un-registered");
FAIL_PUTS_ERROR("native VOL connector is un-registered");
PASSED();
return SUCCEED;
@ -226,7 +228,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_file_operation()
*
* Purpose: Uses the native VOL plugin to test basic VOL file operations
* Purpose: Uses the native VOL connector to test basic VOL file operations
*
* Return: SUCCEED/FAIL
*
@ -347,7 +349,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_group_operation()
*
* Purpose: Uses the native VOL plugin to test basic VOL group operations
* Purpose: Uses the native VOL connector to test basic VOL group operations
*
* Return: SUCCEED/FAIL
*
@ -438,7 +440,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_dataset_operation()
*
* Purpose: Uses the native VOL plugin to test basic VOL dataset operations
* Purpose: Uses the native VOL connector to test basic VOL dataset operations
*
* Return: SUCCEED/FAIL
*
@ -607,7 +609,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_attribute_operation()
*
* Purpose: Uses the native VOL plugin to test basic VOL attribute operations
* Purpose: Uses the native VOL connector to test basic VOL attribute operations
*
* Return: SUCCEED/FAIL
*
@ -705,7 +707,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_object_operation()
*
* Purpose: Uses the native VOL plugin to test basic VOL object operations
* Purpose: Uses the native VOL connector to test basic VOL object operations
*
* Return: SUCCEED/FAIL
*
@ -769,7 +771,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_link_operation()
*
* Purpose: Uses the native VOL plugin to test basic VOL link operations
* Purpose: Uses the native VOL connector to test basic VOL link operations
*
* Return: SUCCEED/FAIL
*
@ -834,7 +836,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_basic_datatype_operation()
*
* Purpose: Uses the native VOL plugin to test basic VOL datatype operations
* Purpose: Uses the native VOL connector to test basic VOL datatype operations
*
* Return: SUCCEED/FAIL
*
@ -916,7 +918,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_echo_vol_operation()
*
* Purpose: Uses the echo VOL plugin to test basic VOL operations
* Purpose: Uses the echo VOL connector to test basic VOL operations
* via the H5VL public API.
*
* Return: SUCCEED/FAIL