From nobody Mon Nov 10 11:20:34 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1556627851; cv=none; d=zoho.com; s=zohoarc; b=YgtHeOJ+pAt0l/3ax0vWXinSALC064M7WOcUQyXlUncGoJYfxeiciAvztJDJ2xXVHrEB6JZBEp2Zz5kH40yC7YYPk8W9Clpvn87/rHSJZ/r3VHfhax0RjedgCgepbwEx1Dnu3m1H0rj3+Vv2i1aIJyKbZZor6Eh21klqSH1ajoI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556627851; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=v0Xnb5pqfa9551j8a8kTOswhnf/jqnudy7c7Skvdrec=; b=lvTzodlh5EWdYlwQdPeLU75heon7yRMJ9rNlZwwjjdhxxUSugJK0RWS8uwALM/zsmJrw5jUNPreMyqqKtcaKkt6U41fzkvvRwkm5kNM8JeE1tNu592YlaVIKRqlRiYPUW8TFNBX9hOpW3dyGL6aoGUqRMYc4TfKWIhDQtUnA24o= ARC-Authentication-Results: i=1; mx.zoho.com; spf=temperror (zoho.com: Error in retrieving data from DNS) 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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556627850867710.0346066119909; Tue, 30 Apr 2019 05:37:30 -0700 (PDT) Received: from localhost ([127.0.0.1]:46602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLS0Z-0001DU-2v for importer@patchew.org; Tue, 30 Apr 2019 08:37:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLRzd-0000p8-Cr for qemu-devel@nongnu.org; Tue, 30 Apr 2019 08:36:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLRzc-00041y-06 for qemu-devel@nongnu.org; Tue, 30 Apr 2019 08:36:17 -0400 Received: from relay.sw.ru ([185.231.240.75]:59016) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLRzb-000415-Pa; Tue, 30 Apr 2019 08:36:15 -0400 Received: from [10.28.8.145] (helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1hLRzX-0000qs-KD; Tue, 30 Apr 2019 15:36:12 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Tue, 30 Apr 2019 15:36:11 +0300 Message-Id: <20190430123611.31203-1-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH] 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, vsementsov@virtuozzo.com, stefanha@redhat.com, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 --- Hi! This is a follow-up for my "block: buffer-based io" series, proposed by Kevin, based on Kevin's block branch. Based-on: git://repo.or.cz/qemu/kevin.git block 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.18.0