From nobody Tue Feb 10 20:07:35 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.zohomail.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 1499207166083570.7472847564388; Tue, 4 Jul 2017 15:26:06 -0700 (PDT) Received: from localhost ([::1]:43236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSWGi-00038W-RP for importer@patchew.org; Tue, 04 Jul 2017 18:26:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSVyD-00018i-9i for qemu-devel@nongnu.org; Tue, 04 Jul 2017 18:06:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSVyA-0001SY-Pa for qemu-devel@nongnu.org; Tue, 04 Jul 2017 18:06:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54530) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSVy7-0001O0-Vh; Tue, 04 Jul 2017 18:06:52 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 073C23B73D; Tue, 4 Jul 2017 22:06:51 +0000 (UTC) Received: from localhost (unknown [10.36.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E54CA6928C; Tue, 4 Jul 2017 22:06:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 073C23B73D Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 073C23B73D From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 00:03:41 +0200 Message-Id: <20170704220346.29244-31-marcandre.lureau@redhat.com> In-Reply-To: <20170704220346.29244-1-marcandre.lureau@redhat.com> References: <20170704220346.29244-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Jul 2017 22:06:51 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 30/35] block-backend: mark coroutine_fn 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: Kevin Wolf , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/sysemu/block-backend.h | 4 ++-- block/block-backend.c | 36 ++++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 1e05281fff..2f967037af 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -165,8 +165,8 @@ int blk_co_ioctl(BlockBackend *blk, unsigned long int r= eq, void *buf); int blk_ioctl(BlockBackend *blk, unsigned long int req, void *buf); BlockAIOCB *blk_aio_ioctl(BlockBackend *blk, unsigned long int req, void *= buf, BlockCompletionFunc *cb, void *opaque); -int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int bytes); -int blk_co_flush(BlockBackend *blk); +int coroutine_fn blk_co_pdiscard(BlockBackend *blk, int64_t offset, int by= tes); +int coroutine_fn blk_co_flush(BlockBackend *blk); int blk_flush(BlockBackend *blk); int blk_commit_all(void); void blk_drain(BlockBackend *blk); diff --git a/block/block-backend.c b/block/block-backend.c index 56fc0a4d1e..a48aa4f900 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1032,7 +1032,8 @@ typedef struct BlkRwCo { BdrvRequestFlags flags; } BlkRwCo; =20 -static void blk_read_entry(void *opaque) +static void coroutine_fn +blk_read_entry(void *opaque) { BlkRwCo *rwco =3D opaque; =20 @@ -1040,7 +1041,8 @@ static void blk_read_entry(void *opaque) rwco->qiov, rwco->flags); } =20 -static void blk_write_entry(void *opaque) +static void coroutine_fn +blk_write_entry(void *opaque) { BlkRwCo *rwco =3D opaque; =20 @@ -1195,7 +1197,8 @@ static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, in= t64_t offset, int bytes, return &acb->common; } =20 -static void blk_aio_read_entry(void *opaque) +static void coroutine_fn +blk_aio_read_entry(void *opaque) { BlkAioEmAIOCB *acb =3D opaque; BlkRwCo *rwco =3D &acb->rwco; @@ -1206,7 +1209,8 @@ static void blk_aio_read_entry(void *opaque) blk_aio_complete(acb); } =20 -static void blk_aio_write_entry(void *opaque) +static void coroutine_fn +blk_aio_write_entry(void *opaque) { BlkAioEmAIOCB *acb =3D opaque; BlkRwCo *rwco =3D &acb->rwco; @@ -1288,7 +1292,8 @@ BlockAIOCB *blk_aio_pwritev(BlockBackend *blk, int64_= t offset, blk_aio_write_entry, flags, cb, opaque); } =20 -static void blk_aio_flush_entry(void *opaque) +static void coroutine_fn +blk_aio_flush_entry(void *opaque) { BlkAioEmAIOCB *acb =3D opaque; BlkRwCo *rwco =3D &acb->rwco; @@ -1303,7 +1308,8 @@ BlockAIOCB *blk_aio_flush(BlockBackend *blk, return blk_aio_prwv(blk, 0, 0, NULL, blk_aio_flush_entry, 0, cb, opaqu= e); } =20 -static void blk_aio_pdiscard_entry(void *opaque) +static void coroutine_fn +blk_aio_pdiscard_entry(void *opaque) { BlkAioEmAIOCB *acb =3D opaque; BlkRwCo *rwco =3D &acb->rwco; @@ -1339,7 +1345,8 @@ int blk_co_ioctl(BlockBackend *blk, unsigned long int= req, void *buf) return bdrv_co_ioctl(blk_bs(blk), req, buf); } =20 -static void blk_ioctl_entry(void *opaque) +static void coroutine_fn +blk_ioctl_entry(void *opaque) { BlkRwCo *rwco =3D opaque; rwco->ret =3D blk_co_ioctl(rwco->blk, rwco->offset, @@ -1351,7 +1358,8 @@ int blk_ioctl(BlockBackend *blk, unsigned long int re= q, void *buf) return blk_prw(blk, req, buf, 0, blk_ioctl_entry, 0); } =20 -static void blk_aio_ioctl_entry(void *opaque) +static void coroutine_fn +blk_aio_ioctl_entry(void *opaque) { BlkAioEmAIOCB *acb =3D opaque; BlkRwCo *rwco =3D &acb->rwco; @@ -1376,7 +1384,8 @@ BlockAIOCB *blk_aio_ioctl(BlockBackend *blk, unsigned= long int req, void *buf, return blk_aio_prwv(blk, req, 0, &qiov, blk_aio_ioctl_entry, 0, cb, op= aque); } =20 -int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int bytes) +int coroutine_fn +blk_co_pdiscard(BlockBackend *blk, int64_t offset, int bytes) { int ret =3D blk_check_byte_request(blk, offset, bytes); if (ret < 0) { @@ -1386,7 +1395,8 @@ int blk_co_pdiscard(BlockBackend *blk, int64_t offset= , int bytes) return bdrv_co_pdiscard(blk_bs(blk), offset, bytes); } =20 -int blk_co_flush(BlockBackend *blk) +int coroutine_fn +blk_co_flush(BlockBackend *blk) { if (!blk_is_available(blk)) { return -ENOMEDIUM; @@ -1395,7 +1405,8 @@ int blk_co_flush(BlockBackend *blk) return bdrv_co_flush(blk_bs(blk)); } =20 -static void blk_flush_entry(void *opaque) +static void coroutine_fn +blk_flush_entry(void *opaque) { BlkRwCo *rwco =3D opaque; rwco->ret =3D blk_co_flush(rwco->blk); @@ -1785,7 +1796,8 @@ int blk_truncate(BlockBackend *blk, int64_t offset, E= rror **errp) return bdrv_truncate(blk->root, offset, errp); } =20 -static void blk_pdiscard_entry(void *opaque) +static void coroutine_fn +blk_pdiscard_entry(void *opaque) { BlkRwCo *rwco =3D opaque; rwco->ret =3D blk_co_pdiscard(rwco->blk, rwco->offset, rwco->qiov->siz= e); --=20 2.13.1.395.gf7b71de06