X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=init.c;h=60c7cff405d70d8e974545026e2fe659b512b7ed;hp=ab38b334a9195b089d686785c9ec0d0d02d17dc4;hb=6308ef297145e73add65ba86bfdbeaf967957d1f;hpb=f6931a1dd35896433c8cc2e10de51372a2c496c4 diff --git a/init.c b/init.c index ab38b334..60c7cff4 100644 --- a/init.c +++ b/init.c @@ -448,19 +448,6 @@ static void dump_opt_list(struct thread_data *td) } } -static void fio_dump_options_free(struct thread_data *td) -{ - while (!flist_empty(&td->opt_list)) { - struct print_option *p; - - p = flist_first_entry(&td->opt_list, struct print_option, list); - flist_del_init(&p->list); - free(p->name); - free(p->value); - free(p); - } -} - static void copy_opt_list(struct thread_data *dst, struct thread_data *src) { struct flist_head *entry; @@ -646,6 +633,11 @@ static int fixup_options(struct thread_data *td) ret |= 1; } + if (o->zone_mode == ZONE_MODE_ZBD && !o->create_serialize) { + log_err("fio: --zonemode=zbd and --create_serialize=0 are not compatible.\n"); + ret |= 1; + } + if (o->zone_mode == ZONE_MODE_STRIDED && !o->zone_size) { log_err("fio: --zonesize must be specified when using --zonemode=strided.\n"); ret |= 1; @@ -961,7 +953,9 @@ static int fixup_options(struct thread_data *td) /* * Fix these up to be nsec internally */ - o->max_latency *= 1000ULL; + for_each_rw_ddir(ddir) + o->max_latency[ddir] *= 1000ULL; + o->latency_target *= 1000ULL; return ret; @@ -1109,11 +1103,8 @@ int ioengine_load(struct thread_data *td) if (!ops) goto fail; - if (ops == td->io_ops && dlhandle == td->io_ops->dlhandle) { - if (dlhandle) - dlclose(dlhandle); + if (ops == td->io_ops && dlhandle == td->io_ops->dlhandle) return 0; - } if (dlhandle && dlhandle != td->io_ops->dlhandle) dlclose(dlhandle); @@ -1241,7 +1232,8 @@ enum { FPRE_NONE = 0, FPRE_JOBNAME, FPRE_JOBNUM, - FPRE_FILENUM + FPRE_FILENUM, + FPRE_CLIENTUID }; static struct fpre_keyword { @@ -1252,6 +1244,7 @@ static struct fpre_keyword { { .keyword = "$jobname", .key = FPRE_JOBNAME, }, { .keyword = "$jobnum", .key = FPRE_JOBNUM, }, { .keyword = "$filenum", .key = FPRE_FILENUM, }, + { .keyword = "$clientuid", .key = FPRE_CLIENTUID, }, { .keyword = NULL, }, }; @@ -1341,6 +1334,21 @@ static char *make_filename(char *buf, size_t buf_size,struct thread_options *o, } break; } + case FPRE_CLIENTUID: { + int ret; + ret = snprintf(dst, dst_left, "%s", client_sockaddr_str); + if (ret < 0) + break; + else if (ret > dst_left) { + log_err("fio: truncated filename\n"); + dst += dst_left; + dst_left = 0; + } else { + dst += ret; + dst_left -= ret; + } + break; + } default: assert(0); break;