From patchwork Wed Jun 1 21:10:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 628859 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rKjpR3nD6z9sCY for ; Thu, 2 Jun 2016 07:16:31 +1000 (AEST) Received: from localhost ([::1]:44153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8DV7-0007En-GQ for incoming@patchwork.ozlabs.org; Wed, 01 Jun 2016 17:16:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8DPO-0002Ep-TB for qemu-devel@nongnu.org; Wed, 01 Jun 2016 17:10:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8DPJ-0008EI-Li for qemu-devel@nongnu.org; Wed, 01 Jun 2016 17:10:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8DPB-0008AU-59; Wed, 01 Jun 2016 17:10:21 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C67B97F08F; Wed, 1 Jun 2016 21:10:20 +0000 (UTC) Received: from red.redhat.com (ovpn-116-150.phx2.redhat.com [10.3.116.150]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u51LAF6U027968; Wed, 1 Jun 2016 17:10:20 -0400 From: Eric Blake To: qemu-devel@nongnu.org Date: Wed, 1 Jun 2016 15:10:07 -0600 Message-Id: <1464815413-613-8-git-send-email-eblake@redhat.com> In-Reply-To: <1464815413-613-1-git-send-email-eblake@redhat.com> References: <1464815413-613-1-git-send-email-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 01 Jun 2016 21:10:20 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 07/13] blkreplay: Convert to bdrv_co_pwrite_zeroes() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake Reviewed-by: Kevin Wolf --- block/blkreplay.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/blkreplay.c b/block/blkreplay.c index 1a721ad..525c2d5 100755 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -103,13 +103,11 @@ static int coroutine_fn blkreplay_co_writev(BlockDriverState *bs, return ret; } -static int coroutine_fn blkreplay_co_write_zeroes(BlockDriverState *bs, - int64_t sector_num, int nb_sectors, BdrvRequestFlags flags) +static int coroutine_fn blkreplay_co_pwrite_zeroes(BlockDriverState *bs, + int64_t offset, int count, BdrvRequestFlags flags) { uint64_t reqid = request_id++; - int ret = bdrv_co_pwrite_zeroes(bs->file->bs, - sector_num << BDRV_SECTOR_BITS, - nb_sectors << BDRV_SECTOR_BITS, flags); + int ret = bdrv_co_pwrite_zeroes(bs->file->bs, offset, count, flags); block_request_create(reqid, bs, qemu_coroutine_self()); qemu_coroutine_yield(); @@ -149,7 +147,7 @@ static BlockDriver bdrv_blkreplay = { .bdrv_co_readv = blkreplay_co_readv, .bdrv_co_writev = blkreplay_co_writev, - .bdrv_co_write_zeroes = blkreplay_co_write_zeroes, + .bdrv_co_pwrite_zeroes = blkreplay_co_pwrite_zeroes, .bdrv_co_discard = blkreplay_co_discard, .bdrv_co_flush = blkreplay_co_flush, };