X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=options.c;h=ba57e4469d4ab4baf202b51c47702614b767941e;hp=f05b786bcf742c09b5488197a8d4ba88939d3e5d;hb=cbf69f0dbd61bce2438e7052b0e124735b27a2d4;hpb=5ec10eaad3b09875b91e19a20bbdfa06f2117562 diff --git a/options.c b/options.c index f05b786b..ba57e446 100644 --- a/options.c +++ b/options.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "fio.h" #include "parse.h" @@ -269,6 +270,36 @@ static int str_fst_cb(void *data, const char *str) return 0; } +static int check_dir(struct thread_data *td, char *fname) +{ + char file[PATH_MAX], *dir; + struct stat sb; + int elen = 0; + + if (td->o.directory) { + strcpy(file, td->o.directory); + elen = strlen(file); + } + + sprintf(file + elen, "/%s", fname); + dir = dirname(file); + + if (lstat(dir, &sb) < 0) { + int ret = errno; + + log_err("fio: %s is not a directory\n", dir); + td_verror(td, ret, "lstat"); + return 1; + } + + if (!S_ISDIR(sb.st_mode)) { + log_err("fio: %s is not a directory\n", dir); + return 1; + } + + return 0; +} + static int str_filename_cb(void *data, const char *input) { struct thread_data *td = data; @@ -285,6 +316,10 @@ static int str_filename_cb(void *data, const char *input) while ((fname = strsep(&str, ":")) != NULL) { if (!strlen(fname)) break; + if (check_dir(td, fname)) { + free(p); + return 1; + } add_file(td, fname); td->o.nr_files++; } @@ -299,8 +334,10 @@ static int str_directory_cb(void *data, const char fio_unused *str) struct stat sb; if (lstat(td->o.directory, &sb) < 0) { + int ret = errno; + log_err("fio: %s is not a directory\n", td->o.directory); - td_verror(td, errno, "lstat"); + td_verror(td, ret, "lstat"); return 1; } if (!S_ISDIR(sb.st_mode)) { @@ -637,6 +674,14 @@ static struct fio_option options[] = { .help = "Accept potential duplicate random blocks", .parent = "rw", }, + { + .name = "softrandommap", + .type = FIO_OPT_BOOL, + .off1 = td_var_offset(softrandommap), + .help = "Allow randommap to fail and continue witout", + .parent = "norandommap", + .def = "0", + }, { .name = "nrfiles", .type = FIO_OPT_INT, @@ -943,11 +988,7 @@ static struct fio_option options[] = { }, { .name = "rwmixcycle", - .type = FIO_OPT_INT, - .off1 = td_var_offset(rwmixcycle), - .help = "Cycle period for mixed read/write workloads (msec)", - .def = "500", - .parent = "rwmixread", + .type = FIO_OPT_DEPRECATED, }, { .name = "nice", @@ -1174,6 +1215,12 @@ static struct fio_option options[] = { .off1 = td_var_offset(zero_buffers), .help = "Init IO buffers to all zeroes", }, + { + .name = "refill_buffers", + .type = FIO_OPT_STR_SET, + .off1 = td_var_offset(refill_buffers), + .help = "Refill IO buffers on every IO submit", + }, #ifdef FIO_HAVE_DISK_UTIL { .name = "disk_util",