X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Fnet.c;h=2381f7390ea3d0d9934599409ce6ddbadb4ab5b1;hp=55b2128e8b3f8c1fdc26fea9a0c331762a81e7be;hb=fd1ff8ed8d2b62c07c6117dfd0e53467ca71662a;hpb=e1161c325f7866bae879e686d1c673ca32ab09ae diff --git a/engines/net.c b/engines/net.c index 55b2128e..2381f739 100644 --- a/engines/net.c +++ b/engines/net.c @@ -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); } -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; @@ -223,7 +223,7 @@ static int fio_netio_setup(struct thread_data *td) return 1; } - if (td->iomix) { + if (td_rw(td)) { log_err("fio: network connections must be read OR write\n"); return 1; } @@ -241,7 +241,7 @@ static int fio_netio_setup(struct thread_data *td) strcpy(host, buf); port = atoi(sep); - if (td->ddir == DDIR_READ) { + if (td_read(td)) { send_to_net(td) = 0; ret = fio_netio_setup_listen(td, port); } else { @@ -260,6 +260,12 @@ static int fio_netio_setup(struct thread_data *td) f->real_file_size = f->file_size; } + td->nr_open_files = td->nr_files; + return 0; +} + +static int fio_netio_setup(struct thread_data fio_unused *td) +{ return 0; } @@ -269,7 +275,8 @@ static struct ioengine_ops ioengine = { .prep = fio_netio_prep, .queue = fio_netio_queue, .setup = fio_netio_setup, - .flags = FIO_SYNCIO | FIO_NETIO, + .init = fio_netio_init, + .flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_SELFOPEN, }; static void fio_init fio_netio_register(void)