[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 12/17] block/sheepdog: drop have_co_req() and aio
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH v2 12/17] block/sheepdog: drop have_co_req() and aio_flush_request() |
Date: |
Wed, 17 Apr 2013 15:07:48 +0200 |
.io_flush() is no longer called so drop have_co_req() and
aio_flush_request().
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block/sheepdog.c | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 1c5b532..21f6e58 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -503,13 +503,6 @@ static void restart_co_req(void *opaque)
qemu_coroutine_enter(co, NULL);
}
-static int have_co_req(void *opaque)
-{
- /* this handler is set only when there is a pending request, so
- * always returns 1. */
- return 1;
-}
-
typedef struct SheepdogReqCo {
int sockfd;
SheepdogReq *hdr;
@@ -532,14 +525,14 @@ static coroutine_fn void do_co_req(void *opaque)
unsigned int *rlen = srco->rlen;
co = qemu_coroutine_self();
- qemu_aio_set_fd_handler(sockfd, NULL, restart_co_req, have_co_req, co);
+ qemu_aio_set_fd_handler(sockfd, NULL, restart_co_req, NULL, co);
ret = send_co_req(sockfd, hdr, data, wlen);
if (ret < 0) {
goto out;
}
- qemu_aio_set_fd_handler(sockfd, restart_co_req, NULL, have_co_req, co);
+ qemu_aio_set_fd_handler(sockfd, restart_co_req, NULL, NULL, co);
ret = qemu_co_recv(sockfd, hdr, sizeof(*hdr));
if (ret < sizeof(*hdr)) {
@@ -764,14 +757,6 @@ static void co_write_request(void *opaque)
qemu_coroutine_enter(s->co_send, NULL);
}
-static int aio_flush_request(void *opaque)
-{
- BDRVSheepdogState *s = opaque;
-
- return !QLIST_EMPTY(&s->inflight_aio_head) ||
- !QLIST_EMPTY(&s->pending_aio_head);
-}
-
/*
* Return a socket discriptor to read/write objects.
*
@@ -787,7 +772,7 @@ static int get_sheep_fd(BDRVSheepdogState *s)
return fd;
}
- qemu_aio_set_fd_handler(fd, co_read_response, NULL, aio_flush_request, s);
+ qemu_aio_set_fd_handler(fd, co_read_response, NULL, NULL, s);
return fd;
}
@@ -1034,7 +1019,7 @@ static int coroutine_fn add_aio_request(BDRVSheepdogState
*s, AIOReq *aio_req,
qemu_co_mutex_lock(&s->lock);
s->co_send = qemu_coroutine_self();
qemu_aio_set_fd_handler(s->fd, co_read_response, co_write_request,
- aio_flush_request, s);
+ NULL, s);
socket_set_cork(s->fd, 1);
/* send a header */
@@ -1056,7 +1041,7 @@ static int coroutine_fn add_aio_request(BDRVSheepdogState
*s, AIOReq *aio_req,
socket_set_cork(s->fd, 0);
qemu_aio_set_fd_handler(s->fd, co_read_response, NULL,
- aio_flush_request, s);
+ NULL, s);
qemu_co_mutex_unlock(&s->lock);
return 0;
--
1.8.1.4
- [Qemu-devel] [PATCH v2 02/17] dataplane/virtio-blk: check exit conditions before aio_poll(), (continued)
- [Qemu-devel] [PATCH v2 02/17] dataplane/virtio-blk: check exit conditions before aio_poll(), Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 05/17] aio: stop using .io_flush(), Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 04/17] tests: adjust test-thread-pool to new aio_poll() semantics, Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 13/17] block/ssh: drop return_true(), Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 03/17] tests: adjust test-aio to new aio_poll() semantics, Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 08/17] block/iscsi: drop iscsi_process_flush(), Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 12/17] block/sheepdog: drop have_co_req() and aio_flush_request(),
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v2 16/17] tests: drop event_active_cb(), Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 11/17] block/rbd: drop qemu_rbd_aio_flush_cb(), Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 07/17] block/gluster: drop qemu_gluster_aio_flush_cb(), Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 17/17] aio: drop io_flush argument, Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 15/17] thread-pool: drop thread_pool_active(), Stefan Hajnoczi, 2013/04/17
- [Qemu-devel] [PATCH v2 14/17] dataplane/virtio-blk: drop flush_true() and flush_io(), Stefan Hajnoczi, 2013/04/17