Move handling of possible values into the option parser

Eliminates the need for a callback for any FIO_OPT_STR type
option, unless it needs to do something there other than just
setting the variable.

The possible options are not in an array of value pairs, so we
can easily match an string option with an integer output value.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/parse.h b/parse.h
index 7374c25..214e56b 100644
--- a/parse.h
+++ b/parse.h
@@ -17,6 +17,16 @@
 };
 
 /*
+ * Match a possible value string with the integer option.
+ */
+struct value_pair {
+	const char *ival;		/* string option */
+	unsigned int oval;		/* output value */
+};
+
+#define PARSE_MAX_VP	16
+
+/*
  * Option define
  */
 struct fio_option {
@@ -33,7 +43,7 @@
 	void *cb;			/* callback */
 	const char *help;		/* help text for option */
 	const char *def;		/* default setting */
-	const char *posval[16];		/* possible values */
+	const struct value_pair posval[PARSE_MAX_VP];/* possible values */
 };
 
 typedef int (str_cb_fn)(void *, char *);