nr_files conflict with filename
authorJens Axboe <jens.axboe@oracle.com>
Tue, 13 Mar 2007 13:02:16 +0000 (14:02 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 13 Mar 2007 13:02:16 +0000 (14:02 +0100)
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 <jens.axboe@oracle.com>
HOWTO
engines/net.c
examples/netio
init.c

diff --git a/HOWTO b/HOWTO
index 5df2607e874a35fa131db5f36a0095af2dfe917a..24beeb8adbd5fa1363d7305c279b6c0d288275c8 100644 (file)
--- 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.
 
index c2f45e5f1a870510af6ff09d18f0ccc355e5dbf6..cd1fda9f54372526ddf0709c31941de77675cdd5 100644 (file)
@@ -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;
        }
 
index 00ca4fd29e910bcb9afe0a648e56e141475ff79d..d173a9f27be2e4ac6239832db4b63ac246c7739c 100644 (file)
@@ -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 a3d1d5a87e9fe1c0b7d87d2e0b49a0a744989f53..1cb384570200d5d575201de47da48b1bc08ef92b 100644 (file)
--- 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);