Recent changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit 468a9476c27142fbb9be64ae1d570254125d16cc:

  Fio 1.99.12 (2011-11-09 20:26:58 +0100)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Steven Lang (1):
      Fix parsing of ioengine strings

 parse.c |   77 +++++++++++++++++++++++++++++++++++---------------------------
 1 files changed, 43 insertions(+), 34 deletions(-)

---

Diff of recent changes:

diff --git a/parse.c b/parse.c
index 9a65e31..8aaf799 100644
--- a/parse.c
+++ b/parse.c
@@ -501,45 +501,54 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
 	case FIO_OPT_STR_STORE: {
 		fio_opt_str_fn *fn = o->cb;
 
-		posval_sort(o, posval);
-
-		if ((o->roff1 || o->off1) && !o->posval[0].ival) {
-			vp = NULL;
-			goto match;
+		if (o->roff1 || o->off1) {
+			if (o->roff1)
+				cp = (char **) o->roff1;
+			else if (o->off1)
+				cp = td_var(data, o->off1);
+
+			*cp = strdup(ptr);
+		} else {
+			cp = NULL;
 		}
 
-		ret = 1;
-		for (i = 0; i < PARSE_MAX_VP; i++) {
-			vp = &posval[i];
-			if (!vp->ival || vp->ival[0] == '\0')
-				continue;
-			all_skipped = 0;
-			if (!strncmp(vp->ival, ptr, opt_len(ptr))) {
-				char *rest;
+		if (fn)
+			ret = fn(data, ptr);
+		else if (o->posval[0].ival) {
+			posval_sort(o, posval);
 
-				ret = 0;
-				if (vp->cb)
-					fn = vp->cb;
-match:
-				if (o->roff1)
-					cp = (char **) o->roff1;
-				else
-					cp = td_var(data, o->off1);
-				*cp = strdup(ptr);
-				rest = strstr(*cp, ":");
-				if (rest) {
-					*rest = '\0';
-					ptr = rest + 1;
-				} else if (vp && vp->cb)
-					ptr = NULL;
-				break;
+			ret = 1;
+			for (i = 0; i < PARSE_MAX_VP; i++) {
+				vp = &posval[i];
+				if (!vp->ival || vp->ival[0] == '\0')
+					continue;
+				all_skipped = 0;
+				if (!strncmp(vp->ival, ptr, opt_len(ptr))) {
+					char *rest;
+
+					ret = 0;
+					if (vp->cb)
+						fn = vp->cb;
+					rest = strstr(*cp ?: ptr, ":");
+					if (rest) {
+						if (*cp)
+							*rest = '\0';
+						ptr = rest + 1;
+					} else
+						ptr = NULL;
+					break;
+				}
 			}
 		}
 
-		if (ret && !all_skipped)
-			show_option_values(o);
-		else if (fn && ptr)
-			ret = fn(data, ptr);
+		if (!all_skipped) {
+			if (ret && !*cp)
+				show_option_values(o);
+			else if (ret && *cp)
+				ret = 0;
+			else if (fn && ptr)
+				ret = fn(data, ptr);
+		}
 
 		break;
 	}
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux