Net engine: move connection setup into ->init()
authorJens Axboe <jens.axboe@oracle.com>
Fri, 2 Mar 2007 07:55:48 +0000 (08:55 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 2 Mar 2007 07:55:48 +0000 (08:55 +0100)
Then it happens in the process own context, which means we can
define full send/receive jobs in a single job file and run them
from a single fio instance.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/net.c

index 84216ac1ddb144217da4d2e4ef5deabbbc6b5f8f..2381f7390ea3d0d9934599409ce6ddbadb4ab5b1 100644 (file)
@@ -210,7 +210,7 @@ static int fio_netio_setup_listen(struct thread_data *td, unsigned short port)
        return fio_netio_accept_connections(td, fd, &addr);
 }
 
        return fio_netio_accept_connections(td, fd, &addr);
 }
 
-static int fio_netio_setup(struct thread_data *td)
+static int fio_netio_init(struct thread_data *td)
 {
        char host[64], buf[128];
        unsigned short port;
 {
        char host[64], buf[128];
        unsigned short port;
@@ -264,12 +264,18 @@ static int fio_netio_setup(struct thread_data *td)
        return 0;
 }
 
        return 0;
 }
 
+static int fio_netio_setup(struct thread_data fio_unused *td)
+{
+       return 0;
+}
+
 static struct ioengine_ops ioengine = {
        .name           = "net",
        .version        = FIO_IOOPS_VERSION,
        .prep           = fio_netio_prep,
        .queue          = fio_netio_queue,
        .setup          = fio_netio_setup,
 static struct ioengine_ops ioengine = {
        .name           = "net",
        .version        = FIO_IOOPS_VERSION,
        .prep           = fio_netio_prep,
        .queue          = fio_netio_queue,
        .setup          = fio_netio_setup,
+       .init           = fio_netio_init,
        .flags          = FIO_SYNCIO | FIO_DISKLESSIO | FIO_SELFOPEN,
 };
 
        .flags          = FIO_SYNCIO | FIO_DISKLESSIO | FIO_SELFOPEN,
 };