From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axL6z-0007UP-TC for qemu-devel@nongnu.org; Mon, 02 May 2016 17:10:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axL6o-0008TU-2W for qemu-devel@nongnu.org; Mon, 02 May 2016 17:10:32 -0400 References: <1461960516-4717-1-git-send-email-eblake@redhat.com> <1461960516-4717-4-git-send-email-eblake@redhat.com> <20160502153511.GC4882@noname.redhat.com> From: Eric Blake Message-ID: <5727C21C.6020504@redhat.com> Date: Mon, 2 May 2016 15:09:48 -0600 MIME-Version: 1.0 In-Reply-To: <20160502153511.GC4882@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mevGoEQ3AVCkV5RUxMQcaPaSHdWeJPjDA" Subject: Re: [Qemu-devel] [PATCH v4 03/14] nand: Switch to byte-based block access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, "open list:Block layer core" , Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mevGoEQ3AVCkV5RUxMQcaPaSHdWeJPjDA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/02/2016 09:35 AM, Kevin Wolf wrote: > Am 29.04.2016 um 22:08 hat Eric Blake geschrieben: >> Sector-based blk_write() should die; switch to byte-based >> blk_pwrite() instead. Likewise for blk_read(). >> >> This file is doing some complex computations to map various >> flash page sizes (256, 512, and 2048) atop generic uses of >> 512-byte sector operations. Perhaps someone will want to tidy >> up the file for fewer gymnastics in managing addresses and >> offsets, and less wasteful visits of 256-byte pages, but it >> was out of scope for this series, where I just went with the >> mechanical conversion. >> >> Signed-off-by: Eric Blake >> --- >> hw/block/nand.c | 36 +++++++++++++++++++++++------------- >> 1 file changed, 23 insertions(+), 13 deletions(-) >> >> diff --git a/hw/block/nand.c b/hw/block/nand.c >> index 29c6596..2703ff4 100644 >> --- a/hw/block/nand.c >> } else { >> off =3D PAGE_START(s->addr) + (s->addr & PAGE_MASK) + s->offs= et; >> sector =3D off >> 9; >> soff =3D off & 0x1ff; >> - if (blk_read(s->blk, sector, iobuf, PAGE_SECTORS + 2) < 0) { >> + if (blk_pread(s->blk, sector << BDRV_SECTOR_BITS, iobuf, >> + (PAGE_SECTORS + 2) << BDRV_SECTOR_BITS) < 0) { Botched indentation here, too. >> printf("%s: read error in sector %" PRIu64 "\n", __func__= , sector); >> return; >> } >> >> mem_and(iobuf + soff, s->io, s->iolen); >> >> - if (blk_write(s->blk, sector, iobuf, PAGE_SECTORS + 2) < 0) {= >> + if (blk_write(s->blk, sector << BDRV_SECTOR_BITS, iobuf, >> + (PAGE_SECTORS + 2) << BDRV_SECTOR_BITS, 0) < 0)= { >=20 > You forgot to actually change which function is called here. I _did_ warn that some of my patches were not compile tested (wonder why I forgot to warn on this one, when I did warn on 4/14). Of course, patch 14/14 would have caused a compile error if I had been compiling this. So, what exactly do I need to start compiling these files, and ensure I'm not doing dead code edits? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mevGoEQ3AVCkV5RUxMQcaPaSHdWeJPjDA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXJ8IcAAoJEKeha0olJ0Nq1bkH/0Twa0DBWjiR2uin1VWvWExL ALkj2GIdQbngaqNGje6pkh0ebBvvz0/w/9ybNTmmtP7EugzYK1AzgpF+YsgI+kk/ JDWwyLcCfhcR3sK92pyHSLuJxli1KIPEvYb1/aI1If/Sl9/tdBEyBk7WeieEX7S4 sPChdiPzC6cbVM9KNqGwdGd7GjDbV1lghVJuWbB1iOZRzU8/80plcsfGCUoH9EHg T+NJV0TlMM4EqmuGmEywtsekvWic7xI/dclxg7v7VfXMmMW2BDjfOmITtddBcyRG Hg3rrL5XmRzvVN5H+e/FJgk8r5oMiBTD5PRZRnkmSPLhds66j6ASdznI/4XskO0= =N8ow -----END PGP SIGNATURE----- --mevGoEQ3AVCkV5RUxMQcaPaSHdWeJPjDA--