summaryrefslogtreecommitdiffstats
path: root/src/H5VLnative_file.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-12-20 04:41:37 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-12-20 04:41:37 (GMT)
commit58cf79532129a0df49c5516506cfe8be5e09d3eb (patch)
tree768d5f91c9b821329bd06206b6510b5bf31c9ec7 /src/H5VLnative_file.c
parentb55a584fd5b3aac6f2514fba41a6182030b497ae (diff)
downloadhdf5-58cf79532129a0df49c5516506cfe8be5e09d3eb.zip
hdf5-58cf79532129a0df49c5516506cfe8be5e09d3eb.tar.gz
hdf5-58cf79532129a0df49c5516506cfe8be5e09d3eb.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/H5VLnative_file.c')
-rw-r--r--src/H5VLnative_file.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c
index fb3cb7e..005859d 100644
--- a/src/H5VLnative_file.c
+++ b/src/H5VLnative_file.c
@@ -305,15 +305,6 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type,
FUNC_ENTER_PACKAGE
switch(specific_type) {
- /* Finalize H5Fopen */
- case H5VL_FILE_POST_OPEN:
- {
- /* Call package routine */
- if(H5F__post_open((H5F_t *)obj) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't finish opening file")
- break;
- }
-
/* H5Fflush */
case H5VL_FILE_FLUSH:
{
@@ -450,10 +441,10 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type,
+ hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
{
H5F_t *f = NULL; /* File */
- H5VL_native_file_optional_t optional_type = HDva_arg(arguments, H5VL_native_file_optional_t);
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -565,8 +556,8 @@ H5VL__native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR
{
size_t *max_size_ptr = HDva_arg(arguments, size_t *);
size_t *min_clean_size_ptr = HDva_arg(arguments, size_t *);
- size_t *cur_size_ptr = HDva_arg(arguments, size_t *);
- int *cur_num_entries_ptr = HDva_arg(arguments, int *);
+ size_t *cur_size_ptr = HDva_arg(arguments, size_t *);
+ int *cur_num_entries_ptr = HDva_arg(arguments, int *);
uint32_t cur_num_entries;
/* Go get the size data */
@@ -706,7 +697,7 @@ H5VL__native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR
unsigned *misses = HDva_arg(arguments, unsigned *);
unsigned *evictions = HDva_arg(arguments, unsigned *);
unsigned *bypasses = HDva_arg(arguments, unsigned *);
-
+
/* Sanity check */
if(NULL == f->shared->page_buf)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "page buffering not enabled on file")
@@ -828,6 +819,15 @@ H5VL__native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR
}
#endif /* H5_HAVE_PARALLEL */
+ /* Finalize H5Fopen */
+ case H5VL_NATIVE_FILE_POST_OPEN:
+ {
+ /* Call package routine */
+ if(H5F__post_open((H5F_t *)obj) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't finish opening file")
+ break;
+ }
+
default:
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation")
} /* end switch */