From nobody Mon Feb 9 09:01:20 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; dkim=fail; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513343281898743.4833493955157; Fri, 15 Dec 2017 05:08:01 -0800 (PST) Received: from localhost ([::1]:46125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePpiQ-0003tA-12 for importer@patchew.org; Fri, 15 Dec 2017 08:07:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePpVI-0000X3-0a for qemu-devel@nongnu.org; Fri, 15 Dec 2017 07:54:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePpVE-0003Lw-KO for qemu-devel@nongnu.org; Fri, 15 Dec 2017 07:54:15 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:48191) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePpVE-0003K5-56; Fri, 15 Dec 2017 07:54:12 -0500 Received: from [192.168.12.179] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1ePpV7-000843-Od; Fri, 15 Dec 2017 13:54:05 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1ePpV7-0004Cy-J6; Fri, 15 Dec 2017 14:54:05 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=cOV5I/K4t/YgnEp4rhZtp5x/hKgFeBTDW+jwdH3/pvk=; b=S4/qps8zfkn7GmpCQMQO8oEMac6D5SBj5y0pv51dRWI+0X21UjFpg7Jq2psN7Yd7V+CRNBRUAjOz5hll0R3Ahyj4tQE9vmpMwOkqTOimc/9vwCCtaRIdWxVK7m8LwybzmGoewrmt3Fy0sE4qG8Z3FjhuWzsLn3Fk+gOoGEbxfKGHqVQi/VJeBtYWtx58/ZwBZrS185bk1TkCqnkhTN34ji8rH63b65ooTgIW5hWAK4S4xUYvuQC4ahmVLb3y+gD8/Wssq3mlVXsE2uol1cG9O2/enH4Fd2b5txDM4I2eVLVlcD4s8Vzkof8kczVPfzj/obbNrTxrdRGminzNdtF+RQ==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 15 Dec 2017 13:53:39 +0100 Message-Id: <4007dce42901324c3d129917d555d3fec4fb82a2.1513342045.git.berto@igalia.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH v2 11/32] qcow2: Remove BDS parameter from qcow2_cache_is_table_offset() 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 , "Denis V . Lunev" , Alberto Garcia , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This function was only using the BlockDriverState parameter to pass it to qcow2_cache_get_table_addr(). This is no longer necessary so this parameter can be removed. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- block/qcow2-cache.c | 3 +-- block/qcow2-refcount.c | 6 +++--- block/qcow2.h | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index 1cf7915871..2fcecbd7a8 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -428,8 +428,7 @@ void qcow2_cache_entry_mark_dirty(Qcow2Cache *c, void *= table) c->entries[i].dirty =3D true; } =20 -void *qcow2_cache_is_table_offset(BlockDriverState *bs, Qcow2Cache *c, - uint64_t offset) +void *qcow2_cache_is_table_offset(Qcow2Cache *c, uint64_t offset) { int i; =20 diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index d3a0f7a274..51094fbcfb 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -871,14 +871,14 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(Bl= ockDriverState *bs, if (refcount =3D=3D 0) { void *table; =20 - table =3D qcow2_cache_is_table_offset(bs, s->refcount_block_ca= che, + table =3D qcow2_cache_is_table_offset(s->refcount_block_cache, offset); if (table !=3D NULL) { qcow2_cache_put(s->refcount_block_cache, &refcount_block); qcow2_cache_discard(s->refcount_block_cache, table); } =20 - table =3D qcow2_cache_is_table_offset(bs, s->l2_table_cache, o= ffset); + table =3D qcow2_cache_is_table_offset(s->l2_table_cache, offse= t); if (table !=3D NULL) { qcow2_cache_discard(s->l2_table_cache, table); } @@ -3140,7 +3140,7 @@ static int qcow2_discard_refcount_block(BlockDriverSt= ate *bs, s->free_cluster_index =3D cluster_index; } =20 - refblock =3D qcow2_cache_is_table_offset(bs, s->refcount_block_cache, + refblock =3D qcow2_cache_is_table_offset(s->refcount_block_cache, discard_block_offs); if (refblock) { /* discard refblock from the cache if refblock is cached */ diff --git a/block/qcow2.h b/block/qcow2.h index 64354b6589..dce355521f 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -657,8 +657,7 @@ int qcow2_cache_get(BlockDriverState *bs, Qcow2Cache *c= , uint64_t offset, int qcow2_cache_get_empty(BlockDriverState *bs, Qcow2Cache *c, uint64_t of= fset, void **table); void qcow2_cache_put(Qcow2Cache *c, void **table); -void *qcow2_cache_is_table_offset(BlockDriverState *bs, Qcow2Cache *c, - uint64_t offset); +void *qcow2_cache_is_table_offset(Qcow2Cache *c, uint64_t offset); void qcow2_cache_discard(Qcow2Cache *c, void *table); =20 /* qcow2-bitmap.c functions */ --=20 2.11.0