diff options
Diffstat (limited to 'src/H5VLpassthru.c')
-rw-r--r-- | src/H5VLpassthru.c | 684 |
1 files changed, 242 insertions, 442 deletions
diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c index 5ccc082..ede2f5f 100644 --- a/src/H5VLpassthru.c +++ b/src/H5VLpassthru.c @@ -36,7 +36,7 @@ #include <string.h> /* Public HDF5 file */ -#include "hdf5.h" +#include "hdf5dev.h" /* This connector's header */ #include "H5VLpassthru.h" @@ -77,15 +77,6 @@ typedef struct H5VL_pass_through_wrap_ctx_t { /********************* */ /* Helper routines */ -static herr_t H5VL_pass_through_file_specific_reissue(void *obj, hid_t connector_id, - H5VL_file_specific_t specific_type, hid_t dxpl_id, - void **req, ...); -static herr_t H5VL_pass_through_request_specific_reissue(void *obj, hid_t connector_id, - H5VL_request_specific_t specific_type, ...); -static herr_t H5VL_pass_through_link_create_reissue(H5VL_link_create_type_t create_type, void *obj, - const H5VL_loc_params_t *loc_params, hid_t connector_id, - hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req, - ...); static H5VL_pass_through_t *H5VL_pass_through_new_obj(void *under_obj, hid_t under_vol_id); static herr_t H5VL_pass_through_free_obj(H5VL_pass_through_t *obj); @@ -117,13 +108,11 @@ static herr_t H5VL_pass_through_attr_read(void *attr, hid_t mem_type_id, void *b void **req); static herr_t H5VL_pass_through_attr_write(void *attr, hid_t mem_type_id, const void *buf, hid_t dxpl_id, void **req); -static herr_t H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, - va_list arguments); +static herr_t H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req); static herr_t H5VL_pass_through_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, - H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req, - va_list arguments); -static herr_t H5VL_pass_through_attr_optional(void *obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id, - void **req, va_list arguments); + H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req); +static herr_t H5VL_pass_through_attr_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, + void **req); static herr_t H5VL_pass_through_attr_close(void *attr, hid_t dxpl_id, void **req); /* Dataset callbacks */ @@ -137,12 +126,12 @@ static herr_t H5VL_pass_through_dataset_read(void *dset, hid_t mem_type_id, hid_ static herr_t H5VL_pass_through_dataset_write(void *dset, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf, void **req); -static herr_t H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxpl_id, - void **req, va_list arguments); -static herr_t H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, - hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_pass_through_dataset_optional(void *obj, H5VL_dataset_optional_t opt_type, hid_t dxpl_id, - void **req, va_list arguments); +static herr_t H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_args_t *args, hid_t dxpl_id, + void **req); +static herr_t H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_args_t *args, hid_t dxpl_id, + void **req); +static herr_t H5VL_pass_through_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, + void **req); static herr_t H5VL_pass_through_dataset_close(void *dset, hid_t dxpl_id, void **req); /* Datatype callbacks */ @@ -151,12 +140,12 @@ static void *H5VL_pass_through_datatype_commit(void *obj, const H5VL_loc_params_ hid_t tapl_id, hid_t dxpl_id, void **req); static void *H5VL_pass_through_datatype_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t tapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxpl_id, - void **req, va_list arguments); -static herr_t H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, - hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_pass_through_datatype_optional(void *obj, H5VL_datatype_optional_t opt_type, hid_t dxpl_id, - void **req, va_list arguments); +static herr_t H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_args_t *args, hid_t dxpl_id, + void **req); +static herr_t H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_args_t *args, + hid_t dxpl_id, void **req); +static herr_t H5VL_pass_through_datatype_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, + void **req); static herr_t H5VL_pass_through_datatype_close(void *dt, hid_t dxpl_id, void **req); /* File callbacks */ @@ -164,12 +153,11 @@ static void * H5VL_pass_through_file_create(const char *name, unsigned flags, hi hid_t dxpl_id, void **req); static void * H5VL_pass_through_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_pass_through_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, - va_list arguments); -static herr_t H5VL_pass_through_file_specific(void *file, H5VL_file_specific_t specific_type, hid_t dxpl_id, - void **req, va_list arguments); -static herr_t H5VL_pass_through_file_optional(void *file, H5VL_file_optional_t opt_type, hid_t dxpl_id, - void **req, va_list arguments); +static herr_t H5VL_pass_through_file_get(void *file, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req); +static herr_t H5VL_pass_through_file_specific(void *file, H5VL_file_specific_args_t *args, hid_t dxpl_id, + void **req); +static herr_t H5VL_pass_through_file_optional(void *file, H5VL_optional_args_t *args, hid_t dxpl_id, + void **req); static herr_t H5VL_pass_through_file_close(void *file, hid_t dxpl_id, void **req); /* Group callbacks */ @@ -178,18 +166,17 @@ static void * H5VL_pass_through_group_create(void *obj, const H5VL_loc_params_t void **req); static void * H5VL_pass_through_group_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t gapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_pass_through_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, - va_list arguments); -static herr_t H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_t specific_type, hid_t dxpl_id, - void **req, va_list arguments); -static herr_t H5VL_pass_through_group_optional(void *obj, H5VL_group_optional_t opt_type, hid_t dxpl_id, - void **req, va_list arguments); +static herr_t H5VL_pass_through_group_get(void *obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req); +static herr_t H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_args_t *args, hid_t dxpl_id, + void **req); +static herr_t H5VL_pass_through_group_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, + void **req); static herr_t H5VL_pass_through_group_close(void *grp, hid_t dxpl_id, void **req); /* Link callbacks */ -static herr_t H5VL_pass_through_link_create(H5VL_link_create_type_t create_type, void *obj, +static herr_t H5VL_pass_through_link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params, hid_t lcpl_id, hid_t lapl_id, - hid_t dxpl_id, void **req, va_list arguments); + hid_t dxpl_id, void **req); static herr_t H5VL_pass_through_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj, const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req); @@ -197,13 +184,11 @@ static herr_t H5VL_pass_through_link_move(void *src_obj, const H5VL_loc_params_t const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req); static herr_t H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params, - H5VL_link_get_t get_type, hid_t dxpl_id, void **req, - va_list arguments); + H5VL_link_get_args_t *args, hid_t dxpl_id, void **req); static herr_t H5VL_pass_through_link_specific(void *obj, const H5VL_loc_params_t *loc_params, - H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req, - va_list arguments); -static herr_t H5VL_pass_through_link_optional(void *obj, H5VL_link_optional_t opt_type, hid_t dxpl_id, - void **req, va_list arguments); + H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req); +static herr_t H5VL_pass_through_link_optional(void *obj, const H5VL_loc_params_t *loc_params, + H5VL_optional_args_t *args, hid_t dxpl_id, void **req); /* Object callbacks */ static void * H5VL_pass_through_object_open(void *obj, const H5VL_loc_params_t *loc_params, @@ -213,17 +198,16 @@ static herr_t H5VL_pass_through_object_copy(void *src_obj, const H5VL_loc_params const H5VL_loc_params_t *dst_loc_params, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req); static herr_t H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params, - H5VL_object_get_t get_type, hid_t dxpl_id, void **req, - va_list arguments); + H5VL_object_get_args_t *args, hid_t dxpl_id, void **req); static herr_t H5VL_pass_through_object_specific(void *obj, const H5VL_loc_params_t *loc_params, - H5VL_object_specific_t specific_type, hid_t dxpl_id, - void **req, va_list arguments); -static herr_t H5VL_pass_through_object_optional(void *obj, H5VL_object_optional_t opt_type, hid_t dxpl_id, - void **req, va_list arguments); + H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req); +static herr_t H5VL_pass_through_object_optional(void *obj, const H5VL_loc_params_t *loc_params, + H5VL_optional_args_t *args, hid_t dxpl_id, void **req); /* Container/connector introspection callbacks */ static herr_t H5VL_pass_through_introspect_get_conn_cls(void *obj, H5VL_get_conn_lvl_t lvl, const H5VL_class_t **conn_cls); +static herr_t H5VL_pass_through_introspect_get_cap_flags(const void *info, unsigned *cap_flags); static herr_t H5VL_pass_through_introspect_opt_query(void *obj, H5VL_subclass_t cls, int opt_type, uint64_t *flags); @@ -231,19 +215,15 @@ static herr_t H5VL_pass_through_introspect_opt_query(void *obj, H5VL_subclass_t static herr_t H5VL_pass_through_request_wait(void *req, uint64_t timeout, H5VL_request_status_t *status); static herr_t H5VL_pass_through_request_notify(void *obj, H5VL_request_notify_t cb, void *ctx); static herr_t H5VL_pass_through_request_cancel(void *req, H5VL_request_status_t *status); -static herr_t H5VL_pass_through_request_specific(void *req, H5VL_request_specific_t specific_type, - va_list arguments); -static herr_t H5VL_pass_through_request_optional(void *req, H5VL_request_optional_t opt_type, - va_list arguments); +static herr_t H5VL_pass_through_request_specific(void *req, H5VL_request_specific_args_t *args); +static herr_t H5VL_pass_through_request_optional(void *req, H5VL_optional_args_t *args); static herr_t H5VL_pass_through_request_free(void *req); /* Blob callbacks */ static herr_t H5VL_pass_through_blob_put(void *obj, const void *buf, size_t size, void *blob_id, void *ctx); static herr_t H5VL_pass_through_blob_get(void *obj, const void *blob_id, void *buf, size_t size, void *ctx); -static herr_t H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t specific_type, - va_list arguments); -static herr_t H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_blob_optional_t opt_type, - va_list arguments); +static herr_t H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_args_t *args); +static herr_t H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_optional_args_t *args); /* Token callbacks */ static herr_t H5VL_pass_through_token_cmp(void *obj, const H5O_token_t *token1, const H5O_token_t *token2, @@ -254,8 +234,7 @@ static herr_t H5VL_pass_through_token_from_str(void *obj, H5I_type_t obj_type, c H5O_token_t *token); /* Generic optional callback */ -static herr_t H5VL_pass_through_optional(void *obj, int op_type, hid_t dxpl_id, void **req, - va_list arguments); +static herr_t H5VL_pass_through_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req); /*******************/ /* Local variables */ @@ -355,8 +334,9 @@ static const H5VL_class_t H5VL_pass_through_g = { }, { /* introspect_cls */ - H5VL_pass_through_introspect_get_conn_cls, /* get_conn_cls */ - H5VL_pass_through_introspect_opt_query, /* opt_query */ + H5VL_pass_through_introspect_get_conn_cls, /* get_conn_cls */ + H5VL_pass_through_introspect_get_cap_flags, /* get_cap_flags */ + H5VL_pass_through_introspect_opt_query, /* opt_query */ }, { /* request_cls */ @@ -1025,7 +1005,7 @@ H5VL_pass_through_attr_write(void *attr, hid_t mem_type_id, const void *buf, hid *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments) +H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -1034,7 +1014,7 @@ H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, v printf("------- PASS THROUGH VOL ATTRIBUTE Get\n"); #endif - ret_value = H5VLattr_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments); + ret_value = H5VLattr_get(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1055,8 +1035,7 @@ H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, v */ static herr_t H5VL_pass_through_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, - H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req, - va_list arguments) + H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -1065,8 +1044,7 @@ H5VL_pass_through_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, printf("------- PASS THROUGH VOL ATTRIBUTE Specific\n"); #endif - ret_value = H5VLattr_specific(o->under_object, loc_params, o->under_vol_id, specific_type, dxpl_id, req, - arguments); + ret_value = H5VLattr_specific(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1086,8 +1064,7 @@ H5VL_pass_through_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_attr_optional(void *obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_attr_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -1096,7 +1073,7 @@ H5VL_pass_through_attr_optional(void *obj, H5VL_attr_optional_t opt_type, hid_t printf("------- PASS THROUGH VOL ATTRIBUTE Optional\n"); #endif - ret_value = H5VLattr_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments); + ret_value = H5VLattr_optional(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1285,8 +1262,7 @@ H5VL_pass_through_dataset_write(void *dset, hid_t mem_type_id, hid_t mem_space_i *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)dset; herr_t ret_value; @@ -1295,7 +1271,7 @@ H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxp printf("------- PASS THROUGH VOL DATASET Get\n"); #endif - ret_value = H5VLdataset_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments); + ret_value = H5VLdataset_get(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1315,8 +1291,7 @@ H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxp *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, hid_t dxpl_id, - void **req, va_list arguments) +H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; hid_t under_vol_id; @@ -1326,12 +1301,12 @@ H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_t specific_t printf("------- PASS THROUGH VOL H5Dspecific\n"); #endif - // Save copy of underlying VOL connector ID and prov helper, in case of - // refresh destroying the current object + /* Save copy of underlying VOL connector ID, in case of + * 'refresh' operation destroying the current object + */ under_vol_id = o->under_vol_id; - ret_value = - H5VLdataset_specific(o->under_object, o->under_vol_id, specific_type, dxpl_id, req, arguments); + ret_value = H5VLdataset_specific(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1351,8 +1326,7 @@ H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_t specific_t *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_dataset_optional(void *obj, H5VL_dataset_optional_t opt_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -1361,7 +1335,7 @@ H5VL_pass_through_dataset_optional(void *obj, H5VL_dataset_optional_t opt_type, printf("------- PASS THROUGH VOL DATASET Optional\n"); #endif - ret_value = H5VLdataset_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments); + ret_value = H5VLdataset_optional(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1488,8 +1462,7 @@ H5VL_pass_through_datatype_open(void *obj, const H5VL_loc_params_t *loc_params, *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)dt; herr_t ret_value; @@ -1498,7 +1471,7 @@ H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxp printf("------- PASS THROUGH VOL DATATYPE Get\n"); #endif - ret_value = H5VLdatatype_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments); + ret_value = H5VLdatatype_get(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1518,8 +1491,7 @@ H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxp *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, hid_t dxpl_id, - void **req, va_list arguments) +H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; hid_t under_vol_id; @@ -1529,12 +1501,12 @@ H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_t specific printf("------- PASS THROUGH VOL DATATYPE Specific\n"); #endif - // Save copy of underlying VOL connector ID and prov helper, in case of - // refresh destroying the current object + /* Save copy of underlying VOL connector ID, in case of + * 'refresh' operation destroying the current object + */ under_vol_id = o->under_vol_id; - ret_value = - H5VLdatatype_specific(o->under_object, o->under_vol_id, specific_type, dxpl_id, req, arguments); + ret_value = H5VLdatatype_specific(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1554,8 +1526,7 @@ H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_t specific *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_datatype_optional(void *obj, H5VL_datatype_optional_t opt_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_datatype_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -1564,7 +1535,7 @@ H5VL_pass_through_datatype_optional(void *obj, H5VL_datatype_optional_t opt_type printf("------- PASS THROUGH VOL DATATYPE Optional\n"); #endif - ret_value = H5VLdatatype_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments); + ret_value = H5VLdatatype_optional(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1732,7 +1703,7 @@ H5VL_pass_through_file_open(const char *name, unsigned flags, hid_t fapl_id, hid *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, va_list arguments) +H5VL_pass_through_file_get(void *file, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)file; herr_t ret_value; @@ -1741,7 +1712,7 @@ H5VL_pass_through_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, printf("------- PASS THROUGH VOL FILE Get\n"); #endif - ret_value = H5VLfile_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments); + ret_value = H5VLfile_get(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -1751,31 +1722,6 @@ H5VL_pass_through_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, } /* end H5VL_pass_through_file_get() */ /*------------------------------------------------------------------------- - * Function: H5VL_pass_through_file_specific_reissue - * - * Purpose: Re-wrap vararg arguments into a va_list and reissue the - * file specific callback to the underlying VOL connector. - * - * Return: Success: 0 - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5VL_pass_through_file_specific_reissue(void *obj, hid_t connector_id, H5VL_file_specific_t specific_type, - hid_t dxpl_id, void **req, ...) -{ - va_list arguments; - herr_t ret_value; - - va_start(arguments, req); - ret_value = H5VLfile_specific(obj, connector_id, specific_type, dxpl_id, req, arguments); - va_end(arguments); - - return ret_value; -} /* end H5VL_pass_through_file_specific_reissue() */ - -/*------------------------------------------------------------------------- * Function: H5VL_pass_through_file_specific * * Purpose: Specific operation on file @@ -1786,106 +1732,109 @@ H5VL_pass_through_file_specific_reissue(void *obj, hid_t connector_id, H5VL_file *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_file_specific(void *file, H5VL_file_specific_t specific_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_file_specific(void *file, H5VL_file_specific_args_t *args, hid_t dxpl_id, void **req) { - H5VL_pass_through_t *o = (H5VL_pass_through_t *)file; - hid_t under_vol_id = -1; - herr_t ret_value; + H5VL_pass_through_t * o = (H5VL_pass_through_t *)file; + H5VL_pass_through_t * new_o; + H5VL_file_specific_args_t my_args; + H5VL_file_specific_args_t *new_args; + H5VL_pass_through_info_t * info; + hid_t under_vol_id = -1; + herr_t ret_value; #ifdef ENABLE_PASSTHRU_LOGGING printf("------- PASS THROUGH VOL FILE Specific\n"); #endif - /* Unpack arguments to get at the child file pointer when mounting a file */ - if (specific_type == H5VL_FILE_MOUNT) { - H5I_type_t loc_type; - const char * name; - H5VL_pass_through_t *child_file; - hid_t plist_id; - - /* Retrieve parameters for 'mount' operation, so we can unwrap the child file */ - loc_type = (H5I_type_t)va_arg(arguments, int); /* enum work-around */ - name = va_arg(arguments, const char *); - child_file = (H5VL_pass_through_t *)va_arg(arguments, void *); - plist_id = va_arg(arguments, hid_t); - - /* Keep the correct underlying VOL ID for possible async request token */ - under_vol_id = o->under_vol_id; - - /* Re-issue 'file specific' call, using the unwrapped pieces */ - ret_value = H5VL_pass_through_file_specific_reissue(o->under_object, o->under_vol_id, specific_type, - dxpl_id, req, (int)loc_type, name, - child_file->under_object, plist_id); - } /* end if */ - else if (specific_type == H5VL_FILE_IS_ACCESSIBLE || specific_type == H5VL_FILE_DELETE) { - H5VL_pass_through_info_t *info; - hid_t fapl_id, under_fapl_id; - const char * name; - htri_t * ret; - - /* Get the arguments for the 'is accessible' check */ - fapl_id = va_arg(arguments, hid_t); - name = va_arg(arguments, const char *); - ret = va_arg(arguments, htri_t *); + if (args->op_type == H5VL_FILE_IS_ACCESSIBLE) { + /* Shallow copy the args */ + memcpy(&my_args, args, sizeof(my_args)); /* Get copy of our VOL info from FAPL */ - H5Pget_vol_info(fapl_id, (void **)&info); + H5Pget_vol_info(args->args.is_accessible.fapl_id, (void **)&info); /* Make sure we have info about the underlying VOL to be used */ if (!info) return (-1); + /* Keep the correct underlying VOL ID for later */ + under_vol_id = info->under_vol_id; + /* Copy the FAPL */ - under_fapl_id = H5Pcopy(fapl_id); + my_args.args.is_accessible.fapl_id = H5Pcopy(args->args.is_accessible.fapl_id); /* Set the VOL ID and info for the underlying FAPL */ - H5Pset_vol(under_fapl_id, info->under_vol_id, info->under_vol_info); + H5Pset_vol(my_args.args.is_accessible.fapl_id, info->under_vol_id, info->under_vol_info); - /* Keep the correct underlying VOL ID for possible async request token */ + /* Set argument pointer to new arguments */ + new_args = &my_args; + + /* Set object pointer for operation */ + new_o = NULL; + } /* end else-if */ + else if (args->op_type == H5VL_FILE_DELETE) { + /* Shallow copy the args */ + memcpy(&my_args, args, sizeof(my_args)); + + /* Get copy of our VOL info from FAPL */ + H5Pget_vol_info(args->args.del.fapl_id, (void **)&info); + + /* Make sure we have info about the underlying VOL to be used */ + if (!info) + return (-1); + + /* Keep the correct underlying VOL ID for later */ under_vol_id = info->under_vol_id; - /* Re-issue 'file specific' call */ - ret_value = H5VL_pass_through_file_specific_reissue(NULL, info->under_vol_id, specific_type, dxpl_id, - req, under_fapl_id, name, ret); + /* Copy the FAPL */ + my_args.args.del.fapl_id = H5Pcopy(args->args.del.fapl_id); - /* Close underlying FAPL */ - H5Pclose(under_fapl_id); + /* Set the VOL ID and info for the underlying FAPL */ + H5Pset_vol(my_args.args.del.fapl_id, info->under_vol_id, info->under_vol_info); - /* Release copy of our VOL info */ - H5VL_pass_through_info_free(info); + /* Set argument pointer to new arguments */ + new_args = &my_args; + + /* Set object pointer for operation */ + new_o = NULL; } /* end else-if */ else { - va_list my_arguments; - - /* Make a copy of the argument list for later, if reopening */ - if (specific_type == H5VL_FILE_REOPEN) - va_copy(my_arguments, arguments); - - /* Keep the correct underlying VOL ID for possible async request token */ + /* Keep the correct underlying VOL ID for later */ under_vol_id = o->under_vol_id; - ret_value = - H5VLfile_specific(o->under_object, o->under_vol_id, specific_type, dxpl_id, req, arguments); - - /* Wrap file struct pointer, if we reopened one */ - if (specific_type == H5VL_FILE_REOPEN) { - if (ret_value >= 0) { - void **ret = va_arg(my_arguments, void **); + /* Set argument pointer to current arguments */ + new_args = args; - if (ret && *ret) - *ret = H5VL_pass_through_new_obj(*ret, o->under_vol_id); - } /* end if */ + /* Set object pointer for operation */ + new_o = o->under_object; + } /* end else */ - /* Finish use of copied vararg list */ - va_end(my_arguments); - } /* end if */ - } /* end else */ + ret_value = H5VLfile_specific(new_o, under_vol_id, new_args, dxpl_id, req); /* Check for async request */ if (req && *req) *req = H5VL_pass_through_new_obj(*req, under_vol_id); + if (args->op_type == H5VL_FILE_IS_ACCESSIBLE) { + /* Close underlying FAPL */ + H5Pclose(my_args.args.is_accessible.fapl_id); + + /* Release copy of our VOL info */ + H5VL_pass_through_info_free(info); + } /* end else-if */ + else if (args->op_type == H5VL_FILE_DELETE) { + /* Close underlying FAPL */ + H5Pclose(my_args.args.del.fapl_id); + + /* Release copy of our VOL info */ + H5VL_pass_through_info_free(info); + } /* end else-if */ + else if (args->op_type == H5VL_FILE_REOPEN) { + /* Wrap file struct pointer for 'reopen' operation, if we reopened one */ + if (ret_value >= 0 && *args->args.reopen.file) + *args->args.reopen.file = H5VL_pass_through_new_obj(*args->args.reopen.file, under_vol_id); + } /* end else */ + return ret_value; } /* end H5VL_pass_through_file_specific() */ @@ -1900,8 +1849,7 @@ H5VL_pass_through_file_specific(void *file, H5VL_file_specific_t specific_type, *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_file_optional(void *file, H5VL_file_optional_t opt_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_file_optional(void *file, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)file; herr_t ret_value; @@ -1910,7 +1858,7 @@ H5VL_pass_through_file_optional(void *file, H5VL_file_optional_t opt_type, hid_t printf("------- PASS THROUGH VOL File Optional\n"); #endif - ret_value = H5VLfile_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments); + ret_value = H5VLfile_optional(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2036,8 +1984,7 @@ H5VL_pass_through_group_open(void *obj, const H5VL_loc_params_t *loc_params, con *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_group_get(void *obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -2046,7 +1993,7 @@ H5VL_pass_through_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, printf("------- PASS THROUGH VOL GROUP Get\n"); #endif - ret_value = H5VLgroup_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments); + ret_value = H5VLgroup_get(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2066,8 +2013,7 @@ H5VL_pass_through_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_t specific_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; hid_t under_vol_id; @@ -2077,11 +2023,27 @@ H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_t specific_type, printf("------- PASS THROUGH VOL GROUP Specific\n"); #endif - // Save copy of underlying VOL connector ID and prov helper, in case of - // refresh destroying the current object + /* Save copy of underlying VOL connector ID, in case of + * 'refresh' operation destroying the current object + */ under_vol_id = o->under_vol_id; - ret_value = H5VLgroup_specific(o->under_object, o->under_vol_id, specific_type, dxpl_id, req, arguments); + /* Unpack arguments to get at the child file pointer when mounting a file */ + if (args->op_type == H5VL_GROUP_MOUNT) { + H5VL_group_specific_args_t vol_cb_args; /* New group specific arg struct */ + + /* Set up new VOL callback arguments */ + vol_cb_args.op_type = H5VL_GROUP_MOUNT; + vol_cb_args.args.mount.name = args->args.mount.name; + vol_cb_args.args.mount.child_file = + ((H5VL_pass_through_t *)args->args.mount.child_file)->under_object; + vol_cb_args.args.mount.fmpl_id = args->args.mount.fmpl_id; + + /* Re-issue 'group specific' call, using the unwrapped pieces */ + ret_value = H5VLgroup_specific(o->under_object, under_vol_id, &vol_cb_args, dxpl_id, req); + } /* end if */ + else + ret_value = H5VLgroup_specific(o->under_object, under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2101,8 +2063,7 @@ H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_t specific_type, *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_group_optional(void *obj, H5VL_group_optional_t opt_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_group_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -2111,7 +2072,7 @@ H5VL_pass_through_group_optional(void *obj, H5VL_group_optional_t opt_type, hid_ printf("------- PASS THROUGH VOL GROUP Optional\n"); #endif - ret_value = H5VLgroup_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments); + ret_value = H5VLgroup_optional(o->under_object, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2154,33 +2115,6 @@ H5VL_pass_through_group_close(void *grp, hid_t dxpl_id, void **req) } /* end H5VL_pass_through_group_close() */ /*------------------------------------------------------------------------- - * Function: H5VL_pass_through_link_create_reissue - * - * Purpose: Re-wrap vararg arguments into a va_list and reissue the - * link create callback to the underlying VOL connector. - * - * Return: Success: 0 - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5VL_pass_through_link_create_reissue(H5VL_link_create_type_t create_type, void *obj, - const H5VL_loc_params_t *loc_params, hid_t connector_id, hid_t lcpl_id, - hid_t lapl_id, hid_t dxpl_id, void **req, ...) -{ - va_list arguments; - herr_t ret_value; - - va_start(arguments, req); - ret_value = H5VLlink_create(create_type, obj, loc_params, connector_id, lcpl_id, lapl_id, dxpl_id, req, - arguments); - va_end(arguments); - - return ret_value; -} /* end H5VL_pass_through_link_create_reissue() */ - -/*------------------------------------------------------------------------- * Function: H5VL_pass_through_link_create * * Purpose: Creates a hard / soft / UD / external link. @@ -2191,9 +2125,8 @@ H5VL_pass_through_link_create_reissue(H5VL_link_create_type_t create_type, void *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_link_create(H5VL_link_create_type_t create_type, void *obj, - const H5VL_loc_params_t *loc_params, hid_t lcpl_id, hid_t lapl_id, - hid_t dxpl_id, void **req, va_list arguments) +H5VL_pass_through_link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params, + hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; hid_t under_vol_id = -1; @@ -2208,32 +2141,22 @@ H5VL_pass_through_link_create(H5VL_link_create_type_t create_type, void *obj, under_vol_id = o->under_vol_id; /* Fix up the link target object for hard link creation */ - if (H5VL_LINK_CREATE_HARD == create_type) { - void * cur_obj; - H5VL_loc_params_t *cur_params; + if (H5VL_LINK_CREATE_HARD == args->op_type) { + void *cur_obj = args->args.hard.curr_obj; - /* Retrieve the object & loc params for the link target */ - cur_obj = va_arg(arguments, void *); - cur_params = va_arg(arguments, H5VL_loc_params_t *); - - /* If it's a non-NULL pointer, find the 'under object' and re-set the property */ + /* If cur_obj is a non-NULL pointer, find its 'under object' and update the pointer */ if (cur_obj) { - /* Check if we still need the "under" VOL ID */ + /* Check if we still haven't set the "under" VOL ID */ if (under_vol_id < 0) under_vol_id = ((H5VL_pass_through_t *)cur_obj)->under_vol_id; - /* Set the object for the link target */ - cur_obj = ((H5VL_pass_through_t *)cur_obj)->under_object; + /* Update the object for the link target */ + args->args.hard.curr_obj = ((H5VL_pass_through_t *)cur_obj)->under_object; } /* end if */ + } /* end if */ - /* Re-issue 'link create' call, using the unwrapped pieces */ - ret_value = H5VL_pass_through_link_create_reissue(create_type, (o ? o->under_object : NULL), - loc_params, under_vol_id, lcpl_id, lapl_id, dxpl_id, - req, cur_obj, cur_params); - } /* end if */ - else - ret_value = H5VLlink_create(create_type, (o ? o->under_object : NULL), loc_params, under_vol_id, - lcpl_id, lapl_id, dxpl_id, req, arguments); + ret_value = H5VLlink_create(args, (o ? o->under_object : NULL), loc_params, under_vol_id, lcpl_id, + lapl_id, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2347,8 +2270,8 @@ H5VL_pass_through_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type, - hid_t dxpl_id, void **req, va_list arguments) +H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_args_t *args, + hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -2357,7 +2280,7 @@ H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ printf("------- PASS THROUGH VOL LINK Get\n"); #endif - ret_value = H5VLlink_get(o->under_object, loc_params, o->under_vol_id, get_type, dxpl_id, req, arguments); + ret_value = H5VLlink_get(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2378,8 +2301,7 @@ H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ */ static herr_t H5VL_pass_through_link_specific(void *obj, const H5VL_loc_params_t *loc_params, - H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req, - va_list arguments) + H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -2388,8 +2310,7 @@ H5VL_pass_through_link_specific(void *obj, const H5VL_loc_params_t *loc_params, printf("------- PASS THROUGH VOL LINK Specific\n"); #endif - ret_value = H5VLlink_specific(o->under_object, loc_params, o->under_vol_id, specific_type, dxpl_id, req, - arguments); + ret_value = H5VLlink_specific(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2409,8 +2330,8 @@ H5VL_pass_through_link_specific(void *obj, const H5VL_loc_params_t *loc_params, *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_link_optional(void *obj, H5VL_link_optional_t opt_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_link_optional(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args, + hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -2419,7 +2340,7 @@ H5VL_pass_through_link_optional(void *obj, H5VL_link_optional_t opt_type, hid_t printf("------- PASS THROUGH VOL LINK Optional\n"); #endif - ret_value = H5VLlink_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments); + ret_value = H5VLlink_optional(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2509,8 +2430,8 @@ H5VL_pass_through_object_copy(void *src_obj, const H5VL_loc_params_t *src_loc_pa *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type, - hid_t dxpl_id, void **req, va_list arguments) +H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_args_t *args, + hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -2519,8 +2440,7 @@ H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5V printf("------- PASS THROUGH VOL OBJECT Get\n"); #endif - ret_value = - H5VLobject_get(o->under_object, loc_params, o->under_vol_id, get_type, dxpl_id, req, arguments); + ret_value = H5VLobject_get(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2541,8 +2461,7 @@ H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5V */ static herr_t H5VL_pass_through_object_specific(void *obj, const H5VL_loc_params_t *loc_params, - H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req, - va_list arguments) + H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; hid_t under_vol_id; @@ -2552,12 +2471,12 @@ H5VL_pass_through_object_specific(void *obj, const H5VL_loc_params_t *loc_params printf("------- PASS THROUGH VOL OBJECT Specific\n"); #endif - // Save copy of underlying VOL connector ID and prov helper, in case of - // refresh destroying the current object + /* Save copy of underlying VOL connector ID, in case of + * 'refresh' operation destroying the current object + */ under_vol_id = o->under_vol_id; - ret_value = H5VLobject_specific(o->under_object, loc_params, o->under_vol_id, specific_type, dxpl_id, req, - arguments); + ret_value = H5VLobject_specific(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2577,8 +2496,8 @@ H5VL_pass_through_object_specific(void *obj, const H5VL_loc_params_t *loc_params *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_object_optional(void *obj, H5VL_object_optional_t opt_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VL_pass_through_object_optional(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args, + hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -2587,7 +2506,7 @@ H5VL_pass_through_object_optional(void *obj, H5VL_object_optional_t opt_type, hi printf("------- PASS THROUGH VOL OBJECT Optional\n"); #endif - ret_value = H5VLobject_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments); + ret_value = H5VLobject_optional(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req); /* Check for async request */ if (req && *req) @@ -2597,7 +2516,7 @@ H5VL_pass_through_object_optional(void *obj, H5VL_object_optional_t opt_type, hi } /* end H5VL_pass_through_object_optional() */ /*------------------------------------------------------------------------- - * Function: H5VL_pass_through_introspect_get_conn_clss + * Function: H5VL_pass_through_introspect_get_conn_cls * * Purpose: Query the connector class. * @@ -2627,6 +2546,36 @@ H5VL_pass_through_introspect_get_conn_cls(void *obj, H5VL_get_conn_lvl_t lvl, co } /* end H5VL_pass_through_introspect_get_conn_cls() */ /*------------------------------------------------------------------------- + * Function: H5VL_pass_through_introspect_get_cap_flags + * + * Purpose: Query the capability flags for this connector and any + * underlying connector(s). + * + * Return: SUCCEED / FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_pass_through_introspect_get_cap_flags(const void *_info, unsigned *cap_flags) +{ + const H5VL_pass_through_info_t *info = (const H5VL_pass_through_info_t *)_info; + herr_t ret_value; + +#ifdef ENABLE_PASSTHRU_LOGGING + printf("------- PASS THROUGH VOL INTROSPECT GetCapFlags\n"); +#endif + + /* Invoke the query on the underlying VOL connector */ + ret_value = H5VLintrospect_get_cap_flags(info->under_vol_info, info->under_vol_id, cap_flags); + + /* Bitwise OR our capability flags in */ + if (ret_value >= 0) + *cap_flags |= H5VL_pass_through_g.cap_flags; + + return ret_value; +} /* end H5VL_pass_through_introspect_get_cap_flags() */ + +/*------------------------------------------------------------------------- * Function: H5VL_pass_through_introspect_opt_query * * Purpose: Query if an optional operation is supported by this connector @@ -2743,31 +2692,6 @@ H5VL_pass_through_request_cancel(void *obj, H5VL_request_status_t *status) } /* end H5VL_pass_through_request_cancel() */ /*------------------------------------------------------------------------- - * Function: H5VL_pass_through_request_specific_reissue - * - * Purpose: Re-wrap vararg arguments into a va_list and reissue the - * request specific callback to the underlying VOL connector. - * - * Return: Success: 0 - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5VL_pass_through_request_specific_reissue(void *obj, hid_t connector_id, - H5VL_request_specific_t specific_type, ...) -{ - va_list arguments; - herr_t ret_value; - - va_start(arguments, specific_type); - ret_value = H5VLrequest_specific(obj, connector_id, specific_type, arguments); - va_end(arguments); - - return ret_value; -} /* end H5VL_pass_through_request_specific_reissue() */ - -/*------------------------------------------------------------------------- * Function: H5VL_pass_through_request_specific * * Purpose: Specific operation on a request @@ -2778,139 +2702,16 @@ H5VL_pass_through_request_specific_reissue(void *obj, hid_t connector_id, *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_request_specific(void *obj, H5VL_request_specific_t specific_type, va_list arguments) +H5VL_pass_through_request_specific(void *obj, H5VL_request_specific_args_t *args) { - herr_t ret_value = -1; + H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; + herr_t ret_value = -1; #ifdef ENABLE_PASSTHRU_LOGGING printf("------- PASS THROUGH VOL REQUEST Specific\n"); #endif - if (H5VL_REQUEST_WAITANY == specific_type || H5VL_REQUEST_WAITSOME == specific_type || - H5VL_REQUEST_WAITALL == specific_type) { - va_list tmp_arguments; - size_t req_count; - - /* Sanity check */ - assert(obj == NULL); - - /* Get enough info to call the underlying connector */ - va_copy(tmp_arguments, arguments); - req_count = va_arg(tmp_arguments, size_t); - - /* Can only use a request to invoke the underlying VOL connector when there's >0 requests */ - if (req_count > 0) { - void ** req_array; - void ** under_req_array; - uint64_t timeout; - H5VL_pass_through_t *o; - size_t u; /* Local index variable */ - - /* Get the request array */ - req_array = va_arg(tmp_arguments, void **); - - /* Get a request to use for determining the underlying VOL connector */ - o = (H5VL_pass_through_t *)req_array[0]; - - /* Create array of underlying VOL requests */ - under_req_array = (void **)malloc(req_count * sizeof(void **)); - for (u = 0; u < req_count; u++) - under_req_array[u] = ((H5VL_pass_through_t *)req_array[u])->under_object; - - /* Remove the timeout value from the vararg list (it's used in all the calls below) */ - timeout = va_arg(tmp_arguments, uint64_t); - - /* Release requests that have completed */ - if (H5VL_REQUEST_WAITANY == specific_type) { - size_t * idx; /* Pointer to the index of completed request */ - H5VL_request_status_t *status; /* Pointer to the request's status */ - - /* Retrieve the remaining arguments */ - idx = va_arg(tmp_arguments, size_t *); - assert(*idx <= req_count); - status = va_arg(tmp_arguments, H5VL_request_status_t *); - - /* Reissue the WAITANY 'request specific' call */ - ret_value = H5VL_pass_through_request_specific_reissue(o->under_object, o->under_vol_id, - specific_type, req_count, - under_req_array, timeout, idx, status); - - /* Release the completed request, if it completed */ - if (ret_value >= 0 && *status != H5ES_STATUS_IN_PROGRESS) { - H5VL_pass_through_t *tmp_o; - - tmp_o = (H5VL_pass_through_t *)req_array[*idx]; - H5VL_pass_through_free_obj(tmp_o); - } /* end if */ - } /* end if */ - else if (H5VL_REQUEST_WAITSOME == specific_type) { - size_t * outcount; /* # of completed requests */ - unsigned * array_of_indices; /* Array of indices for completed requests */ - H5VL_request_status_t *array_of_statuses; /* Array of statuses for completed requests */ - - /* Retrieve the remaining arguments */ - outcount = va_arg(tmp_arguments, size_t *); - assert(*outcount <= req_count); - array_of_indices = va_arg(tmp_arguments, unsigned *); - array_of_statuses = va_arg(tmp_arguments, H5VL_request_status_t *); - - /* Reissue the WAITSOME 'request specific' call */ - ret_value = H5VL_pass_through_request_specific_reissue( - o->under_object, o->under_vol_id, specific_type, req_count, under_req_array, timeout, - outcount, array_of_indices, array_of_statuses); - - /* If any requests completed, release them */ - if (ret_value >= 0 && *outcount > 0) { - unsigned *idx_array; /* Array of indices of completed requests */ - - /* Retrieve the array of completed request indices */ - idx_array = va_arg(tmp_arguments, unsigned *); - - /* Release the completed requests */ - for (u = 0; u < *outcount; u++) { - H5VL_pass_through_t *tmp_o; - - tmp_o = (H5VL_pass_through_t *)req_array[idx_array[u]]; - H5VL_pass_through_free_obj(tmp_o); - } /* end for */ - } /* end if */ - } /* end else-if */ - else { /* H5VL_REQUEST_WAITALL == specific_type */ - H5VL_request_status_t *array_of_statuses; /* Array of statuses for completed requests */ - - /* Retrieve the remaining arguments */ - array_of_statuses = va_arg(tmp_arguments, H5VL_request_status_t *); - - /* Reissue the WAITALL 'request specific' call */ - ret_value = H5VL_pass_through_request_specific_reissue( - o->under_object, o->under_vol_id, specific_type, req_count, under_req_array, timeout, - array_of_statuses); - - /* Release the completed requests */ - if (ret_value >= 0) { - for (u = 0; u < req_count; u++) { - if (array_of_statuses[u] != H5ES_STATUS_IN_PROGRESS) { - H5VL_pass_through_t *tmp_o; - - tmp_o = (H5VL_pass_through_t *)req_array[u]; - H5VL_pass_through_free_obj(tmp_o); - } /* end if */ - } /* end for */ - } /* end if */ - } /* end else */ - - /* Release array of requests for underlying connector */ - free(under_req_array); - } /* end if */ - - /* Finish use of copied vararg list */ - va_end(tmp_arguments); - } /* end if */ - else { - H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; - - ret_value = H5VLrequest_specific(o->under_object, o->under_vol_id, specific_type, arguments); - } /* end else */ + ret_value = H5VLrequest_specific(o->under_object, o->under_vol_id, args); return ret_value; } /* end H5VL_pass_through_request_specific() */ @@ -2926,7 +2727,7 @@ H5VL_pass_through_request_specific(void *obj, H5VL_request_specific_t specific_t *------------------------------------------------------------------------- */ static herr_t -H5VL_pass_through_request_optional(void *obj, H5VL_request_optional_t opt_type, va_list arguments) +H5VL_pass_through_request_optional(void *obj, H5VL_optional_args_t *args) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -2935,7 +2736,7 @@ H5VL_pass_through_request_optional(void *obj, H5VL_request_optional_t opt_type, printf("------- PASS THROUGH VOL REQUEST Optional\n"); #endif - ret_value = H5VLrequest_optional(o->under_object, o->under_vol_id, opt_type, arguments); + ret_value = H5VLrequest_optional(o->under_object, o->under_vol_id, args); return ret_value; } /* end H5VL_pass_through_request_optional() */ @@ -3027,8 +2828,7 @@ H5VL_pass_through_blob_get(void *obj, const void *blob_id, void *buf, size_t siz *------------------------------------------------------------------------- */ herr_t -H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t specific_type, - va_list arguments) +H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_args_t *args) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -3037,7 +2837,7 @@ H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t s printf("------- PASS THROUGH VOL BLOB Specific\n"); #endif - ret_value = H5VLblob_specific(o->under_object, o->under_vol_id, blob_id, specific_type, arguments); + ret_value = H5VLblob_specific(o->under_object, o->under_vol_id, blob_id, args); return ret_value; } /* end H5VL_pass_through_blob_specific() */ @@ -3052,7 +2852,7 @@ H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t s *------------------------------------------------------------------------- */ herr_t -H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_blob_optional_t opt_type, va_list arguments) +H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_optional_args_t *args) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -3061,7 +2861,7 @@ H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_blob_optional_t o printf("------- PASS THROUGH VOL BLOB Optional\n"); #endif - ret_value = H5VLblob_optional(o->under_object, o->under_vol_id, blob_id, opt_type, arguments); + ret_value = H5VLblob_optional(o->under_object, o->under_vol_id, blob_id, args); return ret_value; } /* end H5VL_pass_through_blob_optional() */ @@ -3168,7 +2968,7 @@ H5VL_pass_through_token_from_str(void *obj, H5I_type_t obj_type, const char *tok *------------------------------------------------------------------------- */ herr_t -H5VL_pass_through_optional(void *obj, int op_type, hid_t dxpl_id, void **req, va_list arguments) +H5VL_pass_through_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req) { H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj; herr_t ret_value; @@ -3177,7 +2977,7 @@ H5VL_pass_through_optional(void *obj, int op_type, hid_t dxpl_id, void **req, va printf("------- PASS THROUGH VOL generic Optional\n"); #endif - ret_value = H5VLoptional(o->under_object, o->under_vol_id, op_type, dxpl_id, req, arguments); + ret_value = H5VLoptional(o->under_object, o->under_vol_id, args, dxpl_id, req); return ret_value; } /* end H5VL_pass_through_optional() */ |