Signed-off-by: Jens Axboe <axboe@fb.com>
If not set, the contents of io buffers is defined by the other
options related to buffer contents. The setting can be any
pattern of bytes, and can be prefixed with 0x for hex values.
If not set, the contents of io buffers is defined by the other
options related to buffer contents. The setting can be any
pattern of bytes, and can be prefixed with 0x for hex values.
+ It may also be a string, where the string must then be
+ wrapped with "".
nrfiles=int Number of files to use for this job. Defaults to 1.
nrfiles=int Number of files to use for this job. Defaults to 1.
If set, fio will fill the IO buffers with this pattern. If not set, the contents
of IO buffers is defined by the other options related to buffer contents. The
setting can be any pattern of bytes, and can be prefixed with 0x for hex
If set, fio will fill the IO buffers with this pattern. If not set, the contents
of IO buffers is defined by the other options related to buffer contents. The
setting can be any pattern of bytes, and can be prefixed with 0x for hex
+values. It may also be a string, where the string must then be wrapped with
+"".
.TP
.BI nrfiles \fR=\fPint
Number of files to use for this job. Default: 1.
.TP
.BI nrfiles \fR=\fPint
Number of files to use for this job. Default: 1.
uint32_t pattern_length;
char *loc1, *loc2;
uint32_t pattern_length;
char *loc1, *loc2;
+ /*
+ * Check if it's a string input
+ */
+ loc1 = strchr(input, '\"');
+ if (loc1) {
+ do {
+ loc1++;
+ if (*loc1 == '\0' || *loc1 == '\"')
+ break;
+
+ pattern[i] = *loc1;
+ i++;
+ } while (i < max_size);
+
+ if (!i)
+ return 1;
+
+ goto fill;
+ }
+
+ /*
+ * No string, find out if it's decimal or hexidecimal
+ */
loc1 = strstr(input, "0x");
loc2 = strstr(input, "0X");
if (loc1 || loc2)
loc1 = strstr(input, "0x");
loc2 = strstr(input, "0X");
if (loc1 || loc2)
* Fill the pattern all the way to the end. This greatly reduces
* the number of memcpy's we have to do when verifying the IO.
*/
* Fill the pattern all the way to the end. This greatly reduces
* the number of memcpy's we have to do when verifying the IO.
*/
pattern_length = i;
while (i > 1 && i * 2 <= max_size) {
memcpy(&pattern[i], &pattern[0], i);
pattern_length = i;
while (i > 1 && i * 2 <= max_size) {
memcpy(&pattern[i], &pattern[0], i);