From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCp7o-0004iB-1U for qemu-devel@nongnu.org; Tue, 14 Jun 2016 10:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCp7l-00004w-Qc for qemu-devel@nongnu.org; Tue, 14 Jun 2016 10:15:26 -0400 References: <1465911155-19002-1-git-send-email-kwolf@redhat.com> <1465911155-19002-6-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: <57601176.6050002@redhat.com> Date: Tue, 14 Jun 2016 08:15:18 -0600 MIME-Version: 1.0 In-Reply-To: <1465911155-19002-6-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="leiJBjdN2LjLwc34li9SHq5fT9juj5L5D" Subject: Re: [Qemu-devel] [PATCH v2 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: stefanha@redhat.com, famz@redhat.com, mreitz@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --leiJBjdN2LjLwc34li9SHq5fT9juj5L5D Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/14/2016 07:32 AM, Kevin Wolf wrote: > The raw-posix block driver actually supports byte-aligned requests now > on non-O_DIRECT images, like it already (and previously incorrectly) > claimed in bs->request_alignment. >=20 > For some block drivers this means that a RMW cycle can be avoided when > they write sub-sector metadata e.g. for cluster allocation. >=20 > Signed-off-by: Kevin Wolf > --- > block/linux-aio.c | 7 ++----- > block/raw-aio.h | 3 +-- > block/raw-posix.c | 43 +++++++++++++++++++++++-------------------- > 3 files changed, 26 insertions(+), 27 deletions(-) >=20 > -static int coroutine_fn raw_co_readv(BlockDriverState *bs, int64_t sec= tor_num, > - int nb_sectors, QEMUIOVector *qio= v) > +static int coroutine_fn raw_co_preadv(BlockDriverState *bs, uint64_t o= ffset, > + uint64_t bytes, QEMUIOVector *qi= ov, > + int flags) > { > - return raw_co_rw(bs, sector_num, nb_sectors, qiov, QEMU_AIO_READ);= > + return raw_co_prw(bs, offset, bytes, qiov, QEMU_AIO_READ); > } > =20 > -static int coroutine_fn raw_co_writev(BlockDriverState *bs, int64_t se= ctor_num, > - int nb_sectors, QEMUIOVector *qi= ov) > +static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, uint64_t = offset, > + uint64_t bytes, QEMUIOVector *q= iov, > + int flags) > { > - return raw_co_rw(bs, sector_num, nb_sectors, qiov, QEMU_AIO_WRITE)= ; > + assert(flags =3D=3D 0); > + return raw_co_prw(bs, offset, bytes, qiov, QEMU_AIO_WRITE); > } Looks odd to assert !flags on pwritev but not on preadv. Minor enough that you could fix on pull request. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --leiJBjdN2LjLwc34li9SHq5fT9juj5L5D 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/ iQEcBAEBCAAGBQJXYBF2AAoJEKeha0olJ0NqRgUH/1NjS//C1Pvoy771/bV5nkPe 1u2jEwW9MVgZAuMeYEGakqj91+aokz2npHABS4uYWZDOdoGWfk05OuGOMb44Sa6A ZYGd625lFXD6PLDnlnE90oVPh1+gkdb/9F/8JD89uLLNG9gHCFPmu06bKZcnuEyp DiCNeBFGz+BJWN0dTlmmfwnQN5TeMIawCjB8sEW4yOMWvt4lOzDJ9hebdANx9tLI nGOAVKqzpmMrTuUUOZozes7tuvdY8STK+UeYbwfeLjxBReW0xZ3uFZ4GtozPqxSv luS840DuN62d3+t4Vbgi6uDkHotQ87c3uPhEjz+3MOc+6VyfEJoZ4hdD8a9iPaw= =O2pz -----END PGP SIGNATURE----- --leiJBjdN2LjLwc34li9SHq5fT9juj5L5D--