Allow 'b' postfix for integer values

Fio would previously regard '1tb' as just 1 byte, since the 'b' postfix
isn't a valid multiplier. Allow the 'b' as well, just ignore it.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/parse.c b/parse.c
index 7821861..a55e52b 100644
--- a/parse.c
+++ b/parse.c
@@ -162,9 +162,19 @@
 	if (*val == LONG_MAX && errno == ERANGE)
 		return 1;
 
-	if (kilo)
-		*val *= get_mult_bytes(str[len - 1], data);
-	else
+	if (kilo) {
+		const char *p;
+		/*
+		 * if the last char is 'b' or 'B', the user likely used
+		 * "1gb" instead of just "1g". If the second to last is also
+		 * a letter, adjust.
+		 */
+		p = str + len - 1;
+		if ((*p == 'b' || *p == 'B') && isalpha(*(p - 1)))
+			--p;
+
+		*val *= get_mult_bytes(*p, data);
+	} else
 		*val *= get_mult_time(str[len - 1]);
 
 	return 0;