init: use __log_buf() if we know buf != NULL
[fio.git] / options.c
index 1c28a0214c66c97f5e210202b5a6cb0086b82225..534233bdbc297251d040f605a84b37d21d1b51be 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1013,9 +1013,7 @@ static int parse_zoned_distribution(struct thread_data *td, const char *input,
                return ret;
        }
 
-       if (!ret)
-               td_zone_gen_index(td);
-       else {
+       if (ret) {
                for (i = 0; i < DDIR_RWDIR_CNT; i++)
                        td->o.zone_split_nr[i] = 0;
        }
@@ -1242,6 +1240,23 @@ int set_name_idx(char *target, size_t tlen, char *input, int index,
        return len;
 }
 
+char* get_name_by_idx(char *input, int index)
+{
+       unsigned int cur_idx;
+       char *fname, *str, *p;
+
+       p = str = strdup(input);
+
+       index %= get_max_name_idx(input);
+       for (cur_idx = 0; cur_idx <= index; cur_idx++)
+               fname = get_next_name(&str);
+
+       fname = strdup(fname);
+       free(p);
+
+       return fname;
+}
+
 static int str_filename_cb(void *data, const char *input)
 {
        struct thread_data *td = cb_data_to_td(data);
@@ -1847,6 +1862,17 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                          },
 
 #endif
+#ifdef CONFIG_IME
+                         { .ival = "ime_psync",
+                           .help = "DDN's IME synchronous IO engine",
+                         },
+                         { .ival = "ime_psyncv",
+                           .help = "DDN's IME synchronous IO engine using iovecs",
+                         },
+                         { .ival = "ime_aio",
+                           .help = "DDN's IME asynchronous IO engine",
+                         },
+#endif
 #ifdef CONFIG_LINUX_DEVDAX
                          { .ival = "dev-dax",
                            .help = "DAX Device based IO engine",
@@ -1864,6 +1890,11 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                          { .ival = "libpmem",
                            .help = "PMDK libpmem based IO engine",
                          },
+#endif
+#ifdef CONFIG_HTTP
+                         { .ival = "http",
+                           .help = "HTTP (WebDAV/S3) IO engine",
+                         },
 #endif
                },
        },
@@ -3208,6 +3239,30 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .help   = "Your platform does not support IO scheduler switching",
        },
 #endif
+       {
+               .name   = "zonemode",
+               .lname  = "Zone mode",
+               .help   = "Mode for the zonesize, zonerange and zoneskip parameters",
+               .type   = FIO_OPT_STR,
+               .off1   = offsetof(struct thread_options, zone_mode),
+               .def    = "none",
+               .category = FIO_OPT_C_IO,
+               .group  = FIO_OPT_G_ZONE,
+               .posval = {
+                          { .ival = "none",
+                            .oval = ZONE_MODE_NONE,
+                            .help = "no zoning",
+                          },
+                          { .ival = "strided",
+                            .oval = ZONE_MODE_STRIDED,
+                            .help = "strided mode - random I/O is restricted to a single zone",
+                          },
+                          { .ival = "zbd",
+                            .oval = ZONE_MODE_ZBD,
+                            .help = "zoned block device mode - random I/O selects one of multiple zones randomly",
+                          },
+               },
+       },
        {
                .name   = "zonesize",
                .lname  = "Zone size",
@@ -3241,6 +3296,52 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .category = FIO_OPT_C_IO,
                .group  = FIO_OPT_G_ZONE,
        },
+       {
+               .name   = "read_beyond_wp",
+               .lname  = "Allow reads beyond the zone write pointer",
+               .type   = FIO_OPT_BOOL,
+               .off1   = offsetof(struct thread_options, read_beyond_wp),
+               .help   = "Allow reads beyond the zone write pointer",
+               .def    = "0",
+               .category = FIO_OPT_C_IO,
+               .group  = FIO_OPT_G_INVALID,
+       },
+       {
+               .name   = "max_open_zones",
+               .lname  = "Maximum number of open zones",
+               .type   = FIO_OPT_INT,
+               .off1   = offsetof(struct thread_options, max_open_zones),
+               .maxval = FIO_MAX_OPEN_ZBD_ZONES,
+               .help   = "Limit random writes to SMR drives to the specified"
+                         " number of sequential zones",
+               .def    = "0",
+               .category = FIO_OPT_C_IO,
+               .group  = FIO_OPT_G_INVALID,
+       },
+       {
+               .name   = "zone_reset_threshold",
+               .lname  = "Zone reset threshold",
+               .help   = "Zoned block device reset threshold",
+               .type   = FIO_OPT_FLOAT_LIST,
+               .maxlen = 1,
+               .off1   = offsetof(struct thread_options, zrt),
+               .minfp  = 0,
+               .maxfp  = 1,
+               .category = FIO_OPT_C_IO,
+               .group  = FIO_OPT_G_ZONE,
+       },
+       {
+               .name   = "zone_reset_frequency",
+               .lname  = "Zone reset frequency",
+               .help   = "Zoned block device zone reset frequency in HZ",
+               .type   = FIO_OPT_FLOAT_LIST,
+               .maxlen = 1,
+               .off1   = offsetof(struct thread_options, zrf),
+               .minfp  = 0,
+               .maxfp  = 1,
+               .category = FIO_OPT_C_IO,
+               .group  = FIO_OPT_G_ZONE,
+       },
        {
                .name   = "lockmem",
                .lname  = "Lock memory",