From patchwork Thu Oct 12 13:05:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 824846 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="f9fPnIa5"; 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 3yCWwB5qYpz9t2m for ; Fri, 13 Oct 2017 00:31:38 +1100 (AEDT) Received: from localhost ([::1]:45549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2daK-00012I-Q5 for incoming@patchwork.ozlabs.org; Thu, 12 Oct 2017 09:31:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2dJI-0003gA-GI for qemu-devel@nongnu.org; Thu, 12 Oct 2017 09:14:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2dJF-0005za-4V for qemu-devel@nongnu.org; Thu, 12 Oct 2017 09:14:00 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:53203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2dJE-0005yn-RM; Thu, 12 Oct 2017 09:13:57 -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=4q1Rn7cY7d7QkOyb30liv1lsVNqPqSp2KDa/lS7tOME=; b=f9fPnIa5c+G7zMQRjmVHA8aW0T/tXUUU5/SA7we9TO8/QN4vBXiIFCKh6Yco853XEeot4LqVyHDfyF7UKhvoD3FFNO9JD99ui3ngjb/KSJ2AlhmCswt2wa4Yfup16i51B2xpgVseF4Eq3pa/+OD9HUTbKwPQFIKVYS/ZjYhXAZLUeP7LHAy6qZeHCVuQFnMidX8NPLZEdKBByZjGstl7BnZFBIaKPgoyFhmuQOBKD97XeUZ6QOX5TxEqH1H46hJE5ACAvmNdkKa5WjuMalrruhhlrnvgo6+NlVRc3IY2bHskC6Or0YcUVQ82zG8h415nKnvg4q7Zyp9eM7PKUj2Jag==; 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 1e2dJD-0006pW-JK; Thu, 12 Oct 2017 15:13:55 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1e2dCy-0003ZY-AE; Thu, 12 Oct 2017 16:07:28 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 16:05:19 +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 05/31] 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: 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 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 --- 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 cba6a165e8..dac99e95b0 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -59,8 +59,7 @@ static inline int qcow2_cache_get_table_idx(Qcow2Cache *c, void *table) return idx; } -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 @@ -102,7 +101,7 @@ void qcow2_cache_clean_unused(BlockDriverState *bs, Qcow2Cache *c) } 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); } } @@ -294,7 +293,7 @@ int qcow2_cache_empty(BlockDriverState *bs, Qcow2Cache *c) c->entries[i].lru_counter = 0; } - qcow2_cache_table_release(bs, c, 0, c->size); + qcow2_cache_table_release(c, 0, c->size); c->lru_counter = 0; @@ -432,5 +431,5 @@ void qcow2_cache_discard(BlockDriverState *bs, Qcow2Cache *c, void *table) c->entries[i].lru_counter = 0; c->entries[i].dirty = false; - qcow2_cache_table_release(bs, c, i, 1); + qcow2_cache_table_release(c, i, 1); }