From nobody Thu May 2 20:06:28 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653136124; cv=none; d=zohomail.com; s=zohoarc; b=EuGuE19a+tExiyAbl0tWX0CyoelSlI9Dhfb2uOMyWcWhdPIuu3Am8lQjCCh9NgiojLM5aTJm3dPv5D6j+VXWDHf398izzMNbdRkrVJzT4Qg/QUQSN5rYcSu5dutXUYK/IInpEY2Krk3uMCZHMp8AAcvtzHNnxzJsvXp4RHrEgRU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653136124; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=wvXhbPS7hVBm/8feD5MuwktUPL8dIvt3Gf7KcPIfcgA=; b=AC9ZFpB1wLbS8gKe1f5x04upf7AmU9EnBJG9T0yVIqjrAXYsl0Iefy6sYxG1hpS0t8D75SXoz7f8ZCq+JPuoj/dUPUMxxi69+E2UzIdmMDYaved716qnHu3+pkmXA6bT9Wdcpcmk3Is0DhgN5ekwpSuK+NDnruHD8CYE5RjsGf8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653136124627522.9224389288447; Sat, 21 May 2022 05:28:44 -0700 (PDT) Received: from localhost ([::1]:57262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsODr-0005GR-GZ for importer2@patchew.org; Sat, 21 May 2022 08:28:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsOCb-0004SA-KL for qemu-devel@nongnu.org; Sat, 21 May 2022 08:27:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsOCY-0004Pe-4J for qemu-devel@nongnu.org; Sat, 21 May 2022 08:27:23 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-278-H3LdqiJ8PHyCTZzcsH4r7w-1; Sat, 21 May 2022 08:27:16 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8477B1857F17; Sat, 21 May 2022 12:27:16 +0000 (UTC) Received: from localhost (unknown [10.39.192.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 189DB1410DD5; Sat, 21 May 2022 12:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653136040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=wvXhbPS7hVBm/8feD5MuwktUPL8dIvt3Gf7KcPIfcgA=; b=MClpyY8mGDYsPulRud4bjN+P9k2QTglFF1k2MQSqbnoWThLJEzarS0cJSx9MoCyhs74OcW 6mqM9u4m6/UBz5dVOY95Ld6nABzVjV/UbTNTt1TjDT0RwhybWIxyxHCCfM7chxS3yntjtc Z6P5e/jnQ3FPpqkH0WQZz/ILucut/vI= X-MC-Unique: H3LdqiJ8PHyCTZzcsH4r7w-1 From: Stefan Hajnoczi To: Kevin Wolf , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Emanuele Giuseppe Esposito , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Alberto Faria , Hanna Reitz Subject: [PATCH] block: drop unused bdrv_co_drain() API Date: Sat, 21 May 2022 13:27:14 +0100 Message-Id: <20220521122714.3837731-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653136125378100001 Content-Type: text/plain; charset="utf-8" bdrv_co_drain() has not been used since commit 9a0cec664eef ("mirror: use bdrv_drained_begin/bdrv_drained_end") in 2016. Remove it so there are fewer drain scenarios to worry about. Use bdrv_drained_begin()/bdrv_drained_end() instead. They are "mixed" functions that can be called from coroutine context. Unlike bdrv_co_drain(), these functions provide control of the length of the drained section, which is usually the right thing. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Faria Reviewed-by: Emanuele Giuseppe Esposito --- include/block/block-io.h | 1 - block/io.c | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/include/block/block-io.h b/include/block/block-io.h index 62c84f0519..053a27141a 100644 --- a/include/block/block-io.h +++ b/include/block/block-io.h @@ -270,7 +270,6 @@ void bdrv_drained_end_no_poll(BlockDriverState *bs, int= *drained_end_counter); cond); }) =20 void bdrv_drain(BlockDriverState *bs); -void coroutine_fn bdrv_co_drain(BlockDriverState *bs); =20 int generated_co_wrapper bdrv_truncate(BdrvChild *child, int64_t offset, bool exact, diff --git a/block/io.c b/block/io.c index 789e6373d5..1e9bf09a49 100644 --- a/block/io.c +++ b/block/io.c @@ -588,21 +588,6 @@ void bdrv_unapply_subtree_drain(BdrvChild *child, Bloc= kDriverState *old_parent) BDRV_POLL_WHILE(child->bs, qatomic_read(&drained_end_counter) > 0); } =20 -/* - * Wait for pending requests to complete on a single BlockDriverState subt= ree, - * and suspend block driver's internal I/O until next request arrives. - * - * Note that unlike bdrv_drain_all(), the caller must hold the BlockDriver= State - * AioContext. - */ -void coroutine_fn bdrv_co_drain(BlockDriverState *bs) -{ - IO_OR_GS_CODE(); - assert(qemu_in_coroutine()); - bdrv_drained_begin(bs); - bdrv_drained_end(bs); -} - void bdrv_drain(BlockDriverState *bs) { IO_OR_GS_CODE(); --=20 2.36.1