diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-09-21 12:36:48 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2011-12-22 11:53:58 +0100 |
commit | 128aa58947637b0989330c2e6a22a824d39e2193 (patch) | |
tree | a0e66b9499084abf822721d095094a904b3b4b83 /block | |
parent | 3777b09fd75ba746cf65d0ba30d73a5dd7a02d65 (diff) | |
download | qemu-128aa58947637b0989330c2e6a22a824d39e2193.zip qemu-128aa58947637b0989330c2e6a22a824d39e2193.tar.gz qemu-128aa58947637b0989330c2e6a22a824d39e2193.tar.bz2 |
move corking functions to osdep.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/sheepdog.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index 00ea5a0..17a79be 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -702,22 +702,6 @@ static int aio_flush_request(void *opaque) return !QLIST_EMPTY(&s->outstanding_aio_head); } -#if !defined(SOL_TCP) || !defined(TCP_CORK) - -static int set_cork(int fd, int v) -{ - return 0; -} - -#else - -static int set_cork(int fd, int v) -{ - return setsockopt(fd, SOL_TCP, TCP_CORK, &v, sizeof(v)); -} - -#endif - static int set_nodelay(int fd) { int ret, opt; @@ -923,7 +907,7 @@ static int coroutine_fn add_aio_request(BDRVSheepdogState *s, AIOReq *aio_req, s->co_send = qemu_coroutine_self(); qemu_aio_set_fd_handler(s->fd, co_read_response, co_write_request, aio_flush_request, NULL, s); - set_cork(s->fd, 1); + socket_set_cork(s->fd, 1); /* send a header */ ret = qemu_co_send(s->fd, &hdr, sizeof(hdr)); @@ -942,7 +926,7 @@ static int coroutine_fn add_aio_request(BDRVSheepdogState *s, AIOReq *aio_req, } } - set_cork(s->fd, 0); + socket_set_cork(s->fd, 0); qemu_aio_set_fd_handler(s->fd, co_read_response, NULL, aio_flush_request, NULL, s); qemu_co_mutex_unlock(&s->lock); |