From nobody Tue Dec 16 13:07:23 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556640747; cv=none; d=zoho.com; s=zohoarc; b=D7ysu4aBf8QQmTZinKH4FCkaiRZoeBlezCV+oIWKLV4TGbFejdJ3odQbUUybInpWGA9rwDiUkYqTpq7jGSpTp7CNrmV846ms1N9hwPjIoMQg5rOoe9vJaySgCV7spQzmGSybKVUZimW+vjG7B6I9hVyuAipG8l3oo1a5s+Id2r4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556640747; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gA8UEPplVXOy7NP+QCnc+LQ7qXpRnrI+1FUFRV2EAmg=; b=kAO/qHlm4Rm4WLfFtAMmSEFXKzF7MjOAXnDnc+fLTo5a6YCnUZbqRLfjlZNfwAahY7V5CoPVHKst/kfucl1XAkR2cf5GKF3UZVbbtx9gidoxccZjFod3mhKXNU5QKompNGepDecOyMWNNvC5HL7aO78oK4DGTn+CmCl3tLtmC54= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556640747531984.959209059141; Tue, 30 Apr 2019 09:12:27 -0700 (PDT) Received: from localhost ([127.0.0.1]:49258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLVMl-0006nE-96 for importer@patchew.org; Tue, 30 Apr 2019 12:12:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLUv8-0008Ms-Vg for qemu-devel@nongnu.org; Tue, 30 Apr 2019 11:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLUv7-0002Is-Ep for qemu-devel@nongnu.org; Tue, 30 Apr 2019 11:43:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57260) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLUv4-0002Gs-2y; Tue, 30 Apr 2019 11:43:46 -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 5B812307EA83; Tue, 30 Apr 2019 15:43:45 +0000 (UTC) Received: from linux.fritz.box.com (unknown [10.36.118.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFBCF4D5; Tue, 30 Apr 2019 15:43:42 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 30 Apr 2019 17:42:44 +0200 Message-Id: <20190430154244.30083-28-kwolf@redhat.com> In-Reply-To: <20190430154244.30083-1-kwolf@redhat.com> References: <20190430154244.30083-1-kwolf@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.44]); Tue, 30 Apr 2019 15:43:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 27/27] block/qed: add missed coroutine_fn markers 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-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy qed_read_table and qed_write_table use coroutine-only interfaces but are not marked coroutine_fn. Happily, they are called only from coroutine context, so we only need to add missed markers. Reported-by: Kevin Wolf Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- block/qed.h | 28 ++++++++++++++++------------ block/qed-check.c | 4 ++-- block/qed-table.c | 33 ++++++++++++++++++++------------- block/qed.c | 5 +++-- 4 files changed, 41 insertions(+), 29 deletions(-) diff --git a/block/qed.h b/block/qed.h index f35341f134..42c115d822 100644 --- a/block/qed.h +++ b/block/qed.h @@ -201,17 +201,21 @@ void qed_commit_l2_cache_entry(L2TableCache *l2_cache= , CachedL2Table *l2_table); /** * Table I/O functions */ -int qed_read_l1_table_sync(BDRVQEDState *s); -int qed_write_l1_table(BDRVQEDState *s, unsigned int index, unsigned int n= ); -int qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index, - unsigned int n); -int qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, - uint64_t offset); -int qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offse= t); -int qed_write_l2_table(BDRVQEDState *s, QEDRequest *request, - unsigned int index, unsigned int n, bool flush); -int qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *request, - unsigned int index, unsigned int n, bool flush= ); +int coroutine_fn qed_read_l1_table_sync(BDRVQEDState *s); +int coroutine_fn qed_write_l1_table(BDRVQEDState *s, unsigned int index, + unsigned int n); +int coroutine_fn qed_write_l1_table_sync(BDRVQEDState *s, unsigned int ind= ex, + unsigned int n); +int coroutine_fn qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *reque= st, + uint64_t offset); +int coroutine_fn qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, + uint64_t offset); +int coroutine_fn qed_write_l2_table(BDRVQEDState *s, QEDRequest *request, + unsigned int index, unsigned int n, + bool flush); +int coroutine_fn qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *requ= est, + unsigned int index, unsigned int = n, + bool flush); =20 /** * Cluster functions @@ -223,7 +227,7 @@ int coroutine_fn qed_find_cluster(BDRVQEDState *s, QEDR= equest *request, /** * Consistency check */ -int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix); +int coroutine_fn qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool = fix); =20 QEDTable *qed_alloc_table(BDRVQEDState *s); =20 diff --git a/block/qed-check.c b/block/qed-check.c index 0edac03159..418033ee24 100644 --- a/block/qed-check.c +++ b/block/qed-check.c @@ -106,7 +106,7 @@ static unsigned int qed_check_l2_table(QEDCheck *check,= QEDTable *table) /** * Descend tables and check each cluster is referenced once only */ -static int qed_check_l1_table(QEDCheck *check, QEDTable *table) +static int coroutine_fn qed_check_l1_table(QEDCheck *check, QEDTable *tabl= e) { BDRVQEDState *s =3D check->s; unsigned int i, num_invalid_l1 =3D 0; @@ -218,7 +218,7 @@ static void qed_check_mark_clean(BDRVQEDState *s, BdrvC= heckResult *result) } =20 /* Called with table_lock held. */ -int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix) +int coroutine_fn qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool = fix) { QEDCheck check =3D { .s =3D s, diff --git a/block/qed-table.c b/block/qed-table.c index cf30edd977..405d446cbe 100644 --- a/block/qed-table.c +++ b/block/qed-table.c @@ -19,7 +19,8 @@ #include "qemu/bswap.h" =20 /* Called with table_lock held. */ -static int qed_read_table(BDRVQEDState *s, uint64_t offset, QEDTable *tabl= e) +static int coroutine_fn qed_read_table(BDRVQEDState *s, uint64_t offset, + QEDTable *table) { unsigned int bytes =3D s->header.cluster_size * s->header.table_size; =20 @@ -60,8 +61,9 @@ out: * * Called with table_lock held. */ -static int qed_write_table(BDRVQEDState *s, uint64_t offset, QEDTable *tab= le, - unsigned int index, unsigned int n, bool flush) +static int coroutine_fn qed_write_table(BDRVQEDState *s, uint64_t offset, + QEDTable *table, unsigned int inde= x, + unsigned int n, bool flush) { unsigned int sector_mask =3D BDRV_SECTOR_SIZE / sizeof(uint64_t) - 1; unsigned int start, end, i; @@ -109,27 +111,29 @@ out: return ret; } =20 -int qed_read_l1_table_sync(BDRVQEDState *s) +int coroutine_fn qed_read_l1_table_sync(BDRVQEDState *s) { return qed_read_table(s, s->header.l1_table_offset, s->l1_table); } =20 /* Called with table_lock held. */ -int qed_write_l1_table(BDRVQEDState *s, unsigned int index, unsigned int n) +int coroutine_fn qed_write_l1_table(BDRVQEDState *s, unsigned int index, + unsigned int n) { BLKDBG_EVENT(s->bs->file, BLKDBG_L1_UPDATE); return qed_write_table(s, s->header.l1_table_offset, s->l1_table, index, n, false); } =20 -int qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index, - unsigned int n) +int coroutine_fn qed_write_l1_table_sync(BDRVQEDState *s, unsigned int ind= ex, + unsigned int n) { return qed_write_l1_table(s, index, n); } =20 /* Called with table_lock held. */ -int qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offse= t) +int coroutine_fn qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, + uint64_t offset) { int ret; =20 @@ -166,22 +170,25 @@ int qed_read_l2_table(BDRVQEDState *s, QEDRequest *re= quest, uint64_t offset) return ret; } =20 -int qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, uint64_t = offset) +int coroutine_fn qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *reque= st, + uint64_t offset) { return qed_read_l2_table(s, request, offset); } =20 /* Called with table_lock held. */ -int qed_write_l2_table(BDRVQEDState *s, QEDRequest *request, - unsigned int index, unsigned int n, bool flush) +int coroutine_fn qed_write_l2_table(BDRVQEDState *s, QEDRequest *request, + unsigned int index, unsigned int n, + bool flush) { BLKDBG_EVENT(s->bs->file, BLKDBG_L2_UPDATE); return qed_write_table(s, request->l2_table->offset, request->l2_table->table, index, n, flush); } =20 -int qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *request, - unsigned int index, unsigned int n, bool flush) +int coroutine_fn qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *requ= est, + unsigned int index, unsigned int = n, + bool flush) { return qed_write_l2_table(s, request, index, n, flush); } diff --git a/block/qed.c b/block/qed.c index 912edaf56a..dcdcd62b4a 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1604,8 +1604,9 @@ static void coroutine_fn bdrv_qed_co_invalidate_cache= (BlockDriverState *bs, } } =20 -static int bdrv_qed_co_check(BlockDriverState *bs, BdrvCheckResult *result, - BdrvCheckMode fix) +static int coroutine_fn bdrv_qed_co_check(BlockDriverState *bs, + BdrvCheckResult *result, + BdrvCheckMode fix) { BDRVQEDState *s =3D bs->opaque; int ret; --=20 2.20.1