From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz3v4-0004ka-1j for qemu-devel@nongnu.org; Thu, 11 Dec 2014 08:36:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz3uv-0003dF-0K for qemu-devel@nongnu.org; Thu, 11 Dec 2014 08:36:37 -0500 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:52137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz3uu-0003d3-Pn for qemu-devel@nongnu.org; Thu, 11 Dec 2014 08:36:28 -0500 Received: by mail-wi0-f182.google.com with SMTP id h11so8647473wiw.9 for ; Thu, 11 Dec 2014 05:36:28 -0800 (PST) Date: Thu, 11 Dec 2014 13:36:25 +0000 From: Stefan Hajnoczi Message-ID: <20141211133625.GJ30812@stefanha-thinkpad.redhat.com> References: <1417613866-25890-1-git-send-email-mreitz@redhat.com> <1417613866-25890-11-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2uG6jHjFLimDtBY" Content-Disposition: inline In-Reply-To: <1417613866-25890-11-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 10/26] qcow2: Helper function for refcount modification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi --J2uG6jHjFLimDtBY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 03, 2014 at 02:37:30PM +0100, Max Reitz wrote: > Since refcounts do not always have to be a uint16_t, all refcount blocks > and arrays in memory should not have a specific type (thus they become > pointers to void) and for accessing them, two helper functions are used > (a getter and a setter). Those functions are called indirectly through > function pointers in the BDRVQcowState so they may later be exchanged > for different refcount orders. >=20 > With the check and repair functions using this function, the refcount > array they are creating will be in big endian byte order; additionally, > using realloc_refcount_array() makes the size of this refcount array > always cluster-aligned. Both combined allow rebuild_refcount_structure() > to drop the bounce buffer which was used to convert parts of the > refcount array to big endian byte order and store them on disk. Instead, > those parts can now be written directly. >=20 > Signed-off-by: Max Reitz > --- > block/qcow2-refcount.c | 122 ++++++++++++++++++++++++++++---------------= ------ > block/qcow2.h | 8 ++++ > 2 files changed, 79 insertions(+), 51 deletions(-) Reviewed-by: Stefan Hajnoczi --J2uG6jHjFLimDtBY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUiZ3ZAAoJEJykq7OBq3PIoJsIAK8LAP9+LJX3uvc48DXreaNT tow+PU8MV6clCFhtPkKNA8/D+BPrp1oCLjK702nDhVD5jJnY7lsQtxqgPzO7L8+G HixYQJV9dkSjNrqQl+WHZZDHnABmNh+l6e/cqVD6mbMiHz2VLZpEyULWwhR0GneZ kUWdnyeJPB8OhLUdsrY5ElO60eM8J//weR0QrACAY8ojeBHS8SWr6ki4Q5gYjkFH P701tYQjIS1a+8Mm8/A65g9RmPMzO2X7KrAPOIY+nyMTkHhJGd4ufjInXYWS6QJ4 zbsChwmxS3pw6PWI2uJ7cAHMNQxwOTRiI+gNKPjuan+bkZIieralY4pHh3A9HsM= =YB8o -----END PGP SIGNATURE----- --J2uG6jHjFLimDtBY--