Fix bug with random IO and network connections
[fio.git] / engines / net.c
index 66f1e607ed7f258e6b804ae4471fc23fa3e21c19..1a403bdb95688319ef53c0324cd57b368a1741e4 100644 (file)
@@ -15,7 +15,6 @@
 #include <sys/poll.h>
 
 #include "../fio.h"
-#include "../os.h"
 
 struct netio_data {
        int listenfd;
@@ -232,6 +231,10 @@ static int fio_netio_init(struct thread_data *td)
                log_err("fio: network connections must be read OR write\n");
                return 1;
        }
+       if (td_random(td)) {
+               log_err("fio: network IO can't be random\n");
+               return 1;
+       }
 
        strcpy(buf, td->o.filename);
 
@@ -270,8 +273,6 @@ static void fio_netio_cleanup(struct thread_data *td)
 static int fio_netio_setup(struct thread_data *td)
 {
        struct netio_data *nd;
-       struct fio_file *f;
-       unsigned int i;
 
        if (!td->io_ops->data) {
                nd = malloc(sizeof(*nd));;
@@ -279,9 +280,6 @@ static int fio_netio_setup(struct thread_data *td)
                memset(nd, 0, sizeof(*nd));
                nd->listenfd = -1;
                td->io_ops->data = nd;
-
-               for_each_file(td, f, i)
-                       f->real_file_size = -1ULL;
        }
 
        return 0;