From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e350D-000135-6q for qemu-devel@nongnu.org; Fri, 13 Oct 2017 14:48:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e350C-0006i0-7P for qemu-devel@nongnu.org; Fri, 13 Oct 2017 14:48:09 -0400 References: <20171012095319.136610-1-vsementsov@virtuozzo.com> <20171012095319.136610-12-vsementsov@virtuozzo.com> From: Eric Blake Message-ID: Date: Fri, 13 Oct 2017 13:47:58 -0500 MIME-Version: 1.0 In-Reply-To: <20171012095319.136610-12-vsementsov@virtuozzo.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4vua5inV7UE8n6b9X1pXwDGsS7MBMPwlp" Subject: Re: [Qemu-devel] [PATCH v3 11/13] nbd: share some nbd entities to be reused in block/nbd-client.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: mreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, den@openvz.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4vua5inV7UE8n6b9X1pXwDGsS7MBMPwlp From: Eric Blake To: Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: mreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, den@openvz.org Message-ID: Subject: Re: [PATCH v3 11/13] nbd: share some nbd entities to be reused in block/nbd-client.c References: <20171012095319.136610-1-vsementsov@virtuozzo.com> <20171012095319.136610-12-vsementsov@virtuozzo.com> In-Reply-To: <20171012095319.136610-12-vsementsov@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/12/2017 04:53 AM, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > include/block/nbd.h | 48 +++++++++++++++++++++++++++++++++++++++++++++= +++ > nbd/nbd-internal.h | 25 ------------------------- > nbd/client.c | 32 -------------------------------- > 3 files changed, 48 insertions(+), 57 deletions(-) >=20 > +static inline int nbd_errno_to_system_errno(int err) > +{ > + switch (err) { > + case NBD_SUCCESS: > + return 0; > + case NBD_EPERM: > + return EPERM; > + case NBD_EIO: > + return EIO; > + case NBD_ENOMEM: > + return ENOMEM; > + case NBD_ENOSPC: > + return ENOSPC; > + case NBD_ESHUTDOWN: > + return ESHUTDOWN; > + case NBD_EINVAL: > + return EINVAL; > + } > + > + return EINVAL; > +} This lacks a trace... > +++ b/nbd/client.c > @@ -22,38 +22,6 @@ > #include "trace.h" > #include "nbd-internal.h" > =20 > -static int nbd_errno_to_system_errno(int err) > -{ > - int ret; > - switch (err) { > - case NBD_SUCCESS: > - ret =3D 0; > - break; > - case NBD_EPERM: > - ret =3D EPERM; > - break; > - case NBD_EIO: > - ret =3D EIO; > - break; > - case NBD_ENOMEM: > - ret =3D ENOMEM; > - break; > - case NBD_ENOSPC: > - ret =3D ENOSPC; > - break; > - case NBD_ESHUTDOWN: > - ret =3D ESHUTDOWN; > - break; > - default: > - trace_nbd_unknown_error(err); > - /* fallthrough */ > - case NBD_EINVAL: =2E..that was present here. And you didn't do straight code motion, but modified things on the way (hence why checkpatch complained that your more concise version is suspicious with regards to returning positive errno). Does the function still need to be static inline, or should we just declare a prototype in the header and put the function itself in nbd/common.c? --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org --4vua5inV7UE8n6b9X1pXwDGsS7MBMPwlp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlnhCl4ACgkQp6FrSiUn Q2rLfggAm10Q3VpUt8BXNdS45yLv+t7qypKRuoRUhC0iJK3PdEzTWcZL9tOEC8Jq CQuYGQ0f5oyrWiAw2SojtLZ+aT6x8pxj42+ZHxbjgUm8iI9sksItlzHwytz16Z17 CnOAzs5pMrMMCC8+7gZkRo3kNP5OLX1nzAMJ98p1gB/hX6y8t40WanQtLLt7pfHm 9KSbrVjauJDYxv0Ke1kV08RTrAIwYRRoCJrypei9mnyQQzZ7AalW4U+Sf8I1I9iD PkbViwCps1s/wmWs7M7Y+t2mMDNR6ZZLkQzKlLcoGOLdcUtrL9lEf0RDQYh/O5/8 ziti1VZfTFZgnb0b8R0/oibgJXqY4g== =7TrM -----END PGP SIGNATURE----- --4vua5inV7UE8n6b9X1pXwDGsS7MBMPwlp--