[PATCH] Add 'bs_unaligned' option

If this is specified with 'bsrange', fio will use any byte size value
in the bs range for an io unit buffer length. Normally fio defaults to
using a multiple of the minimum bs size, as that is required for any
type of raw io.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/init.c b/init.c
index e4f866a..6ad3c64 100644
--- a/init.c
+++ b/init.c
@@ -349,6 +349,11 @@
 		.off1	= td_var_offset(norandommap),
 	},
 	{
+		.name	= "bs_unaligned",
+		.type	= FIO_OPT_STR_SET,
+		.off1	= td_var_offset(bs_unaligned),
+	},
+	{
 		.name = NULL,
 	},
 };
@@ -490,6 +495,8 @@
 		log_err("fio: norandommap given, verify disabled\n");
 		td->verify = VERIFY_NONE;
 	}
+	if (td->bs_unaligned && (td->odirect || td->io_ops->flags & FIO_RAWIO))
+		log_err("fio: bs_unaligned may not work with raw io\n");
 }
 
 /*
@@ -535,6 +542,9 @@
 		}
 	}
 
+	if (td->odirect)
+		td->io_ops->flags |= FIO_RAWIO;
+
 	fixup_options(td);
 
 	td->filetype = FIO_TYPE_FILE;
@@ -545,9 +555,6 @@
 			td->filetype = FIO_TYPE_CHAR;
 	}
 
-	if (td->odirect)
-		td->io_ops->flags |= FIO_RAWIO;
-
 	if (td->filename)
 		td->nr_uniq_files = 1;
 	else