All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: mreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com,
	eblake@redhat.com, vsementsov@virtuozzo.com, den@openvz.org
Subject: [Qemu-devel] [PATCH v3 02/13] block/nbd-client: refactor nbd_co_receive_reply
Date: Thu, 12 Oct 2017 12:53:08 +0300	[thread overview]
Message-ID: <20171012095319.136610-3-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20171012095319.136610-1-vsementsov@virtuozzo.com>

Pass handle parameter directly, as the whole request isn't needed.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 block/nbd-client.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/nbd-client.c b/block/nbd-client.c
index ddf273a6a4..c0683c3c83 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -180,11 +180,11 @@ err:
 }
 
 static int nbd_co_receive_reply(NBDClientSession *s,
-                                NBDRequest *request,
+                                uint64_t handle,
                                 QEMUIOVector *qiov)
 {
     int ret;
-    int i = HANDLE_TO_INDEX(s, request->handle);
+    int i = HANDLE_TO_INDEX(s, handle);
 
     /* Wait until we're woken up by nbd_read_reply_entry.  */
     s->requests[i].receiving = true;
@@ -193,7 +193,7 @@ static int nbd_co_receive_reply(NBDClientSession *s,
     if (!s->ioc || s->quit) {
         ret = -EIO;
     } else {
-        assert(s->reply.handle == request->handle);
+        assert(s->reply.handle == handle);
         ret = -s->reply.error;
         if (qiov && s->reply.error == 0) {
             if (qio_channel_readv_all(s->ioc, qiov->iov, qiov->niov,
@@ -241,7 +241,7 @@ static int nbd_co_request(BlockDriverState *bs,
         return ret;
     }
 
-    return nbd_co_receive_reply(client, request,
+    return nbd_co_receive_reply(client, request->handle,
                                 request->type == NBD_CMD_READ ? qiov : NULL);
 }
 
-- 
2.11.1

  parent reply	other threads:[~2017-10-12  9:53 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12  9:53 [Qemu-devel] [PATCH v3 00/13] nbd minimal structured read Vladimir Sementsov-Ogievskiy
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 01/13] block/nbd-client: assert qiov len once in nbd_co_request Vladimir Sementsov-Ogievskiy
2017-10-12 21:16   ` Eric Blake
2017-10-12  9:53 ` Vladimir Sementsov-Ogievskiy [this message]
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 03/13] nbd: rename some simple-request related objects to be _simple_ Vladimir Sementsov-Ogievskiy
2017-10-12 21:26   ` Eric Blake
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 04/13] nbd/server: structurize simple reply header sending Vladimir Sementsov-Ogievskiy
2017-10-12 21:42   ` Eric Blake
2017-10-12 21:47     ` Eric Blake
2017-10-12 21:52   ` Eric Blake
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 05/13] nbd/server: do not use NBDReply structure Vladimir Sementsov-Ogievskiy
2017-10-12 22:03   ` Eric Blake
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 06/13] nbd/server: refactor nbd_co_send_simple_reply parameters Vladimir Sementsov-Ogievskiy
2017-10-12 22:21   ` Eric Blake
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 07/13] nbd-server: simplify reply transmission Vladimir Sementsov-Ogievskiy
2017-10-12 22:27   ` Eric Blake
2017-10-12 22:31     ` Eric Blake
2017-10-12 22:35     ` Eric Blake
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 08/13] nbd: header constants indenting Vladimir Sementsov-Ogievskiy
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 09/13] nbd: Minimal structured read for server Vladimir Sementsov-Ogievskiy
2017-10-13 16:00   ` Eric Blake
2017-10-13 16:15     ` Eric Blake
2017-10-13 16:34       ` Vladimir Sementsov-Ogievskiy
2017-10-13 16:23     ` Vladimir Sementsov-Ogievskiy
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 10/13] nbd/client: refactor nbd_receive_starttls Vladimir Sementsov-Ogievskiy
2017-10-13 17:58   ` Eric Blake
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 11/13] nbd: share some nbd entities to be reused in block/nbd-client.c Vladimir Sementsov-Ogievskiy
2017-10-13 18:47   ` Eric Blake
2017-10-13 18:52     ` Vladimir Sementsov-Ogievskiy
2017-10-13 19:03   ` Eric Blake
2017-10-13 22:34   ` Eric Blake
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 12/13] nbd/client: prepare nbd_receive_reply for structured reply Vladimir Sementsov-Ogievskiy
2017-10-13 19:20   ` Eric Blake
2017-10-12  9:53 ` [Qemu-devel] [PATCH v3 13/13] nbd: Minimal structured read for client Vladimir Sementsov-Ogievskiy
2017-10-13 20:51   ` Eric Blake
2017-10-16 16:54     ` Vladimir Sementsov-Ogievskiy
2017-10-12 10:49 ` [Qemu-devel] [PATCH v3 00/13] nbd minimal structured read no-reply
2017-10-12 11:15   ` Vladimir Sementsov-Ogievskiy
2017-10-12 13:28     ` Eric Blake
2017-10-12 22:39 ` Eric Blake
2017-10-13  7:57   ` Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171012095319.136610-3-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.