summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-12-20 04:41:37 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2020-01-04 16:02:08 (GMT)
commit7d87aea63fb7387b88b7fd8057feb9e42e53bd8c (patch)
tree1fda21f90c271061b94de2052ca12137d8298ff4 /src/H5Fint.c
parentb68c6977e6be5a1e9951cce83d3bf77729fc2b21 (diff)
downloadhdf5-7d87aea63fb7387b88b7fd8057feb9e42e53bd8c.zip
hdf5-7d87aea63fb7387b88b7fd8057feb9e42e53bd8c.tar.gz
hdf5-7d87aea63fb7387b88b7fd8057feb9e42e53bd8c.tar.bz2
Refactor all the 'H5VL_*_optional' callbacks to move the type of operation out
of the va_list, so it's at least possible for another connector to know what the operation is and decide whether to implement it or not. Added a new VOL sub-class called "introspect" where callbacks that report information about the connector or container can be placed. Added an 'opt_query' callback to this sub-class, for a connector to report back to the library whether a particular optional callback operation is supported. Also added a 'get_conn_cls' introspection callback, to retrieve the H5VL_class_t of a connector (either the "current" connector, H5VL_GET_CONN_LVL_CURR, or the terminal connector, H5VL_GET_CONN_LVL_TERM). Moved the "post open" operation from a file 'specific' operation to a file 'optional' operation, now that it's possible to detect (with the 'opt_query' introspection callback) whether a VOL connector implements an optional operation, without just returning an error. Added new internal VOL helper routines: H5VL_object_is_native, to determine if an object is in (or is a) native file, and H5VL_file_is_same, to determine if two objects are in (or are) the same terminal VOL connector's container. (And moved the special handling for FILE_IS_EQUAL operation out of internal VOL callback routine into H5VL_file_is_same) Made new dataset 'get' operation for H5Dvlen_get_buf_size, aligning it better with other 'get' operations in API. Fixed several issues with pass-through connectors, which are now passing the 'make check-passthrough-vol' tests again. A bunch of warning and style cleanups as well.
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 153ec2f..8b3d927 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -3669,8 +3669,9 @@ H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref)
{
void *vol_obj_file = NULL; /* File object pointer */
H5VL_loc_params_t loc_params; /* Location parameters */
- hid_t file_id = H5I_INVALID_HID; /* File ID for object */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID for object */
+ hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
@@ -3680,7 +3681,7 @@ H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref)
/* Retrieve VOL file from object */
if(H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_FILE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &vol_obj_file) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file from object")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file from object")
/* Check if the file's ID already exists */
if(H5I_find_id(vol_obj_file, H5I_FILE, &file_id) < 0)
@@ -3688,7 +3689,12 @@ H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref)
/* If the ID does not exist, register it with the VOL connector */
if(H5I_INVALID_HID == file_id) {
- if((file_id = H5VL_register(H5I_FILE, vol_obj_file, vol_obj->connector, app_ref)) < 0)
+ /* Set wrapper info in API context */
+ if(H5VL_set_vol_wrapper(vol_obj) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL wrapper info")
+ vol_wrapper_set = TRUE;
+
+ if((file_id = H5VL_wrap_register(H5I_FILE, vol_obj_file, app_ref)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
} /* end if */
else {
@@ -3701,6 +3707,10 @@ H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref)
ret_value = file_id;
done:
+ /* Reset object wrapping info in API context */
+ if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset VOL wrapper info")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_file_id() */