From: Jens Axboe Date: Tue, 13 Mar 2007 13:02:16 +0000 (+0100) Subject: nr_files conflict with filename X-Git-Tag: fio-1.14~14 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=9f9214f243701626a04b4a0f9aceec03b8b40e0f nr_files conflict with filename If nr_files is larger than the given number of files, it has to be lowered. Assume that if the user gives a set of filenames that this is the number he wants, otherwise he should use not use a filename setting. Signed-off-by: Jens Axboe --- diff --git a/HOWTO b/HOWTO index 5df2607e..24beeb8a 100644 --- a/HOWTO +++ b/HOWTO @@ -205,7 +205,7 @@ filename=str Fio normally makes up a filename based on the job name, files between threads in a job or several jobs, specify a filename for each of them to override the default. If the ioengine used is 'net', the filename is the host and - port to connect to in the format of =host:port. If the + port to connect to in the format of =host/port. If the ioengine is file based, you can specify a number of files by seperating the names with a ':' colon. So if you wanted a job to open /dev/sda and /dev/sdb as the two working files, @@ -306,7 +306,7 @@ ioengine=str Defines how the job issues io to the file. The following net Transfer over the network to given host:port. 'filename' must be set appropriately to - filename=host:port regardless of send + filename=host/port regardless of send or receive, if the latter only the port argument is used. diff --git a/engines/net.c b/engines/net.c index c2f45e5f..cd1fda9f 100644 --- a/engines/net.c +++ b/engines/net.c @@ -239,9 +239,9 @@ static int fio_netio_init(struct thread_data *td) strcpy(buf, td->filename); - sep = strchr(buf, ':'); + sep = strchr(buf, '/'); if (!sep) { - log_err("fio: bad network host:port <<%s>>\n", td->filename); + log_err("fio: bad network host/port <<%s>>\n", td->filename); return 1; } diff --git a/examples/netio b/examples/netio index 00ca4fd2..d173a9f2 100644 --- a/examples/netio +++ b/examples/netio @@ -1,7 +1,7 @@ # Example network job, just defines two clients that send/recv data [global] ioengine=net -filename=localhost:8888 +filename=localhost/8888 size=4k size=10g diff --git a/init.c b/init.c index a3d1d5a8..1cb38457 100644 --- a/init.c +++ b/init.c @@ -753,8 +753,11 @@ static void fixup_options(struct thread_data *td) td->iodepth_batch = td->iodepth; if (!td->nr_files) - td->nr_files = td->open_files; - else if (td->open_files > td->nr_files || !td->open_files) + td->nr_files = td->files_index; + else if (td->nr_files > td->files_index) + td->nr_files = td->files_index; + + if (td->open_files > td->nr_files || !td->open_files) td->open_files = td->nr_files; } @@ -1106,9 +1109,6 @@ static int str_filename_cb(void *data, const char *input) struct thread_data *td = data; char *fname, *str, *p; - if (!td->filename) - td->nr_files = 0; - p = str = strdup(input); strip_blank_front(&str); @@ -1118,7 +1118,6 @@ static int str_filename_cb(void *data, const char *input) if (!strlen(fname)) break; add_file(td, fname); - td->nr_files++; } free(p);