summaryrefslogtreecommitdiffstats
path: root/src/H5VLcallback.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2021-06-29 20:18:17 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2021-06-29 20:18:17 (GMT)
commit1b045d359486a8379c2ed5e4ff465dcb30d2fe50 (patch)
tree6aacb81da182298d97a65f2e680da57b1a4de369 /src/H5VLcallback.c
parentb6e1c9c68ed0efa1d3a2ee939af226e4b2a8555a (diff)
parent91d016d62130e5a4a8fa8bc8e74f30d1ec8797e5 (diff)
downloadhdf5-1b045d359486a8379c2ed5e4ff465dcb30d2fe50.zip
hdf5-1b045d359486a8379c2ed5e4ff465dcb30d2fe50.tar.gz
hdf5-1b045d359486a8379c2ed5e4ff465dcb30d2fe50.tar.bz2
Merge branch 'post_open_fix' of github.com:hpc-io/hdf5 into post_open_fix
Diffstat (limited to 'src/H5VLcallback.c')
-rw-r--r--src/H5VLcallback.c270
1 files changed, 140 insertions, 130 deletions
diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c
index 2352e82..b3611dc 100644
--- a/src/H5VLcallback.c
+++ b/src/H5VLcallback.c
@@ -72,16 +72,16 @@ typedef herr_t (*H5VL_api_oper_t)(void *ctx);
/* Attribute create "common" callback context data */
typedef struct H5VL_attr_create_ctx_t {
/* DOWN: API routine parameters */
- void *obj;
+ void * obj;
const H5VL_loc_params_t *loc_params;
- H5VL_class_t *cls;
- const char *name;
- hid_t type_id;
- hid_t space_id;
- hid_t acpl_id;
- hid_t aapl_id;
- hid_t dxpl_id;
- void **req;
+ H5VL_class_t * cls;
+ const char * name;
+ hid_t type_id;
+ hid_t space_id;
+ hid_t acpl_id;
+ hid_t aapl_id;
+ hid_t dxpl_id;
+ void ** req;
/* UP: API routine return value */
void *ret_value;
@@ -90,7 +90,7 @@ typedef struct H5VL_attr_create_ctx_t {
/* Attribute open "common" callback context data */
typedef struct H5VL_attr_open_ctx_t {
/* DOWN: API routine parameters */
- void *obj;
+ void * obj;
const H5VL_loc_params_t *loc_params;
H5VL_class_t *cls;
const char *name;
@@ -538,10 +538,10 @@ done:
static herr_t
H5VL__common_api_op(hid_t dxpl_id, H5VL_api_oper_t wrap_op, void *wrap_ctx)
{
- H5P_genplist_t * dxpl_plist = NULL; /* DXPL property list pointer */
- hbool_t new_api_ctx = FALSE; /* Whether to start a new API context */
- hbool_t api_pushed = FALSE; /* Indicate that a new API context was pushed */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5P_genplist_t *dxpl_plist = NULL; /* DXPL property list pointer */
+ hbool_t new_api_ctx = FALSE; /* Whether to start a new API context */
+ hbool_t api_pushed = FALSE; /* Indicate that a new API context was pushed */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -555,18 +555,18 @@ H5VL__common_api_op(hid_t dxpl_id, H5VL_api_oper_t wrap_op, void *wrap_ctx)
/* Start a new API context, if requested */
if (new_api_ctx) {
- hbool_t reset_api_ctx = FALSE; /* Flag to reset the 'new API context' */
+ hbool_t reset_api_ctx = FALSE; /* Flag to reset the 'new API context' */
- /* Push the API context */ \
- if (H5CX_push() < 0) \
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set API context") \
+ /* Push the API context */
+ if (H5CX_push() < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set API context")
api_pushed = TRUE;
/* Reset 'new API context' flag for next layer down */
if (H5P_set(dxpl_plist, H5D_XFER_PLUGIN_NEW_API_CTX_NAME, &reset_api_ctx) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "unable to set value")
} /* end if */
- } /* end if */
+ } /* end if */
/* Call the corresponding internal common wrapper routine */
if ((*wrap_op)(wrap_ctx) < 0)
@@ -574,14 +574,14 @@ H5VL__common_api_op(hid_t dxpl_id, H5VL_api_oper_t wrap_op, void *wrap_ctx)
done:
/* Pop the API context, if it was pushed */
- if(api_pushed) {
- hbool_t undo_api_ctx = TRUE; /* Flag to reset the 'new API context' */
+ if (api_pushed) {
+ hbool_t undo_api_ctx = TRUE; /* Flag to reset the 'new API context' */
/* Undo change to 'new API context' flag */
if (H5P_set(dxpl_plist, H5D_XFER_PLUGIN_NEW_API_CTX_NAME, &undo_api_ctx) < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "unable to set value")
- (void)H5CX_pop(FALSE); \
+ (void)H5CX_pop(FALSE);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@@ -1268,8 +1268,8 @@ done:
static herr_t
H5VL__attr_create_api_op(void *_ctx)
{
- H5VL_attr_create_ctx_t *ctx = (H5VL_attr_create_ctx_t *)_ctx; /* Get pointer to context */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_attr_create_ctx_t *ctx = (H5VL_attr_create_ctx_t *)_ctx; /* Get pointer to context */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1277,8 +1277,9 @@ H5VL__attr_create_api_op(void *_ctx)
HDassert(ctx);
/* Call the corresponding internal VOL routine */
- if (NULL == (ctx->ret_value = H5VL__attr_create(ctx->obj, ctx->loc_params, ctx->cls, ctx->name, ctx->type_id, ctx->space_id, ctx->acpl_id,
- ctx->aapl_id, ctx->dxpl_id, ctx->req)))
+ if (NULL == (ctx->ret_value =
+ H5VL__attr_create(ctx->obj, ctx->loc_params, ctx->cls, ctx->name, ctx->type_id,
+ ctx->space_id, ctx->acpl_id, ctx->aapl_id, ctx->dxpl_id, ctx->req)))
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "unable to create attribute")
done:
@@ -1300,9 +1301,9 @@ H5VLattr_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_
hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id,
void **req /*out*/)
{
- H5VL_attr_create_ctx_t ctx; /* Context for common API wrapper call */
- H5VL_class_t *cls; /* VOL connector's class struct */
- void * ret_value = NULL; /* Return value */
+ H5VL_attr_create_ctx_t ctx; /* Context for common API wrapper call */
+ H5VL_class_t * cls; /* VOL connector's class struct */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_API_WRAPPER(NULL)
H5TRACE10("*x", "*x*#i*siiiiix", obj, loc_params, connector_id, name, type_id, space_id, acpl_id, aapl_id,
@@ -1315,7 +1316,7 @@ H5VLattr_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a VOL connector ID")
/* Set up context */
- ctx.obj = obj;
+ ctx.obj = obj;
ctx.loc_params = loc_params;
ctx.cls = cls;
ctx.name = name;
@@ -1418,8 +1419,8 @@ done:
static herr_t
H5VL__attr_open_api_op(void *_ctx)
{
- H5VL_attr_open_ctx_t *ctx = (H5VL_attr_open_ctx_t *)_ctx; /* Get pointer to context */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_attr_open_ctx_t *ctx = (H5VL_attr_open_ctx_t *)_ctx; /* Get pointer to context */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1427,7 +1428,8 @@ H5VL__attr_open_api_op(void *_ctx)
HDassert(ctx);
/* Call the corresponding internal VOL routine */
- if (NULL == (ctx->ret_value = H5VL__attr_open(ctx->obj, ctx->loc_params, ctx->cls, ctx->name, ctx->aapl_id, ctx->dxpl_id, ctx->req)))
+ if (NULL == (ctx->ret_value = H5VL__attr_open(ctx->obj, ctx->loc_params, ctx->cls, ctx->name,
+ ctx->aapl_id, ctx->dxpl_id, ctx->req)))
HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, FAIL, "unable to open attribute")
done:
@@ -1448,9 +1450,9 @@ void *
H5VLattr_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, const char *name,
hid_t aapl_id, hid_t dxpl_id, void **req /*out*/)
{
- H5VL_attr_open_ctx_t ctx; /* Context for common API wrapper call */
- H5VL_class_t *cls; /* VOL connector's class struct */
- void * ret_value = NULL; /* Return value */
+ H5VL_attr_open_ctx_t ctx; /* Context for common API wrapper call */
+ H5VL_class_t * cls; /* VOL connector's class struct */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_API_WRAPPER(NULL)
H5TRACE7("*x", "*x*#i*siix", obj, loc_params, connector_id, name, aapl_id, dxpl_id, req);
@@ -1462,7 +1464,7 @@ H5VLattr_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a VOL connector ID")
/* Set up context */
- ctx.obj = obj;
+ ctx.obj = obj;
ctx.loc_params = loc_params;
ctx.cls = cls;
ctx.name = name;
@@ -4034,16 +4036,15 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
-H5VL_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
- hid_t dxpl_id, void **req)
+H5VL_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id, void **req)
{
- H5P_genplist_t * fapl_plist; /* Property list pointer */
- H5VL_class_t *cls; /* VOL class structure for callback info */
- H5VL_object_t *vol_obj = NULL; /* Temporary VOL object for file */
- H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
- uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
- void * file = NULL; /* New file created */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5P_genplist_t * fapl_plist; /* Property list pointer */
+ H5VL_class_t * cls; /* VOL class structure for callback info */
+ H5VL_object_t * vol_obj = NULL; /* Temporary VOL object for file */
+ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+ uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
+ void * file = NULL; /* New file created */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -4066,7 +4067,8 @@ H5VL_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "file create failed")
/* Create a temporary VOL object for the file struct */
- if (NULL == (vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, file, connector_prop.connector_id, FALSE)))
+ if (NULL ==
+ (vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, file, connector_prop.connector_id, FALSE)))
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "can't create VOL object")
/* Check for 'post open' callback */
@@ -4074,14 +4076,14 @@ H5VL_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
if (H5VL__introspect_opt_query(file, cls, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN, &supported) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't query optional operation support")
if (supported & H5VL_OPT_QUERY_SUPPORTED) {
- H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
- H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
/* Set up VOL callback arguments */
- file_opt_args.post_open.vol_obj = vol_obj;
+ file_opt_args.post_open.vol_obj = vol_obj;
file_opt_args.post_open.id_exists = TRUE;
- vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
- vol_cb_args.args = &file_opt_args;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
+ vol_cb_args.args = &file_opt_args;
/* Make the 'post open' callback */
if (H5VL__file_optional(file, cls, &vol_cb_args, dxpl_id, req) < 0)
@@ -4110,14 +4112,14 @@ void *
H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id,
void **req /*out*/)
{
- H5P_genplist_t * fapl_plist = NULL; /* FAPL property list pointer */
- H5P_genplist_t * dxpl_plist = NULL; /* DXPL property list pointer */
- H5VL_object_t *vol_obj = NULL; /* Temporary VOL object for file */
- H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
- H5VL_class_t * cls; /* VOL connector's class struct */
- hbool_t new_api_ctx = FALSE; /* Whether to start a new API context */
- hbool_t api_pushed = FALSE; /* Indicate that a new API context was pushed */
- void * ret_value = NULL; /* Return value */
+ H5P_genplist_t * fapl_plist = NULL; /* FAPL property list pointer */
+ H5P_genplist_t * dxpl_plist = NULL; /* DXPL property list pointer */
+ H5VL_object_t * vol_obj = NULL; /* Temporary VOL object for file */
+ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+ H5VL_class_t * cls; /* VOL connector's class struct */
+ hbool_t new_api_ctx = FALSE; /* Whether to start a new API context */
+ hbool_t api_pushed = FALSE; /* Indicate that a new API context was pushed */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_API_WRAPPER(NULL)
H5TRACE6("*x", "*sIuiiix", name, flags, fcpl_id, fapl_id, dxpl_id, req);
@@ -4138,11 +4140,11 @@ H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
/* Start a new API context, if requested */
if (new_api_ctx) {
- hbool_t reset_api_ctx = FALSE; /* Flag to reset the 'new API context' */
+ hbool_t reset_api_ctx = FALSE; /* Flag to reset the 'new API context' */
- /* Push the API context */ \
- if (H5CX_push() < 0) \
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set API context") \
+ /* Push the API context */
+ if (H5CX_push() < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set API context")
api_pushed = TRUE;
/* Reset 'new API context' flag for next layer down */
@@ -4153,7 +4155,7 @@ H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
if (H5CX_set_vol_connector_prop(&connector_prop) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL connector info in API context")
} /* end if */
- } /* end if */
+ } /* end if */
/* Get class pointer */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_prop.connector_id, H5I_VOL)))
@@ -4164,32 +4166,34 @@ H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "unable to create file")
/* Attempt 'post open' callback, for new API contexts */
- if(new_api_ctx) {
- uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
+ if (new_api_ctx) {
+ uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
/* Check for 'post open' callback */
supported = 0;
- if (H5VL__introspect_opt_query(ret_value, cls, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN, &supported) < 0)
+ if (H5VL__introspect_opt_query(ret_value, cls, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN,
+ &supported) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't query optional operation support")
if (supported & H5VL_OPT_QUERY_SUPPORTED) {
- H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
- H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
/* Create a temporary VOL object for the file struct */
- if (NULL == (vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, ret_value, connector_prop.connector_id, FALSE)))
+ if (NULL == (vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, ret_value,
+ connector_prop.connector_id, FALSE)))
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, NULL, "can't create VOL object")
/* Set up VOL callback arguments */
- file_opt_args.post_open.vol_obj = vol_obj;
+ file_opt_args.post_open.vol_obj = vol_obj;
file_opt_args.post_open.id_exists = TRUE;
- vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
- vol_cb_args.args = &file_opt_args;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
+ vol_cb_args.args = &file_opt_args;
/* Make the 'post open' callback */
if (H5VL__file_optional(ret_value, cls, &vol_cb_args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, NULL, "file optional failed")
} /* end if */
- } /* end if */
+ } /* end if */
done:
/* Destroy temporary VOL file object */
@@ -4197,14 +4201,14 @@ done:
HDONE_ERROR(H5E_VOL, H5E_CANTRELEASE, NULL, "unable to free VOL object")
/* Pop the API context, if it was pushed */
- if(api_pushed) {
- hbool_t undo_api_ctx = TRUE; /* Flag to reset the 'new API context' */
+ if (api_pushed) {
+ hbool_t undo_api_ctx = TRUE; /* Flag to reset the 'new API context' */
/* Undo change to 'new API context' flag */
if (H5P_set(dxpl_plist, H5D_XFER_PLUGIN_NEW_API_CTX_NAME, &undo_api_ctx) < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTSET, NULL, "unable to set value")
- (void)H5CX_pop(FALSE); \
+ (void)H5CX_pop(FALSE);
} /* end if */
FUNC_LEAVE_API_WRAPPER(ret_value)
@@ -4352,16 +4356,16 @@ done:
*-------------------------------------------------------------------------
*/
H5VL_object_t *
-H5VL_file_open(const char *name, unsigned flags, hid_t fapl_id,
- hid_t dxpl_id, void **req, hid_t *ret_id /*out*/)
+H5VL_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req,
+ hid_t *ret_id /*out*/)
{
- H5P_genplist_t * fapl_plist; /* Property list pointer */
- H5VL_class_t *cls; /* VOL class structure for callback info */
- H5VL_object_t *vol_obj = NULL; /* Temporary VOL object for file */
- H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
- void * file = NULL; /* File pointer */
- uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
- H5VL_object_t *ret_value = NULL; /* Return value */
+ H5P_genplist_t * fapl_plist; /* Property list pointer */
+ H5VL_class_t * cls; /* VOL class structure for callback info */
+ H5VL_object_t * vol_obj = NULL; /* Temporary VOL object for file */
+ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+ void * file = NULL; /* File pointer */
+ uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
+ H5VL_object_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -4422,7 +4426,7 @@ H5VL_file_open(const char *name, unsigned flags, hid_t fapl_id,
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL connector info in API context")
if (NULL == (file = H5VL__file_open(find_connector_ud.cls, name, flags,
- find_connector_ud.fapl_id, dxpl_id, req)))
+ find_connector_ud.fapl_id, dxpl_id, req)))
HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL,
"can't open file '%s' with VOL connector '%s'", name,
find_connector_ud.cls->name)
@@ -4435,7 +4439,8 @@ H5VL_file_open(const char *name, unsigned flags, hid_t fapl_id,
} /* end if */
/* Create a VOL object for the file struct */
- if (NULL == (vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, file, connector_prop.connector_id, FALSE)))
+ if (NULL ==
+ (vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, file, connector_prop.connector_id, FALSE)))
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, NULL, "can't create VOL object")
/* Check for 'post open' callback */
@@ -4443,12 +4448,13 @@ H5VL_file_open(const char *name, unsigned flags, hid_t fapl_id,
if (H5VL__introspect_opt_query(file, cls, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN, &supported) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't query optional operation support")
if (supported & H5VL_OPT_QUERY_SUPPORTED) {
- H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
- H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
/* Set up VOL callback arguments */
file_opt_args.post_open.vol_obj = vol_obj;
- file_opt_args.post_open.id_exists = (ret_id != NULL); /* Set the 'id_exists' flag to TRUE when returning an ID */
+ file_opt_args.post_open.id_exists =
+ (ret_id != NULL); /* Set the 'id_exists' flag to TRUE when returning an ID */
vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
vol_cb_args.args = &file_opt_args;
@@ -4459,7 +4465,7 @@ H5VL_file_open(const char *name, unsigned flags, hid_t fapl_id,
/* Check for registering ID for file */
if (ret_id) {
- hid_t file_id; /* File ID for file pointer */
+ hid_t file_id; /* File ID for file pointer */
/* Register ID for VOL object, for future API calls */
if ((file_id = H5I_register(H5I_FILE, vol_obj, TRUE)) < 0)
@@ -4489,14 +4495,14 @@ done:
void *
H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req /*out*/)
{
- H5P_genplist_t * fapl_plist = NULL; /* FAPL property list pointer */
- H5P_genplist_t * dxpl_plist = NULL; /* DXPL property list pointer */
- H5VL_object_t *vol_obj = NULL; /* Temporary VOL object for file */
- H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
- H5VL_class_t * cls; /* VOL connector's class struct */
- hbool_t new_api_ctx = FALSE; /* Whether to start a new API context */
- hbool_t api_pushed = FALSE; /* Indicate that a new API context was pushed */
- void * ret_value = NULL; /* Return value */
+ H5P_genplist_t * fapl_plist = NULL; /* FAPL property list pointer */
+ H5P_genplist_t * dxpl_plist = NULL; /* DXPL property list pointer */
+ H5VL_object_t * vol_obj = NULL; /* Temporary VOL object for file */
+ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+ H5VL_class_t * cls; /* VOL connector's class struct */
+ hbool_t new_api_ctx = FALSE; /* Whether to start a new API context */
+ hbool_t api_pushed = FALSE; /* Indicate that a new API context was pushed */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_API_WRAPPER(NULL)
H5TRACE5("*x", "*sIuiix", name, flags, fapl_id, dxpl_id, req);
@@ -4517,11 +4523,11 @@ H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, vo
/* Start a new API context, if requested */
if (new_api_ctx) {
- hbool_t reset_api_ctx = FALSE; /* Flag to reset the 'new API context' */
+ hbool_t reset_api_ctx = FALSE; /* Flag to reset the 'new API context' */
- /* Push the API context */ \
- if (H5CX_push() < 0) \
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set API context") \
+ /* Push the API context */
+ if (H5CX_push() < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set API context")
api_pushed = TRUE;
/* Reset 'new API context' flag for next layer down */
@@ -4532,7 +4538,7 @@ H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, vo
if (H5CX_set_vol_connector_prop(&connector_prop) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, NULL, "can't set VOL connector info in API context")
} /* end if */
- } /* end if */
+ } /* end if */
/* Get class pointer */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_prop.connector_id, H5I_VOL)))
@@ -4543,32 +4549,34 @@ H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, vo
HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "unable to open file")
/* Attempt 'post open' callback, for new API contexts */
- if(new_api_ctx) {
- uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
+ if (new_api_ctx) {
+ uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
/* Check for 'post open' callback */
supported = 0;
- if (H5VL__introspect_opt_query(ret_value, cls, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN, &supported) < 0)
+ if (H5VL__introspect_opt_query(ret_value, cls, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN,
+ &supported) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't query optional operation support")
if (supported & H5VL_OPT_QUERY_SUPPORTED) {
- H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
- H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
/* Create a temporary VOL object for the file struct */
- if (NULL == (vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, ret_value, connector_prop.connector_id, FALSE)))
+ if (NULL == (vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, ret_value,
+ connector_prop.connector_id, FALSE)))
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, NULL, "can't create VOL object")
/* Set up VOL callback arguments */
- file_opt_args.post_open.vol_obj = vol_obj;
+ file_opt_args.post_open.vol_obj = vol_obj;
file_opt_args.post_open.id_exists = TRUE;
- vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
- vol_cb_args.args = &file_opt_args;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
+ vol_cb_args.args = &file_opt_args;
/* Make the 'post open' callback */
if (H5VL__file_optional(ret_value, cls, &vol_cb_args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, NULL, "file optional failed")
} /* end if */
- } /* end if */
+ } /* end if */
done:
/* Destroy temporary VOL file object */
@@ -4576,14 +4584,14 @@ done:
HDONE_ERROR(H5E_VOL, H5E_CANTRELEASE, NULL, "unable to free VOL object")
/* Pop the API context, if it was pushed */
- if(api_pushed) {
- hbool_t undo_api_ctx = TRUE; /* Flag to reset the 'new API context' */
+ if (api_pushed) {
+ hbool_t undo_api_ctx = TRUE; /* Flag to reset the 'new API context' */
/* Undo change to 'new API context' flag */
if (H5P_set(dxpl_plist, H5D_XFER_PLUGIN_NEW_API_CTX_NAME, &undo_api_ctx) < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTSET, NULL, "unable to set value")
- (void)H5CX_pop(FALSE); \
+ (void)H5CX_pop(FALSE);
} /* end if */
FUNC_LEAVE_API_WRAPPER(ret_value)
@@ -4730,7 +4738,7 @@ herr_t
H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_args_t *args, hid_t dxpl_id, void **req)
{
const H5VL_class_t *cls; /* VOL connector's class struct */
- H5VL_object_t *reopen_vol_obj = NULL; /* Temporary VOL object for file */
+ H5VL_object_t * reopen_vol_obj = NULL; /* Temporary VOL object for file */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -4780,8 +4788,8 @@ H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_args_t *args
/* Special treatment of file re-open operation */
if (args->op_type == H5VL_FILE_REOPEN) {
- void *reopen_file; /* Pointer to re-opened file */
- uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
+ void * reopen_file; /* Pointer to re-opened file */
+ uint64_t supported; /* Whether 'post open' operation is supported by VOL connector */
/* Get pointer to re-opened file */
reopen_file = *args->args.reopen.file;
@@ -4789,27 +4797,29 @@ H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_args_t *args
/* Check for 'post open' callback */
supported = 0;
- if (H5VL__introspect_opt_query(reopen_file, cls, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN, &supported) < 0)
+ if (H5VL__introspect_opt_query(reopen_file, cls, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN,
+ &supported) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't query optional operation support")
if (supported & H5VL_OPT_QUERY_SUPPORTED) {
- H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
- H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
/* Create a temporary VOL object for the file struct */
- if (NULL == (reopen_vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, reopen_file, vol_obj->connector->id, TRUE)))
+ if (NULL == (reopen_vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, reopen_file,
+ vol_obj->connector->id, TRUE)))
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't create VOL object")
/* Set up VOL callback arguments */
- file_opt_args.post_open.vol_obj = reopen_vol_obj;
+ file_opt_args.post_open.vol_obj = reopen_vol_obj;
file_opt_args.post_open.id_exists = TRUE;
- vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
- vol_cb_args.args = &file_opt_args;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
+ vol_cb_args.args = &file_opt_args;
/* Make the 'post open' callback */
if (H5VL__file_optional(reopen_file, cls, &vol_cb_args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file optional failed")
} /* end if */
- } /* end if */
+ } /* end if */
done:
/* Destroy temporary VOL file object */