From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMkXe-0002vx-UM for qemu-devel@nongnu.org; Thu, 19 Sep 2013 16:09:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMkXa-00005y-49 for qemu-devel@nongnu.org; Thu, 19 Sep 2013 16:09:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMkXZ-00005r-R5 for qemu-devel@nongnu.org; Thu, 19 Sep 2013 16:09:30 -0400 Message-ID: <523B59F2.6060207@redhat.com> Date: Thu, 19 Sep 2013 14:09:22 -0600 From: Eric Blake MIME-Version: 1.0 References: <1379425736-11326-1-git-send-email-pl@kamp.de> <1379425736-11326-9-git-send-email-pl@kamp.de> In-Reply-To: <1379425736-11326-9-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ar79nArXdsO4KEhnb6i2fENanf6MmbhFU" Subject: Re: [Qemu-devel] [PATCHv2 08/20] block: honour alignment and limit in bdrv_co_discard List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, ronniesahlberg@gmail.com, stefanha@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Ar79nArXdsO4KEhnb6i2fENanf6MmbhFU Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/17/2013 07:48 AM, Peter Lieven wrote: > Signed-off-by: Peter Lieven > --- > block.c | 34 +++++++++++++++++++++++++++++++++- > 1 file changed, 33 insertions(+), 1 deletion(-) >=20 > diff --git a/block.c b/block.c > index 74ec342..ecc5be4 100644 > --- a/block.c > +++ b/block.c > @@ -4181,7 +4181,39 @@ int coroutine_fn bdrv_co_discard(BlockDriverStat= e *bs, int64_t sector_num, > } > =20 > if (bs->drv->bdrv_co_discard) { > - return bs->drv->bdrv_co_discard(bs, sector_num, nb_sectors); > + /* if no limit is specified in the BlockDriverState use a defa= ult > + * of 32768 512-byte sectors (16 MiB) per request. > + */ > + int max_discard =3D bs->max_discard ? bs->max_discard : 32768;= Worth having a named constant instead of a magic number? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Ar79nArXdsO4KEhnb6i2fENanf6MmbhFU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSO1nyAAoJEKeha0olJ0Nq2KYH/jnR0qzVKFVkuEq9hhfexL2D Xe9tQZAnhtcSnUwXU2Xs9CvoQkRvrRzTv7IOz35P1IenNQ/ln2FqYh11KqNl+sqZ vkYcJB+zWUjGtz+BDJ0zaGK1d8TKfKiZk5puOaSjqw9vyklxRA34ZF750s6xFOai Z7wpZBPQMPG6ucmMas72MmVey/j2W0o2oA0b7tYBYVT/tp/OKcRWgo286XdGcJdE s2lv+nwsb7e3HUvYkCyJv0VwgPavIjrE7m18USB2qVBUeoc4X9MgXQAWJtRIS8Ci MruGhgzA6QphQ4aE6ZD2cgHLpYlL0b5AMaB3sx7jiwdnbyXdOwrrkAQ/isWt3Cg= =pIsg -----END PGP SIGNATURE----- --Ar79nArXdsO4KEhnb6i2fENanf6MmbhFU--