From nobody Sat Feb 7 06:54: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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517842132191912.8679648763049; Mon, 5 Feb 2018 06:48:52 -0800 (PST) Received: from localhost ([::1]:50998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eii4d-0006P6-Pp for importer@patchew.org; Mon, 05 Feb 2018 09:48:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eihrI-0002Ap-84 for qemu-devel@nongnu.org; Mon, 05 Feb 2018 09:35:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eihrD-0006CM-6G for qemu-devel@nongnu.org; Mon, 05 Feb 2018 09:35:00 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:48296) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eihrC-0005dR-Kx; Mon, 05 Feb 2018 09:34:55 -0500 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1eihqZ-0001rx-Ai; Mon, 05 Feb 2018 15:34:15 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1eihqJ-0008O0-44; Mon, 05 Feb 2018 16:33:59 +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=AgCGzt+TQfGrv8eQma44RiTh4YHqXMlopNQqTYo56FQ=; b=CUgl0bmZn7YRd/vZp3Ah3moHzDuxEPyTk82bdaRL1NXvUtbNsHLbxCkgPmXJRYelVhH0smhsCJwRDKC+oOYTt1Qvp+gbkgN4ps4CHIrgGEKy0083RbaWHqkNrhzRtAY68+327zw5RDOWPr5R8TydwGYLqcfk5Z9XxHrqgvgbGn61xQncpRY6tOsbavOeYc7ugGXC4UYrqeGl8MsrC1cCo0kFvKV2faKyafWuoMtn9kHHlLUEkPAqul+A/vezhLO2W7iE9ew9RqwQ2pA0i76fGr5CDP/9ilzvvtk8AqKmxBniI6lRvKhT2eQv7+voXUQkGOGzojTO8crXJYep22GlgQ==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Mon, 5 Feb 2018 16:33:06 +0200 Message-Id: <5c40516a91782b083c1428b7b6a41bb9e2679bfb.1517840876.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 v4 06/39] qcow2: Remove BDS parameter from qcow2_cache_entry_mark_dirty() 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 , Anton Nefedov , Alberto Garcia , qemu-block@nongnu.org, Max Reitz , "Denis V . Lunev" 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_idx(). This is no longer necessary so this parameter can be removed. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- block/qcow2-cache.c | 3 +-- block/qcow2-cluster.c | 12 ++++++------ block/qcow2-refcount.c | 14 ++++++-------- block/qcow2.h | 3 +-- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index 5ff2cbf5c5..07603e6b15 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -421,8 +421,7 @@ void qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *= c, void **table) assert(c->entries[i].ref >=3D 0); } =20 -void qcow2_cache_entry_mark_dirty(BlockDriverState *bs, Qcow2Cache *c, - void *table) +void qcow2_cache_entry_mark_dirty(Qcow2Cache *c, void *table) { int i =3D qcow2_cache_get_table_idx(c, table); assert(c->entries[i].offset !=3D 0); diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 8163983d28..1f279a9151 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -325,7 +325,7 @@ static int l2_allocate(BlockDriverState *bs, int l1_ind= ex, uint64_t **table) BLKDBG_EVENT(bs->file, BLKDBG_L2_ALLOC_WRITE); =20 trace_qcow2_l2_allocate_write_l2(bs, l1_index); - qcow2_cache_entry_mark_dirty(bs, s->l2_table_cache, l2_table); + qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_table); ret =3D qcow2_cache_flush(bs, s->l2_table_cache); if (ret < 0) { goto fail; @@ -766,7 +766,7 @@ uint64_t qcow2_alloc_compressed_cluster_offset(BlockDri= verState *bs, /* compressed clusters never have the copied flag */ =20 BLKDBG_EVENT(bs->file, BLKDBG_L2_UPDATE_COMPRESSED); - qcow2_cache_entry_mark_dirty(bs, s->l2_table_cache, l2_table); + qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_table); l2_table[l2_index] =3D cpu_to_be64(cluster_offset); qcow2_cache_put(bs, s->l2_table_cache, (void **) &l2_table); =20 @@ -938,7 +938,7 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, Q= CowL2Meta *m) if (ret < 0) { goto err; } - qcow2_cache_entry_mark_dirty(bs, s->l2_table_cache, l2_table); + qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_table); =20 assert(l2_index + m->nb_clusters <=3D s->l2_size); for (i =3D 0; i < m->nb_clusters; i++) { @@ -1679,7 +1679,7 @@ static int discard_single_l2(BlockDriverState *bs, ui= nt64_t offset, } =20 /* First remove L2 entries */ - qcow2_cache_entry_mark_dirty(bs, s->l2_table_cache, l2_table); + qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_table); if (!full_discard && s->qcow_version >=3D 3) { l2_table[l2_index + i] =3D cpu_to_be64(QCOW_OFLAG_ZERO); } else { @@ -1775,7 +1775,7 @@ static int zero_single_l2(BlockDriverState *bs, uint6= 4_t offset, continue; } =20 - qcow2_cache_entry_mark_dirty(bs, s->l2_table_cache, l2_table); + qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_table); if (cluster_type =3D=3D QCOW2_CLUSTER_COMPRESSED || unmap) { l2_table[l2_index + i] =3D cpu_to_be64(QCOW_OFLAG_ZERO); qcow2_free_any_clusters(bs, old_offset, 1, QCOW2_DISCARD_REQUE= ST); @@ -1984,7 +1984,7 @@ static int expand_zero_clusters_in_l1(BlockDriverStat= e *bs, uint64_t *l1_table, =20 if (is_active_l1) { if (l2_dirty) { - qcow2_cache_entry_mark_dirty(bs, s->l2_table_cache, l2_tab= le); + qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_table); qcow2_cache_depends_on_flush(s->l2_table_cache); } qcow2_cache_put(bs, s->l2_table_cache, (void **) &l2_table); diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 92701ab7af..5434e7d4c8 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -421,7 +421,7 @@ static int alloc_refcount_block(BlockDriverState *bs, =20 /* Now the new refcount block needs to be written to disk */ BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_ALLOC_WRITE); - qcow2_cache_entry_mark_dirty(bs, s->refcount_block_cache, *refcount_bl= ock); + qcow2_cache_entry_mark_dirty(s->refcount_block_cache, *refcount_block); ret =3D qcow2_cache_flush(bs, s->refcount_block_cache); if (ret < 0) { goto fail; @@ -623,7 +623,7 @@ int64_t qcow2_refcount_area(BlockDriverState *bs, uint6= 4_t start_offset, goto fail; } memset(refblock_data, 0, s->cluster_size); - qcow2_cache_entry_mark_dirty(bs, s->refcount_block_cache, + qcow2_cache_entry_mark_dirty(s->refcount_block_cache, refblock_data); =20 new_table[i] =3D block_offset; @@ -656,7 +656,7 @@ int64_t qcow2_refcount_area(BlockDriverState *bs, uint6= 4_t start_offset, s->set_refcount(refblock_data, j, 1); } =20 - qcow2_cache_entry_mark_dirty(bs, s->refcount_block_cache, + qcow2_cache_entry_mark_dirty(s->refcount_block_cache, refblock_data); } =20 @@ -845,8 +845,7 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(Bloc= kDriverState *bs, } old_table_index =3D table_index; =20 - qcow2_cache_entry_mark_dirty(bs, s->refcount_block_cache, - refcount_block); + qcow2_cache_entry_mark_dirty(s->refcount_block_cache, refcount_blo= ck); =20 /* we can update the count and save it */ block_index =3D cluster_index & (s->refcount_block_size - 1); @@ -1316,8 +1315,7 @@ int qcow2_update_snapshot_refcount(BlockDriverState *= bs, s->refcount_block_cache); } l2_table[j] =3D cpu_to_be64(entry); - qcow2_cache_entry_mark_dirty(bs, s->l2_table_cache, - l2_table); + qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_tab= le); } } =20 @@ -3180,7 +3178,7 @@ static int qcow2_discard_refcount_block(BlockDriverSt= ate *bs, } s->set_refcount(refblock, block_index, 0); =20 - qcow2_cache_entry_mark_dirty(bs, s->refcount_block_cache, refblock); + qcow2_cache_entry_mark_dirty(s->refcount_block_cache, refblock); =20 qcow2_cache_put(bs, s->refcount_block_cache, &refblock); =20 diff --git a/block/qcow2.h b/block/qcow2.h index 46c8cf44ec..ad332ed380 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -639,8 +639,7 @@ int qcow2_read_snapshots(BlockDriverState *bs); Qcow2Cache *qcow2_cache_create(BlockDriverState *bs, int num_tables); int qcow2_cache_destroy(BlockDriverState* bs, Qcow2Cache *c); =20 -void qcow2_cache_entry_mark_dirty(BlockDriverState *bs, Qcow2Cache *c, - void *table); +void qcow2_cache_entry_mark_dirty(Qcow2Cache *c, void *table); int qcow2_cache_flush(BlockDriverState *bs, Qcow2Cache *c); int qcow2_cache_write(BlockDriverState *bs, Qcow2Cache *c); int qcow2_cache_set_dependency(BlockDriverState *bs, Qcow2Cache *c, --=20 2.11.0