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: 10002017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AB34E602BF for ; Thu, 12 Oct 2017 13:32:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D13725F3E for ; Thu, 12 Oct 2017 13:32:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91B2228DD9; Thu, 12 Oct 2017 13:32:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 12DC225F3E for ; Thu, 12 Oct 2017 13:32:14 +0000 (UTC) Received: from localhost ([::1]:45549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2dav-00012I-SD for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 Oct 2017 09:32:13 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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); }