Revision 128aa589 block/sheepdog.c

b/block/sheepdog.c
702 702
    return !QLIST_EMPTY(&s->outstanding_aio_head);
703 703
}
704 704

  
705
#if !defined(SOL_TCP) || !defined(TCP_CORK)
706

  
707
static int set_cork(int fd, int v)
708
{
709
    return 0;
710
}
711

  
712
#else
713

  
714
static int set_cork(int fd, int v)
715
{
716
    return setsockopt(fd, SOL_TCP, TCP_CORK, &v, sizeof(v));
717
}
718

  
719
#endif
720

  
721 705
static int set_nodelay(int fd)
722 706
{
723 707
    int ret, opt;
......
923 907
    s->co_send = qemu_coroutine_self();
924 908
    qemu_aio_set_fd_handler(s->fd, co_read_response, co_write_request,
925 909
                            aio_flush_request, NULL, s);
926
    set_cork(s->fd, 1);
910
    socket_set_cork(s->fd, 1);
927 911

  
928 912
    /* send a header */
929 913
    ret = qemu_co_send(s->fd, &hdr, sizeof(hdr));
......
942 926
        }
943 927
    }
944 928

  
945
    set_cork(s->fd, 0);
929
    socket_set_cork(s->fd, 0);
946 930
    qemu_aio_set_fd_handler(s->fd, co_read_response, NULL,
947 931
                            aio_flush_request, NULL, s);
948 932
    qemu_co_mutex_unlock(&s->lock);

Also available in: Unified diff