From nobody Mon Feb 9 06:00:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496155557365843.1851397074172; Tue, 30 May 2017 07:45:57 -0700 (PDT) Received: from localhost ([::1]:54243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFiPC-0001mw-Qm for importer@patchew.org; Tue, 30 May 2017 10:45:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFiAq-0005Ru-PM for qemu-devel@nongnu.org; Tue, 30 May 2017 10:31:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFiAn-0000Qf-84 for qemu-devel@nongnu.org; Tue, 30 May 2017 10:31:04 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:9914 helo=relay.sw.ru) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFiAm-0000NC-Rg for qemu-devel@nongnu.org; Tue, 30 May 2017 10:31:01 -0400 Received: from kvm.sw.ru (msk-vpn.virtuozzo.com [195.214.232.6]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id v4UEUqEP027829; Tue, 30 May 2017 17:30:55 +0300 (MSK) From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Date: Tue, 30 May 2017 17:30:42 +0300 Message-Id: <20170530143052.165002-10-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170530143052.165002-1-vsementsov@virtuozzo.com> References: <20170530143052.165002-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x [fuzzy] X-Received-From: 195.214.232.25 Subject: [Qemu-devel] [PATCH 09/19] nbd/server: rename rc to ret X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, vsementsov@virtuozzo.com, den@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" For consistency use 'ret' name for saving return code everywhere in the file. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- nbd/server.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 4e9d33d83c..a76267bea7 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -211,15 +211,15 @@ static int nbd_negotiate_send_rep_list(QIOChannel *io= c, NBDExport *exp) uint32_t len; const char *name =3D exp->name ? exp->name : ""; const char *desc =3D exp->description ? exp->description : ""; - int rc; + int ret; =20 TRACE("Advertising export name '%s' description '%s'", name, desc); name_len =3D strlen(name); desc_len =3D strlen(desc); len =3D name_len + desc_len + sizeof(len); - rc =3D nbd_negotiate_send_rep_len(ioc, NBD_REP_SERVER, NBD_OPT_LIST, l= en); - if (rc < 0) { - return rc; + ret =3D nbd_negotiate_send_rep_len(ioc, NBD_REP_SERVER, NBD_OPT_LIST, = len); + if (ret < 0) { + return ret; } =20 len =3D cpu_to_be32(name_len); @@ -536,7 +536,7 @@ static int nbd_negotiate_options(NBDClient *client) static coroutine_fn int nbd_negotiate(NBDClient *client) { char buf[8 + 8 + 8 + 128]; - int rc; + int ret; const uint16_t myflags =3D (NBD_FLAG_HAS_FLAGS | NBD_FLAG_SEND_TRIM | NBD_FLAG_SEND_FLUSH | NBD_FLAG_SEND_FUA | NBD_FLAG_SEND_WRITE_ZEROES); @@ -593,10 +593,10 @@ static coroutine_fn int nbd_negotiate(NBDClient *clie= nt) LOG("write failed"); return -EINVAL; } - rc =3D nbd_negotiate_options(client); - if (rc !=3D 0) { + ret =3D nbd_negotiate_options(client); + if (ret !=3D 0) { LOG("option negotiation failed"); - return rc; + return ret; } =20 TRACE("advertising size %" PRIu64 " and flags %x", @@ -604,10 +604,10 @@ static coroutine_fn int nbd_negotiate(NBDClient *clie= nt) stq_be_p(buf + 18, client->exp->size); stw_be_p(buf + 26, client->exp->nbdflags | myflags); len =3D client->no_zeroes ? 10 : sizeof(buf) - 18; - rc =3D write_sync(client->ioc, buf + 18, len, NULL); - if (rc < 0) { + ret =3D write_sync(client->ioc, buf + 18, len, NULL); + if (ret < 0) { LOG("write failed"); - return rc; + return ret; } } =20 @@ -963,21 +963,21 @@ void nbd_export_close_all(void) static int nbd_co_send_reply(NBDRequestData *req, NBDReply *reply, int len) { NBDClient *client =3D req->client; - int rc; + int ret; =20 g_assert(qemu_in_coroutine()); qemu_co_mutex_lock(&client->send_lock); client->send_coroutine =3D qemu_coroutine_self(); =20 if (!len) { - rc =3D nbd_send_reply(client->ioc, reply); + ret =3D nbd_send_reply(client->ioc, reply); } else { qio_channel_set_cork(client->ioc, true); - rc =3D nbd_send_reply(client->ioc, reply); - if (rc =3D=3D 0) { - rc =3D write_sync(client->ioc, req->data, len, NULL); - if (rc < 0) { - rc =3D -EIO; + ret =3D nbd_send_reply(client->ioc, reply); + if (ret =3D=3D 0) { + ret =3D write_sync(client->ioc, req->data, len, NULL); + if (ret < 0) { + ret =3D -EIO; } } qio_channel_set_cork(client->ioc, false); @@ -985,7 +985,7 @@ static int nbd_co_send_reply(NBDRequestData *req, NBDRe= ply *reply, int len) =20 client->send_coroutine =3D NULL; qemu_co_mutex_unlock(&client->send_lock); - return rc; + return ret; } =20 /* nbd_co_receive_request --=20 2.11.1