diff options
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 450 |
1 files changed, 300 insertions, 150 deletions
@@ -70,7 +70,7 @@ static herr_t H5O__copy_api_common(hid_t src_loc_id, const char *src_name, hid_t H5VL_object_t **_vol_obj_ptr); static herr_t H5O__flush_api_common(hid_t obj_id, void **token_ptr, H5VL_object_t **_vol_obj_ptr); static herr_t H5O__refresh_api_common(hid_t oid, void **token_ptr, H5VL_object_t **_vol_obj_ptr); -static htri_t H5O__close_check_common(hid_t object_id); +static htri_t H5O__close_check_type(hid_t object_id); /*********************/ /* Package Variables */ @@ -112,7 +112,7 @@ H5O__open_api_common(hid_t loc_id, const char *name, hid_t lapl_id, void **token /* name is checked in this H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, name, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments") /* Open the object */ @@ -239,7 +239,7 @@ H5O__open_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t idx /* Check args */ /* group_name, idx_type, order are checked in H5VL_setup_idx-args() */ /* Set up object access arguments */ - if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr, + if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments") @@ -448,6 +448,7 @@ H5O__copy_api_common(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, c /* Set the LCPL for the API context */ H5CX_set_lcpl(lcpl_id); + /* Setup and check args */ if (H5VL_setup_loc_args(src_loc_id, &vol_obj1, &loc_params1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments") @@ -616,19 +617,23 @@ H5O__flush_api_common(hid_t obj_id, void **token_ptr, H5VL_object_t **_vol_obj_p H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */ H5VL_object_t **vol_obj_ptr = (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */ - H5VL_loc_params_t loc_params; /* Location parameters for object access */ - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* Check args */ - + /* Setup and check args */ if (H5VL_setup_loc_args(obj_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments") + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_FLUSH; + vol_cb_args.args.flush.obj_id = obj_id; + /* Flush the object */ - if (H5VL_object_specific(*vol_obj_ptr, &loc_params, H5VL_OBJECT_FLUSH, H5P_DATASET_XFER_DEFAULT, - token_ptr, obj_id) < 0) + if (H5VL_object_specific(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") done: @@ -718,19 +723,23 @@ H5O__refresh_api_common(hid_t oid, void **token_ptr, H5VL_object_t **_vol_obj_pt H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */ H5VL_object_t **vol_obj_ptr = (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */ - H5VL_loc_params_t loc_params; /* Location parameters for object access */ - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* Check args */ - + /* Setup and check args */ if (H5VL_setup_loc_args(oid, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments") + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_REFRESH; + vol_cb_args.args.refresh.obj_id = oid; + /* Refresh the object */ - if (H5VL_object_specific(*vol_obj_ptr, &loc_params, H5VL_OBJECT_REFRESH, H5P_DATASET_XFER_DEFAULT, - token_ptr, oid) < 0) + if (H5VL_object_specific(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") done: @@ -829,12 +838,12 @@ done: herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id) { - H5VL_object_t * vol_obj1 = NULL; /* object of obj_id */ - H5VL_object_t * vol_obj2 = NULL; /* object of new_loc_id */ - H5VL_object_t tmp_vol_obj; /* Temporary object */ - H5VL_loc_params_t loc_params1; - H5VL_loc_params_t loc_params2; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj1 = NULL; /* object of obj_id */ + H5VL_object_t * vol_obj2 = NULL; /* object of new_loc_id */ + H5VL_object_t tmp_vol_obj; /* Temporary object */ + H5VL_link_create_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t new_loc_params; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "ii*sii", obj_id, new_loc_id, new_name, lcpl_id, lapl_id); @@ -864,36 +873,45 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, obj_id, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") - loc_params1.type = H5VL_OBJECT_BY_SELF; - loc_params1.obj_type = H5I_get_type(obj_id); - - loc_params2.type = H5VL_OBJECT_BY_NAME; - loc_params2.obj_type = H5I_get_type(new_loc_id); - loc_params2.loc_data.loc_by_name.name = new_name; - loc_params2.loc_data.loc_by_name.lapl_id = lapl_id; + /* Set up new location struct */ + new_loc_params.type = H5VL_OBJECT_BY_NAME; + new_loc_params.obj_type = H5I_get_type(new_loc_id); + new_loc_params.loc_data.loc_by_name.name = new_name; + new_loc_params.loc_data.loc_by_name.lapl_id = lapl_id; - if (H5L_SAME_LOC != obj_id) - /* get the location object */ - if (NULL == (vol_obj1 = H5VL_vol_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Get the first location object */ + if (NULL == (vol_obj1 = H5VL_vol_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") if (H5L_SAME_LOC != new_loc_id) /* get the location object */ 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 connectors are the same */ - if (vol_obj1 && vol_obj2) - if (vol_obj1->connector->cls->value != vol_obj2->connector->cls->value) + if (vol_obj1 && vol_obj2) { + int same_connector = 0; + + /* Check if both objects are associated with the same VOL connector */ + if (H5VL_cmp_connector_cls(&same_connector, vol_obj1->connector->cls, vol_obj2->connector->cls) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCOMPARE, FAIL, "can't compare connector classes") + if (same_connector) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Objects are accessed through different VOL connectors and can't be linked") + } /* end if */ /* Construct a temporary VOL object */ tmp_vol_obj.data = vol_obj2->data; - tmp_vol_obj.connector = (vol_obj1 != NULL ? vol_obj1->connector : vol_obj2->connector); + tmp_vol_obj.connector = vol_obj1->connector; + + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_LINK_CREATE_HARD; + vol_cb_args.args.hard.curr_obj = vol_obj1->data; + vol_cb_args.args.hard.curr_loc_params.type = H5VL_OBJECT_BY_SELF; + vol_cb_args.args.hard.curr_loc_params.obj_type = H5I_get_type(obj_id); /* 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, vol_obj1->data, &loc_params1) < 0) + if (H5VL_link_create(&vol_cb_args, &tmp_vol_obj, &new_loc_params, lcpl_id, lapl_id, + H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "unable to create link") done: @@ -923,9 +941,10 @@ done: herr_t H5Oincr_refcount(hid_t object_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -941,9 +960,13 @@ H5Oincr_refcount(hid_t object_id) if (H5CX_set_loc(object_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_CHANGE_REF_COUNT; + vol_cb_args.args.change_rc.delta = 1; + /* Change the object's reference count */ - if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_CHANGE_REF_COUNT, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, 1) < 0) + if (H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: @@ -973,9 +996,10 @@ done: herr_t H5Odecr_refcount(hid_t object_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -991,9 +1015,13 @@ H5Odecr_refcount(hid_t object_id) if (H5CX_set_loc(object_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_CHANGE_REF_COUNT; + vol_cb_args.args.change_rc.delta = -1; + /* Change the object's reference count */ - if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_CHANGE_REF_COUNT, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, -1) < 0) + if (H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: @@ -1016,9 +1044,11 @@ done: htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - htri_t ret_value = FAIL; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ + hbool_t obj_exists = FALSE; /* Whether object exists */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("t", "i*si", loc_id, name, lapl_id); @@ -1043,11 +1073,18 @@ H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) loc_params.loc_data.loc_by_name.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(loc_id); + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_EXISTS; + vol_cb_args.args.exists.exists = &obj_exists; + /* Check if the object exists */ - if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_EXISTS, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &ret_value) < 0) + if (H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", name) + /* Set return value */ + ret_value = (htri_t)obj_exists; + done: FUNC_LEAVE_API(ret_value) } /* end H5Oexists_by_name() */ @@ -1067,9 +1104,10 @@ done: herr_t H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo /*out*/, unsigned fields) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixIu", loc_id, oinfo, fields); @@ -1088,9 +1126,13 @@ H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo /*out*/, unsigned fields) if (NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_GET_INFO; + vol_cb_args.args.get_info.oinfo = oinfo; + vol_cb_args.args.get_info.fields = fields; + /* Retrieve the object's information */ - if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - oinfo, fields) < 0) + if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get data model info for object") done: @@ -1114,8 +1156,9 @@ H5O__get_info_by_name_api_common(hid_t loc_id, const char *name, H5O_info2_t *oi H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */ H5VL_object_t **vol_obj_ptr = (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */ - H5VL_loc_params_t loc_params; /* Location parameters for object access */ - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1127,12 +1170,16 @@ H5O__get_info_by_name_api_common(hid_t loc_id, const char *name, H5O_info2_t *oi /* "name" is checked in H5VL_setup_name_args() */ /* Set up object access arguments */ - if (H5VL_setup_name_args(loc_id, name, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) + if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments") + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_GET_INFO; + vol_cb_args.args.get_info.oinfo = oinfo; + vol_cb_args.args.get_info.fields = fields; + /* Retrieve the object's information */ - if (H5VL_object_get(*vol_obj_ptr, &loc_params, H5VL_OBJECT_GET_INFO, H5P_DATASET_XFER_DEFAULT, token_ptr, - oinfo, fields) < 0) + if (H5VL_object_get(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get data model info for object") done: @@ -1230,9 +1277,10 @@ herr_t H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info2_t *oinfo /*out*/, unsigned fields, hid_t lapl_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); @@ -1253,6 +1301,7 @@ H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, H if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set location struct fields */ loc_params.type = H5VL_OBJECT_BY_IDX; loc_params.loc_data.loc_by_idx.name = group_name; loc_params.loc_data.loc_by_idx.idx_type = idx_type; @@ -1265,9 +1314,13 @@ H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, H if (NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_GET_INFO; + vol_cb_args.args.get_info.oinfo = oinfo; + vol_cb_args.args.get_info.fields = fields; + /* Retrieve the object's information */ - if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - oinfo, fields) < 0) + if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get data model info for object") done: @@ -1289,9 +1342,11 @@ done: herr_t H5Oget_native_info(hid_t loc_id, H5O_native_info_t *oinfo /*out*/, unsigned fields) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */ + H5VL_loc_params_t loc_params; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixIu", loc_id, oinfo, fields); @@ -1310,9 +1365,15 @@ H5Oget_native_info(hid_t loc_id, H5O_native_info_t *oinfo /*out*/, unsigned fiel if (NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Set up VOL callback arguments */ + obj_opt_args.get_native_info.fields = fields; + obj_opt_args.get_native_info.ninfo = oinfo; + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_NATIVE_INFO; + vol_cb_args.args = &obj_opt_args; + /* Retrieve the object's information */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_NATIVE_INFO, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params, oinfo, fields) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get native file format info for object") done: @@ -1335,9 +1396,11 @@ herr_t H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oinfo /*out*/, unsigned fields, hid_t lapl_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */ + H5VL_loc_params_t loc_params; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*sxIui", loc_id, name, oinfo, fields, lapl_id); @@ -1366,9 +1429,15 @@ H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oi if (NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Set up VOL callback arguments */ + obj_opt_args.get_native_info.fields = fields; + obj_opt_args.get_native_info.ninfo = oinfo; + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_NATIVE_INFO; + vol_cb_args.args = &obj_opt_args; + /* Retrieve the object's information */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_NATIVE_INFO, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params, oinfo, fields) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get native file format info for object: '%s'", name) done: @@ -1393,9 +1462,11 @@ herr_t H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_native_info_t *oinfo /*out*/, unsigned fields, hid_t lapl_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */ + H5VL_loc_params_t loc_params; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); @@ -1416,6 +1487,7 @@ H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_t if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set location struct fields */ loc_params.type = H5VL_OBJECT_BY_IDX; loc_params.loc_data.loc_by_idx.name = group_name; loc_params.loc_data.loc_by_idx.idx_type = idx_type; @@ -1428,9 +1500,15 @@ H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_t if (NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Set up VOL callback arguments */ + obj_opt_args.get_native_info.fields = fields; + obj_opt_args.get_native_info.ninfo = oinfo; + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_NATIVE_INFO; + vol_cb_args.args = &obj_opt_args; + /* Retrieve the object's information */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_NATIVE_INFO, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params, oinfo, fields) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get native file format info for object") done: @@ -1457,9 +1535,11 @@ done: herr_t H5Oset_comment(hid_t obj_id, const char *comment) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */ + H5VL_loc_params_t loc_params; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", obj_id, comment); @@ -1476,9 +1556,14 @@ H5Oset_comment(hid_t obj_id, const char *comment) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(obj_id); + /* Set up VOL callback arguments */ + obj_opt_args.set_comment.comment = comment; + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_SET_COMMENT; + vol_cb_args.args = &obj_opt_args; + /* (Re)set the object's comment */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_SET_COMMENT, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params, comment) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object") done: @@ -1505,9 +1590,11 @@ done: herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */ + H5VL_loc_params_t loc_params; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*s*si", loc_id, name, comment, lapl_id); @@ -1530,9 +1617,14 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_ if (NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + /* Set up VOL callback arguments */ + obj_opt_args.set_comment.comment = comment; + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_SET_COMMENT; + vol_cb_args.args = &obj_opt_args; + /* (Re)set the object's comment */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_SET_COMMENT, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params, comment) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object: '%s'", name) done: @@ -1558,9 +1650,12 @@ done: ssize_t H5Oget_comment(hid_t obj_id, char *comment /*out*/, size_t bufsize) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - ssize_t ret_value = -1; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */ + H5VL_loc_params_t loc_params; + size_t comment_len = 0; /* Length of comment string */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) H5TRACE3("Zs", "ixz", obj_id, comment, bufsize); @@ -1573,11 +1668,21 @@ H5Oget_comment(hid_t obj_id, char *comment /*out*/, size_t bufsize) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(obj_id); + /* Set up VOL callback arguments */ + obj_opt_args.get_comment.buf = comment; + obj_opt_args.get_comment.buf_size = bufsize; + obj_opt_args.get_comment.comment_len = &comment_len; + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_COMMENT; + vol_cb_args.args = &obj_opt_args; + /* Retrieve the object's comment */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_COMMENT, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params, comment, bufsize, &ret_value) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, (-1), "can't get comment for object") + /* Set return value */ + ret_value = (ssize_t)comment_len; + done: FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment() */ @@ -1601,9 +1706,12 @@ done: ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment /*out*/, size_t bufsize, hid_t lapl_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - ssize_t ret_value = -1; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */ + H5VL_loc_params_t loc_params; + size_t comment_len = 0; /* Length of comment string */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) H5TRACE5("Zs", "i*sxzi", loc_id, name, comment, bufsize, lapl_id); @@ -1626,11 +1734,21 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment /*out*/, si if (NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid location identifier") + /* Set up VOL callback arguments */ + obj_opt_args.get_comment.buf = comment; + obj_opt_args.get_comment.buf_size = bufsize; + obj_opt_args.get_comment.comment_len = &comment_len; + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_COMMENT; + vol_cb_args.args = &obj_opt_args; + /* Retrieve the object's comment */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_COMMENT, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params, comment, bufsize, &ret_value) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, (-1), "can't get comment for object: '%s'", name) + /* Set return value */ + ret_value = (ssize_t)comment_len; + done: FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment_by_name() */ @@ -1674,9 +1792,10 @@ herr_t H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2_t op, void *op_data, unsigned fields) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIiIoOI*xIu", obj_id, idx_type, order, op, op_data, fields); @@ -1699,10 +1818,17 @@ H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2 loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(obj_id); + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_VISIT; + vol_cb_args.args.visit.idx_type = idx_type; + vol_cb_args.args.visit.order = order; + vol_cb_args.args.visit.op = op; + vol_cb_args.args.visit.op_data = op_data; + vol_cb_args.args.visit.fields = fields; + /* Visit the objects */ - if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_VISIT, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, (int)idx_type, (int)order, op, op_data, fields)) < - 0) + if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, + H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object iteration failed") done: @@ -1748,9 +1874,10 @@ herr_t H5Ovisit_by_name3(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2_t op, void *op_data, unsigned fields, hid_t lapl_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; - herr_t ret_value; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE8("e", "i*sIiIoOI*xIui", loc_id, obj_name, idx_type, order, op, op_data, fields, lapl_id); @@ -1783,10 +1910,17 @@ H5Ovisit_by_name3(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it loc_params.loc_data.loc_by_name.lapl_id = lapl_id; loc_params.obj_type = H5I_get_type(loc_id); + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_OBJECT_VISIT; + vol_cb_args.args.visit.idx_type = idx_type; + vol_cb_args.args.visit.order = order; + vol_cb_args.args.visit.op = op; + vol_cb_args.args.visit.op_data = op_data; + vol_cb_args.args.visit.fields = fields; + /* Visit the objects */ - if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_VISIT, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, (int)idx_type, (int)order, op, op_data, fields)) < - 0) + if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, + H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object iteration failed") done: @@ -1794,23 +1928,23 @@ done: } /* end H5Ovisit_by_name3() */ /*------------------------------------------------------------------------- - * Function: H5O__close_check_common + * Function: H5O__close_check_type * * Purpose: This is the common function to validate an object - * when closing it. + * before closing it. * * Return: TRUE/FALSE/FAIL * *------------------------------------------------------------------------- */ static htri_t -H5O__close_check_common(hid_t object_id) +H5O__close_check_type(hid_t object_id) { htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_STATIC - /* Get the type of the object and close it in the correct way */ + /* Check for closeable object */ switch (H5I_get_type(object_id)) { case H5I_GROUP: case H5I_DATATYPE: @@ -1836,14 +1970,13 @@ H5O__close_check_common(hid_t object_id) case H5I_EVENTSET: case H5I_NTYPES: default: - HGOTO_ERROR(H5E_ARGS, H5E_CANTRELEASE, FALSE, - "not a valid file object ID (dataset, group, or datatype)") + HGOTO_DONE(FALSE); break; } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O__close_check_common() */ +} /* H5O__close_check_type() */ /*------------------------------------------------------------------------- * Function: H5Oclose @@ -1871,7 +2004,7 @@ H5Oclose(hid_t object_id) H5TRACE1("e", "i", object_id); /* Validate the object type before closing */ - if (H5O__close_check_common(object_id) <= 0) + if (H5O__close_check_type(object_id) <= 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "not a valid object") if (H5I_dec_app_ref(object_id) < 0) @@ -1903,7 +2036,7 @@ H5Oclose_async(const char *app_file, const char *app_func, unsigned app_line, hi H5TRACE5("e", "*s*sIuii", app_file, app_func, app_line, object_id, es_id); /* Validate the object type before closing */ - if (H5O__close_check_common(object_id) <= 0) + if (H5O__close_check_type(object_id) <= 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "not a valid object") /* Prepare for possible asynchronous operation */ @@ -1943,7 +2076,7 @@ done: } /* end H5Oclose_async() */ /*------------------------------------------------------------------------- - * Function: H5O_disable_mdc_flushes + * Function: H5O__disable_mdc_flushes * * Purpose: Private version of the metadata cache cork function. * @@ -1952,18 +2085,18 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_disable_mdc_flushes(H5O_loc_t *oloc) +H5O__disable_mdc_flushes(H5O_loc_t *oloc) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL); + FUNC_ENTER_PACKAGE if (H5AC_cork(oloc->file, oloc->addr, H5AC__SET_CORK, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCORK, FAIL, "unable to cork object"); done: FUNC_LEAVE_NOAPI(ret_value); -} /* H5O_disable_mdc_flushes() */ +} /* H5O__disable_mdc_flushes() */ /*------------------------------------------------------------------------- * Function: H5Odisable_mdc_flushes @@ -1982,9 +2115,10 @@ done: herr_t H5Odisable_mdc_flushes(hid_t object_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; /* Location parameters */ - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL); H5TRACE1("e", "i", object_id); @@ -2001,9 +2135,13 @@ H5Odisable_mdc_flushes(hid_t object_id) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(object_id); + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES; + vol_cb_args.args = NULL; + /* Cork the object */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCORK, FAIL, "unable to cork object"); done: @@ -2011,7 +2149,7 @@ done: } /* H5Odisable_mdc_flushes() */ /*------------------------------------------------------------------------- - * Function: H5O_enable_mdc_flushes + * Function: H5O__enable_mdc_flushes * * Purpose: Private version of the metadata cache uncork function. * @@ -2020,18 +2158,18 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_enable_mdc_flushes(H5O_loc_t *oloc) +H5O__enable_mdc_flushes(H5O_loc_t *oloc) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL); + FUNC_ENTER_PACKAGE if (H5AC_cork(oloc->file, oloc->addr, H5AC__UNCORK, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNCORK, FAIL, "unable to uncork object"); done: FUNC_LEAVE_NOAPI(ret_value); -} /* H5O_enable_mdc_flushes() */ +} /* H5O__enable_mdc_flushes() */ /*------------------------------------------------------------------------- * Function: H5Oenable_mdc_flushes @@ -2050,9 +2188,10 @@ done: herr_t H5Oenable_mdc_flushes(hid_t object_id) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; /* Location parameters */ - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_loc_params_t loc_params; /* Location parameters */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL); H5TRACE1("e", "i", object_id); @@ -2069,9 +2208,13 @@ H5Oenable_mdc_flushes(hid_t object_id) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(object_id); + /* Set up VOL callback arguments */ + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES; + vol_cb_args.args = NULL; + /* Uncork the object */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNCORK, FAIL, "unable to uncork object"); done: @@ -2079,7 +2222,7 @@ done: } /* H5Oenable_mdc_flushes() */ /*------------------------------------------------------------------------- - * Function: H5O_are_mdc_flushes_disabled + * Function: H5O__are_mdc_flushes_disabled * * Purpose: Private version of cork status getter. * @@ -2088,11 +2231,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_are_mdc_flushes_disabled(H5O_loc_t *oloc, hbool_t *are_disabled) +H5O__are_mdc_flushes_disabled(const H5O_loc_t *oloc, hbool_t *are_disabled) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL); + FUNC_ENTER_PACKAGE HDassert(are_disabled); @@ -2101,7 +2244,7 @@ H5O_are_mdc_flushes_disabled(H5O_loc_t *oloc, hbool_t *are_disabled) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_are_mdc_flushes_disabled() */ +} /* H5O__are_mdc_flushes_disabled() */ /*------------------------------------------------------------------------- * Function: H5Oare_mdc_flushes_disabled @@ -2123,9 +2266,11 @@ done: herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled) { - H5VL_object_t * vol_obj; /* Object of loc_id */ - H5VL_loc_params_t loc_params; /* Location parameters */ - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ + H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */ + H5VL_loc_params_t loc_params; /* Location parameters */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL); H5TRACE2("e", "i*b", object_id, are_disabled); @@ -2146,9 +2291,14 @@ H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(object_id); + /* Set up VOL callback arguments */ + obj_opt_args.are_mdc_flushes_disabled.flag = are_disabled; + vol_cb_args.op_type = H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED; + vol_cb_args.args = &obj_opt_args; + /* Get the cork status */ - if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, &loc_params, are_disabled) < 0) + if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < + 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to retrieve object's cork status"); done: |