summaryrefslogtreecommitdiffstats
path: root/src/H5FDsplitter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDsplitter.c')
-rw-r--r--src/H5FDsplitter.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c
index 73c898a..3113e8b 100644
--- a/src/H5FDsplitter.c
+++ b/src/H5FDsplitter.c
@@ -129,6 +129,8 @@ static herr_t H5FD__splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closin
static herr_t H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__splitter_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD__splitter_unlock(H5FD_t *_file);
+static herr_t H5FD__splitter_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input,
+ void **output);
static const H5FD_class_t H5FD_splitter_g = {
"splitter", /* name */
@@ -163,6 +165,7 @@ static const H5FD_class_t H5FD_splitter_g = {
H5FD__splitter_lock, /* lock */
H5FD__splitter_unlock, /* unlock */
NULL, /* del */
+ H5FD__splitter_ctl, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -1145,6 +1148,63 @@ done:
} /* end H5FD__splitter_unlock */
/*-------------------------------------------------------------------------
+ * Function: H5FD__splitter_ctl
+ *
+ * Purpose: Splitter VFD version of the ctl callback.
+ *
+ * The desired operation is specified by the op_code
+ * parameter.
+ *
+ * The flags parameter controls management of op_codes that
+ * are unknown to the callback
+ *
+ * The input and output parameters allow op_code specific
+ * input and output
+ *
+ * At present, this VFD supports no op codes of its own and
+ * simply passes ctl calls on to the R/W channel VFD.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__splitter_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input, void **output)
+{
+ H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity checks */
+ HDassert(file);
+ HDassert(H5FD_SPLITTER == file->pub.driver_id);
+
+ switch (op_code) {
+ /* Unknown op code */
+ default:
+ if (flags & H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG) {
+ /* Pass ctl call down to R/W channel VFD */
+ if (H5FDctl(file->rw_file, op_code, flags, input, output) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "VFD ctl request failed")
+ }
+ else {
+ /* If no valid VFD routing flag is specified, fail for unknown op code
+ * if H5FD_CTL__FAIL_IF_UNKNOWN_FLAG flag is set.
+ */
+ if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL,
+ "VFD ctl request failed (unknown op code and fail if unknown flag is set)")
+ }
+
+ break;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__splitter_ctl() */
+
+/*-------------------------------------------------------------------------
* Function: H5FD__splitter_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.