netsplice: use zero-copy if possible
authorJens Axboe <jens.axboe@oracle.com>
Fri, 22 Jun 2007 18:41:27 +0000 (20:41 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 22 Jun 2007 18:41:27 +0000 (20:41 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/net.c

index a67432bfcdfb93f7663e4e21f32933fbeb526238..bc3946d588f4c389d448ca4c3c36cb1d4c1d0b84 100644 (file)
@@ -122,7 +122,7 @@ static int vmsplice_io_u_out(struct thread_data *td, struct io_u *io_u,
        int bytes = 0;
 
        while (iov.iov_len) {
        int bytes = 0;
 
        while (iov.iov_len) {
-               int ret = vmsplice(nd->pipes[0], &iov, 1, 0);
+               int ret = vmsplice(nd->pipes[0], &iov, 1, SPLICE_F_MOVE);
 
                if (ret < 0) {
                        if (!bytes)
 
                if (ret < 0) {
                        if (!bytes)
@@ -153,7 +153,7 @@ static int vmsplice_io_u_in(struct thread_data *td, struct io_u *io_u)
        unsigned int bytes = 0;
 
        while (iov.iov_len) {
        unsigned int bytes = 0;
 
        while (iov.iov_len) {
-               int ret = vmsplice(nd->pipes[1], &iov, 1, 0);
+               int ret = vmsplice(nd->pipes[1], &iov, 1, SPLICE_F_MOVE);
 
                if (ret < 0)
                        return -1;
 
                if (ret < 0)
                        return -1;