summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.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/H5Fint.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/H5Fint.c')
-rw-r--r--src/H5Fint.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 2ebcd94..435c1be 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -1138,9 +1138,15 @@ done:
HDONE_ERROR(H5E_FILE, H5E_CANTDEC, NULL, "can't close property list")
f->shared = H5FL_FREE(H5F_shared_t, f->shared);
- }
+ } /* end if */
+
+ /* Free VOL object */
+ if(f->vol_obj)
+ if(H5VL_free_object(f->vol_obj) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CANTDEC, NULL, "unable to free VOL object")
+
f = H5FL_FREE(H5F_t, f);
- }
+ } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__new() */
@@ -1407,6 +1413,9 @@ H5F__dest(H5F_t *f, hbool_t flush)
/* Free the non-shared part of the file */
f->open_name = (char *)H5MM_xfree(f->open_name);
f->actual_name = (char *)H5MM_xfree(f->actual_name);
+ if(f->vol_obj && H5VL_free_object(f->vol_obj) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object")
+ f->vol_obj = NULL;
if(H5FO_top_dest(f) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "problems closing file")
f->shared = NULL;
@@ -1820,6 +1829,35 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5F__post_open
+ *
+ * Purpose: Finishes file open after wrapper context for file has been
+ * set.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F__post_open(H5F_t *f)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity check arguments */
+ HDassert(f);
+
+ /* Store a vol object in the file struct */
+ if(NULL == (f->vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, f, f->shared->vol_id)))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't create VOL object")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F__flush() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5F_flush_phase1
*
* Purpose: First phase of flushing cached data.