X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=options.c;h=1e91b3e9e23a79eb780b35c22e9cd7681e82ab58;hb=2fbe1e195999e23c95b08d03eadac0b5f95330e7;hp=0d64e7c0581e9ad912d85315fcc85cab1cd06506;hpb=20c7a244e75e4aa705a31a74e7067de4c890dff7;p=fio.git diff --git a/options.c b/options.c index 0d64e7c0..1e91b3e9 100644 --- a/options.c +++ b/options.c @@ -1476,6 +1476,26 @@ static int str_size_cb(void *data, unsigned long long *__val) return 0; } +static int str_io_size_cb(void *data, unsigned long long *__val) +{ + struct thread_data *td = cb_data_to_td(data); + unsigned long long v = *__val; + + if (parse_is_percent_uncapped(v)) { + td->o.io_size = 0; + td->o.io_size_percent = -1ULL - v; + if (td->o.io_size_percent > 100) { + log_err("fio: io_size values greater than 100%% aren't supported\n"); + return 1; + } + dprint(FD_PARSE, "SET io_size_percent %d\n", + td->o.io_size_percent); + } else + td->o.io_size = v; + + return 0; +} + static int str_write_bw_log_cb(void *data, const char *str) { struct thread_data *td = cb_data_to_td(data); @@ -1852,11 +1872,6 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { { .ival = "cpuio", .help = "CPU cycle burner engine", }, -#ifdef CONFIG_GUASI - { .ival = "guasi", - .help = "GUASI IO engine", - }, -#endif #ifdef CONFIG_RDMA { .ival = "rdma", .help = "RDMA IO engine", @@ -2043,6 +2058,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .alias = "io_limit", .lname = "IO Size", .type = FIO_OPT_STR_VAL, + .cb = str_io_size_cb, .off1 = offsetof(struct thread_options, io_size), .help = "Total size of I/O to be performed", .interval = 1024 * 1024, @@ -3717,14 +3733,32 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { { .name = "sync", .lname = "Synchronous I/O", - .type = FIO_OPT_BOOL, + .type = FIO_OPT_STR, .off1 = offsetof(struct thread_options, sync_io), - .help = "Use O_SYNC for buffered writes", - .def = "0", - .parent = "buffered", + .help = "Use synchronous write IO", + .def = "none", .hide = 1, .category = FIO_OPT_C_IO, .group = FIO_OPT_G_IO_TYPE, + .posval = { + { .ival = "none", + .oval = 0, + }, + { .ival = "0", + .oval = 0, + }, + { .ival = "sync", + .oval = O_SYNC, + }, + { .ival = "1", + .oval = O_SYNC, + }, +#ifdef O_DSYNC + { .ival = "dsync", + .oval = O_DSYNC, + }, +#endif + }, }, #ifdef FIO_HAVE_WRITE_HINT {