Merge branch 'master' into gfio
[fio.git] / engines / net.c
index 12f49a2a67ca2f1d7241b42efdc45543b77fd868..566ad2d7482c8f19e3597b9d578882f1ce351feb 100644 (file)
@@ -466,7 +466,7 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
 {
        struct netio_data *nd = td->io_ops->data;
        struct netio_options *o = td->eo;
-       int type, domain, optval;
+       int type, domain;
 
        if (o->proto == FIO_TYPE_TCP) {
                domain = AF_INET;
@@ -491,7 +491,8 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
 
 #ifdef CONFIG_TCP_NODELAY
        if (o->nodelay && o->proto == FIO_TYPE_TCP) {
-               optval = 1;
+               int optval = 1;
+
                if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) {
                        log_err("fio: cannot set TCP_NODELAY option on socket (%s), disable with 'nodelay=0'\n", strerror(errno));
                        return 1;
@@ -530,7 +531,7 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
        struct netio_data *nd = td->io_ops->data;
        struct netio_options *o = td->eo;
        socklen_t socklen = sizeof(nd->addr);
-       int state, optval;
+       int state;
 
        if (o->proto == FIO_TYPE_UDP) {
                f->fd = nd->listenfd;
@@ -553,7 +554,8 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
 
 #ifdef CONFIG_TCP_NODELAY
        if (o->nodelay && o->proto == FIO_TYPE_TCP) {
-               optval = 1;
+               int optval = 1;
+
                if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) {
                        log_err("fio: cannot set TCP_NODELAY option on socket (%s), disable with 'nodelay=0'\n", strerror(errno));
                        return 1;
@@ -976,7 +978,7 @@ static struct ioengine_ops ioengine_rw = {
        .options                = options,
        .option_struct_size     = sizeof(struct netio_options),
        .flags                  = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
-                                 FIO_PIPEIO,
+                                 FIO_PIPEIO | FIO_BIT_BASED,
 };
 
 static int str_hostname_cb(void *data, const char *input)