netsplice: fix a few typos
authorJens Axboe <jens.axboe@oracle.com>
Fri, 22 Jun 2007 18:40:10 +0000 (20:40 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 22 Jun 2007 18:40:10 +0000 (20:40 +0200)
It actually works now.

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

index 4936cc24fbc74c9c3b538bbbb382c5214f970ba6..a67432bfcdfb93f7663e4e21f32933fbeb526238 100644 (file)
@@ -63,7 +63,7 @@ static int splice_in(struct thread_data *td, struct io_u *io_u)
        int bytes = 0;
 
        while (len) {
-               int ret = splice(nd->pipes[1], NULL, f->fd, NULL, len, 0);
+               int ret = splice(f->fd, NULL, nd->pipes[1], NULL, len, 0);
 
                if (ret < 0) {
                        if (!bytes)
@@ -74,6 +74,7 @@ static int splice_in(struct thread_data *td, struct io_u *io_u)
                        break;
 
                bytes += ret;
+               len -= ret;
        }
 
        return bytes;
@@ -131,6 +132,7 @@ static int vmsplice_io_u_out(struct thread_data *td, struct io_u *io_u,
                        break;
 
                iov.iov_len -= ret;
+               bytes += ret;
                if (iov.iov_len)
                        iov.iov_base += ret;
        }