diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2017-10-12 12:53:08 +0300 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2017-10-12 16:20:27 -0500 |
commit | ed397b2fe7c37a8319e7ef89542447c86ebd67f8 (patch) | |
tree | e93e7de4fe52af23a376e03d224ce9b83f6b0420 /block/nbd-client.c | |
parent | 4bfe4478d17679464a2aaa91ed703522ed9af8a0 (diff) |
block/nbd-client: refactor nbd_co_receive_reply
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>
Message-Id: <20171012095319.136610-3-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block/nbd-client.c')
-rw-r--r-- | block/nbd-client.c | 8 |
1 files 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); } |