From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3ilb-00036s-ET for qemu-devel@nongnu.org; Mon, 29 Jul 2013 04:25:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3ilS-0005Hb-4n for qemu-devel@nongnu.org; Mon, 29 Jul 2013 04:25:19 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:58545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3ilN-0004zs-VM for qemu-devel@nongnu.org; Mon, 29 Jul 2013 04:25:10 -0400 Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jul 2013 18:12:13 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id C5AE5357804E for ; Mon, 29 Jul 2013 18:24:51 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6T89LRQ65404966 for ; Mon, 29 Jul 2013 18:09:22 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6T8Opve032488 for ; Mon, 29 Jul 2013 18:24:51 +1000 Message-ID: <51F626CD.50902@linux.vnet.ibm.com> Date: Mon, 29 Jul 2013 16:24:45 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1374765505-14356-1-git-send-email-stefanha@redhat.com> <1374765505-14356-14-git-send-email-stefanha@redhat.com> In-Reply-To: <1374765505-14356-14-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 13/18] block/sheepdog: drop have_co_req() and aio_flush_request() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Ping Fan Liu , qemu-devel@nongnu.org, Michael Roth , alex@alex.org.uk, Paolo Bonzini Reviewed-by: Wenchao Xia > .io_flush() is no longer called so drop have_co_req() and > aio_flush_request(). > > Signed-off-by: Stefan Hajnoczi > --- > block/sheepdog.c | 25 +++++-------------------- > 1 file changed, 5 insertions(+), 20 deletions(-) > > diff --git a/block/sheepdog.c b/block/sheepdog.c > index 6a41ad9..e216047 100644 > --- a/block/sheepdog.c > +++ b/block/sheepdog.c > @@ -509,13 +509,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; > @@ -538,14 +531,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)) { > @@ -796,14 +789,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. > * > @@ -819,7 +804,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; > } > > @@ -1070,7 +1055,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 */ > @@ -1092,7 +1077,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; > -- Best Regards Wenchao Xia