From nobody Sat Feb 7 05:57:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495831669359883.9466373672309; Fri, 26 May 2017 13:47:49 -0700 (PDT) Received: from localhost ([::1]:38418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEM9D-0006YE-01 for importer@patchew.org; Fri, 26 May 2017 16:47:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dELmB-00066p-K7 for qemu-devel@nongnu.org; Fri, 26 May 2017 16:24:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dELm6-0005bI-Mo for qemu-devel@nongnu.org; Fri, 26 May 2017 16:23:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33718) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dELm3-0005aA-Et; Fri, 26 May 2017 16:23:51 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 78E9C61BA1; Fri, 26 May 2017 20:23:50 +0000 (UTC) Received: from noname.redhat.com (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id B60F8173A7; Fri, 26 May 2017 20:23:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 78E9C61BA1 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kwolf@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 78E9C61BA1 From: Kevin Wolf To: qemu-block@nongnu.org Date: Fri, 26 May 2017 22:22:10 +0200 Message-Id: <1495830130-30611-30-git-send-email-kwolf@redhat.com> In-Reply-To: <1495830130-30611-1-git-send-email-kwolf@redhat.com> References: <1495830130-30611-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 26 May 2017 20:23:50 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 29/29] block: Remove bdrv_aio_readv/writev_flush() 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, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" These functions are unused now. Signed-off-by: Kevin Wolf --- block/io.c | 171 ----------------------------------------------= ---- include/block/block.h | 8 --- 2 files changed, 179 deletions(-) diff --git a/block/io.c b/block/io.c index fdd7485..1fec424 100644 --- a/block/io.c +++ b/block/io.c @@ -33,14 +33,6 @@ =20 #define NOT_DONE 0x7fffffff /* used while emulated sync operation in progr= ess */ =20 -static BlockAIOCB *bdrv_co_aio_prw_vector(BdrvChild *child, - int64_t offset, - QEMUIOVector *qiov, - BdrvRequestFlags flags, - BlockCompletionFunc *cb, - void *opaque, - bool is_write); -static void coroutine_fn bdrv_co_do_rw(void *opaque); static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int count, BdrvRequestFlags flags); =20 @@ -2083,28 +2075,6 @@ int bdrv_readv_vmstate(BlockDriverState *bs, QEMUIOV= ector *qiov, int64_t pos) /**************************************************************/ /* async I/Os */ =20 -BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num, - QEMUIOVector *qiov, int nb_sectors, - BlockCompletionFunc *cb, void *opaque) -{ - trace_bdrv_aio_readv(child->bs, sector_num, nb_sectors, opaque); - - assert(nb_sectors << BDRV_SECTOR_BITS =3D=3D qiov->size); - return bdrv_co_aio_prw_vector(child, sector_num << BDRV_SECTOR_BITS, q= iov, - 0, cb, opaque, false); -} - -BlockAIOCB *bdrv_aio_writev(BdrvChild *child, int64_t sector_num, - QEMUIOVector *qiov, int nb_sectors, - BlockCompletionFunc *cb, void *opaque) -{ - trace_bdrv_aio_writev(child->bs, sector_num, nb_sectors, opaque); - - assert(nb_sectors << BDRV_SECTOR_BITS =3D=3D qiov->size); - return bdrv_co_aio_prw_vector(child, sector_num << BDRV_SECTOR_BITS, q= iov, - 0, cb, opaque, true); -} - void bdrv_aio_cancel(BlockAIOCB *acb) { qemu_aio_ref(acb); @@ -2137,147 +2107,6 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb) } =20 /**************************************************************/ -/* async block device emulation */ - -typedef struct BlockRequest { - union { - /* Used during read, write, trim */ - struct { - int64_t offset; - int bytes; - int flags; - QEMUIOVector *qiov; - }; - /* Used during ioctl */ - struct { - int req; - void *buf; - }; - }; - BlockCompletionFunc *cb; - void *opaque; - - int error; -} BlockRequest; - -typedef struct BlockAIOCBCoroutine { - BlockAIOCB common; - BdrvChild *child; - BlockRequest req; - bool is_write; - bool need_bh; - bool *done; -} BlockAIOCBCoroutine; - -static const AIOCBInfo bdrv_em_co_aiocb_info =3D { - .aiocb_size =3D sizeof(BlockAIOCBCoroutine), -}; - -static void bdrv_co_complete(BlockAIOCBCoroutine *acb) -{ - if (!acb->need_bh) { - bdrv_dec_in_flight(acb->common.bs); - acb->common.cb(acb->common.opaque, acb->req.error); - qemu_aio_unref(acb); - } -} - -static void bdrv_co_em_bh(void *opaque) -{ - BlockAIOCBCoroutine *acb =3D opaque; - - assert(!acb->need_bh); - bdrv_co_complete(acb); -} - -static void bdrv_co_maybe_schedule_bh(BlockAIOCBCoroutine *acb) -{ - acb->need_bh =3D false; - if (acb->req.error !=3D -EINPROGRESS) { - BlockDriverState *bs =3D acb->common.bs; - - aio_bh_schedule_oneshot(bdrv_get_aio_context(bs), bdrv_co_em_bh, a= cb); - } -} - -/* Invoke bdrv_co_do_readv/bdrv_co_do_writev */ -static void coroutine_fn bdrv_co_do_rw(void *opaque) -{ - BlockAIOCBCoroutine *acb =3D opaque; - - if (!acb->is_write) { - acb->req.error =3D bdrv_co_preadv(acb->child, acb->req.offset, - acb->req.qiov->size, acb->req.qiov, acb->req.flags); - } else { - acb->req.error =3D bdrv_co_pwritev(acb->child, acb->req.offset, - acb->req.qiov->size, acb->req.qiov, acb->req.flags); - } - - bdrv_co_complete(acb); -} - -static BlockAIOCB *bdrv_co_aio_prw_vector(BdrvChild *child, - int64_t offset, - QEMUIOVector *qiov, - BdrvRequestFlags flags, - BlockCompletionFunc *cb, - void *opaque, - bool is_write) -{ - Coroutine *co; - BlockAIOCBCoroutine *acb; - - /* Matched by bdrv_co_complete's bdrv_dec_in_flight. */ - bdrv_inc_in_flight(child->bs); - - acb =3D qemu_aio_get(&bdrv_em_co_aiocb_info, child->bs, cb, opaque); - acb->child =3D child; - acb->need_bh =3D true; - acb->req.error =3D -EINPROGRESS; - acb->req.offset =3D offset; - acb->req.qiov =3D qiov; - acb->req.flags =3D flags; - acb->is_write =3D is_write; - - co =3D qemu_coroutine_create(bdrv_co_do_rw, acb); - bdrv_coroutine_enter(child->bs, co); - - bdrv_co_maybe_schedule_bh(acb); - return &acb->common; -} - -static void coroutine_fn bdrv_aio_flush_co_entry(void *opaque) -{ - BlockAIOCBCoroutine *acb =3D opaque; - BlockDriverState *bs =3D acb->common.bs; - - acb->req.error =3D bdrv_co_flush(bs); - bdrv_co_complete(acb); -} - -BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs, - BlockCompletionFunc *cb, void *opaque) -{ - trace_bdrv_aio_flush(bs, opaque); - - Coroutine *co; - BlockAIOCBCoroutine *acb; - - /* Matched by bdrv_co_complete's bdrv_dec_in_flight. */ - bdrv_inc_in_flight(bs); - - acb =3D qemu_aio_get(&bdrv_em_co_aiocb_info, bs, cb, opaque); - acb->need_bh =3D true; - acb->req.error =3D -EINPROGRESS; - - co =3D qemu_coroutine_create(bdrv_aio_flush_co_entry, acb); - bdrv_coroutine_enter(bs, co); - - bdrv_co_maybe_schedule_bh(acb); - return &acb->common; -} - -/**************************************************************/ /* Coroutine block device emulation */ =20 typedef struct FlushCo { diff --git a/include/block/block.h b/include/block/block.h index 9b355e9..c2dc243 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -353,14 +353,6 @@ BlockDriverState *check_to_replace_node(BlockDriverSta= te *parent_bs, const char *node_name, Error **err= p); =20 /* async block I/O */ -BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num, - QEMUIOVector *iov, int nb_sectors, - BlockCompletionFunc *cb, void *opaque); -BlockAIOCB *bdrv_aio_writev(BdrvChild *child, int64_t sector_num, - QEMUIOVector *iov, int nb_sectors, - BlockCompletionFunc *cb, void *opaque); -BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs, - BlockCompletionFunc *cb, void *opaque); void bdrv_aio_cancel(BlockAIOCB *acb); void bdrv_aio_cancel_async(BlockAIOCB *acb); =20 --=20 1.8.3.1