From patchwork Thu Oct 12 13:05:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 824840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="meF9n42D"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yCWnd50Qsz9t38 for ; Fri, 13 Oct 2017 00:25:57 +1100 (AEDT) Received: from localhost ([::1]:45512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2dUp-0004VX-N8 for incoming@patchwork.ozlabs.org; Thu, 12 Oct 2017 09:25:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2dI7-0002hW-Hs for qemu-devel@nongnu.org; Thu, 12 Oct 2017 09:12:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2dI6-0004sf-I9 for qemu-devel@nongnu.org; Thu, 12 Oct 2017 09:12:47 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:52921) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2dI6-0004qw-8P; Thu, 12 Oct 2017 09:12:46 -0400 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=788QrZzELYDioLFlTf2aI2xBaR/vcWzI7tuQ7P+lyQs=; b=meF9n42DXd7NeQcbaJd6o2pFVtlThlCs6zX04InuFmqy/5wQwdHjI4CDqbz2e3AxUVniRMKf6zy235Q7/aZiTySa8y+koRiN6CVMwZBdcgnqKy1TEZAUDX9JeTtxJgffeomFIbMkYTurye/XBRya8m3MuMHSDBp6xJq7ttgLo1/cyy+36quEjpD6YBgzt1ZUyLcmcVGdJWH6prFqLemuWLIKA4yrJi2BeDUKgbhZNe84dzv2mbczD7G1lNkQnj32N4YHsg0m/g3srcu6bn6wLfwI1iTbmgsBTbS9QZc7n5etzL15M4WGWmbYZ74aT8d13aDEgn9mJ3uLs96NEvG4Mw==; Received: from a88-114-101-76.elisa-laajakaista.fi ([88.114.101.76] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1e2dI4-0006pW-TJ; Thu, 12 Oct 2017 15:12:45 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1e2dCy-0003Zp-I5; Thu, 12 Oct 2017 16:07:28 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 16:05:24 +0300 Message-Id: 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 10/31] qcow2: Remove BDS parameter from qcow2_cache_discard() 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This function was only using the BlockDriverState parameter to pass it to qcow2_cache_get_table_idx() and qcow2_cache_table_release(). This is no longer necessary so this parameter can be removed. Signed-off-by: Alberto Garcia --- block/qcow2-cache.c | 2 +- block/qcow2-refcount.c | 6 +++--- block/qcow2.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index cc7995c4bf..4775bec838 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -420,7 +420,7 @@ void *qcow2_cache_is_table_offset(BlockDriverState *bs, Qcow2Cache *c, return NULL; } -void qcow2_cache_discard(BlockDriverState *bs, Qcow2Cache *c, void *table) +void qcow2_cache_discard(Qcow2Cache *c, void *table) { int i = qcow2_cache_get_table_idx(c, table); diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index e93c1acd79..6eb71a2a5f 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -868,12 +868,12 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, offset); if (table != NULL) { qcow2_cache_put(s->refcount_block_cache, &refcount_block); - qcow2_cache_discard(bs, s->refcount_block_cache, table); + qcow2_cache_discard(s->refcount_block_cache, table); } table = qcow2_cache_is_table_offset(bs, s->l2_table_cache, offset); if (table != NULL) { - qcow2_cache_discard(bs, s->l2_table_cache, table); + qcow2_cache_discard(s->l2_table_cache, table); } if (s->discard_passthrough[type]) { @@ -3106,7 +3106,7 @@ static int qcow2_discard_refcount_block(BlockDriverState *bs, discard_block_offs); if (refblock) { /* discard refblock from the cache if refblock is cached */ - qcow2_cache_discard(bs, s->refcount_block_cache, refblock); + qcow2_cache_discard(s->refcount_block_cache, refblock); } update_refcount_discard(bs, discard_block_offs, s->cluster_size); diff --git a/block/qcow2.h b/block/qcow2.h index 9e6b5102f0..ec0225c016 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -665,7 +665,7 @@ int qcow2_cache_get_empty(BlockDriverState *bs, Qcow2Cache *c, uint64_t offset, void qcow2_cache_put(Qcow2Cache *c, void **table); void *qcow2_cache_is_table_offset(BlockDriverState *bs, Qcow2Cache *c, uint64_t offset); -void qcow2_cache_discard(BlockDriverState *bs, Qcow2Cache *c, void *table); +void qcow2_cache_discard(Qcow2Cache *c, void *table); /* qcow2-bitmap.c functions */ int qcow2_check_bitmaps_refcounts(BlockDriverState *bs, BdrvCheckResult *res,