Fix bug with random IO and network connections
[fio.git] / engines / net.c
index cc707db972178a5cee9c8815d15ce6f97d963f16..1a403bdb95688319ef53c0324cd57b368a1741e4 100644 (file)
@@ -231,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);
 
@@ -269,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));;
@@ -278,13 +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) {
-                       if (td->o.size)
-                               f->real_file_size = td->o.size / td->o.nr_files;
-                       else
-                               f->real_file_size = -1ULL;
-               }
        }
 
        return 0;