summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2019-10-29 19:38:50 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2019-11-08 21:14:33 (GMT)
commit1dbec40d465072540f8507c524ae7b909a6b1cf0 (patch)
tree111dd9bb4925da3be08a4a5ae63f7bffb16d6ee0 /src/H5F.c
parentafd4b291315e39e3966eadaf8ae9894b30e9504e (diff)
downloadhdf5-1dbec40d465072540f8507c524ae7b909a6b1cf0.zip
hdf5-1dbec40d465072540f8507c524ae7b909a6b1cf0.tar.gz
hdf5-1dbec40d465072540f8507c524ae7b909a6b1cf0.tar.bz2
Implement H5VLget_file_type() to return a copy of a datatype with the
location set to be in a file. Only meant to be used by VOL connectors. Implement H5VLpeek_connector_id() to support connectors querying their own IDs. Fix app_ref with connector IDs in a couple places (external VOLs registered as default through ENV should be visible to the application). Modify vlen and reference interfaces to work with arbitrary VOL connectors. Implement file "post open" specific callback, to enable connectors to update their file structs after a wrap context has been set.
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/H5F.c b/src/H5F.c
index d216cd2..35176fc 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -624,6 +624,7 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
H5F_t *new_file = NULL; /* File struct for new file */
H5P_genplist_t *plist; /* Property list pointer */
H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+ H5VL_object_t *vol_obj = NULL; /* VOL object for file */
hid_t ret_value; /* return value */
FUNC_ENTER_API(H5I_INVALID_HID)
@@ -682,6 +683,14 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
if((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
+ /* Get the file object */
+ if(NULL == (vol_obj = H5VL_vol_object(ret_value)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid object identifier")
+
+ /* Make the post open callback */
+ if(H5VL_file_specific(vol_obj, H5VL_FILE_POST_OPEN, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to make file post open callback")
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fcreate() */
@@ -712,6 +721,7 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id)
H5F_t *new_file = NULL; /* File struct for new file */
H5P_genplist_t *plist; /* Property list pointer */
H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+ H5VL_object_t *vol_obj = NULL; /* VOL object for file */
hid_t ret_value; /* return value */
FUNC_ENTER_API(H5I_INVALID_HID)
@@ -756,6 +766,14 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id)
if((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
+ /* Get the file object */
+ if(NULL == (vol_obj = H5VL_vol_object(ret_value)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid object identifier")
+
+ /* Make the post open callback */
+ if(H5VL_file_specific(vol_obj, H5VL_FILE_POST_OPEN, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to make file post open callback")
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fopen() */
@@ -941,6 +959,14 @@ H5Freopen(hid_t file_id)
if((ret_value = H5VL_register(H5I_FILE, file, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
+ /* Get the file object */
+ if(NULL == (vol_obj = H5VL_vol_object(ret_value)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid object identifier")
+
+ /* Make the post open callback */
+ if(H5VL_file_specific(vol_obj, H5VL_FILE_POST_OPEN, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to make file post open callback")
+
done:
/* XXX (VOL MERGE): If registration fails, file will not be closed */
FUNC_LEAVE_API(ret_value)