From nobody Sat Feb 7 02:58:46 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518543174824465.26135258397255; Tue, 13 Feb 2018 09:32:54 -0800 (PST) Received: from localhost ([::1]:56224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eleRj-0000J9-3b for importer@patchew.org; Tue, 13 Feb 2018 12:32:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ele1p-00032H-6i for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:06:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ele1m-0005Pf-BP for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:06:01 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51182 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ele1k-0005Nr-41; Tue, 13 Feb 2018 12:05:56 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BE3A67D840; Tue, 13 Feb 2018 17:05:55 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-94.ams2.redhat.com [10.36.117.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AD0D10073CD; Tue, 13 Feb 2018 17:05:54 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 13 Feb 2018 18:04:55 +0100 Message-Id: <20180213170529.10858-22-kwolf@redhat.com> In-Reply-To: <20180213170529.10858-1-kwolf@redhat.com> References: <20180213170529.10858-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 13 Feb 2018 17:05:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 13 Feb 2018 17:05:55 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 21/55] qcow2: Remove BDS parameter from qcow2_cache_table_release() 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alberto Garcia This function was only using the BlockDriverState parameter to get the cache table size (since it was equal to the cluster size). This is no longer necessary so this parameter can be removed. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake Reviewed-by: Max Reitz Message-id: 7c1b262344375d52544525f85bbbf0548d5ba575.1517840876.git.berto@i= galia.com Signed-off-by: Max Reitz --- block/qcow2-cache.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index 3749d55595..5ff2cbf5c5 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -71,8 +71,7 @@ static inline const char *qcow2_cache_get_name(BDRVQcow2S= tate *s, Qcow2Cache *c) } } =20 -static void qcow2_cache_table_release(BlockDriverState *bs, Qcow2Cache *c, - int i, int num_tables) +static void qcow2_cache_table_release(Qcow2Cache *c, int i, int num_tables) { /* Using MADV_DONTNEED to discard memory is a Linux-specific feature */ #ifdef CONFIG_LINUX @@ -114,7 +113,7 @@ void qcow2_cache_clean_unused(BlockDriverState *bs, Qco= w2Cache *c) } =20 if (to_clean > 0) { - qcow2_cache_table_release(bs, c, i - to_clean, to_clean); + qcow2_cache_table_release(c, i - to_clean, to_clean); } } =20 @@ -306,7 +305,7 @@ int qcow2_cache_empty(BlockDriverState *bs, Qcow2Cache = *c) c->entries[i].lru_counter =3D 0; } =20 - qcow2_cache_table_release(bs, c, 0, c->size); + qcow2_cache_table_release(c, 0, c->size); =20 c->lru_counter =3D 0; =20 @@ -453,5 +452,5 @@ void qcow2_cache_discard(BlockDriverState *bs, Qcow2Cac= he *c, void *table) c->entries[i].lru_counter =3D 0; c->entries[i].dirty =3D false; =20 - qcow2_cache_table_release(bs, c, i, 1); + qcow2_cache_table_release(c, i, 1); } --=20 2.13.6