Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp962986ybl; Wed, 11 Dec 2019 10:13:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzp9nCwMlSQ94Yc0AYHrsmXwoTJzrBw4+eW292YPwZBF1XSK3+0/a/gREc1wKCsg/Xe22oY X-Received: by 2002:a9d:7999:: with SMTP id h25mr3218660otm.347.1576087994362; Wed, 11 Dec 2019 10:13:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576087994; cv=none; d=google.com; s=arc-20160816; b=uSubIaFxb0NraJt1InltwvYlMjTFIpOKkNUalWHOPaFu/Y/f5xNkqkcCM+UYXO7x4X MqPM0zTkZ+PKO3maCc8h6kWXgJaQsy4rYsfxXeymK86IGZ+StpoKNx17I+aRHF/2+zSZ UCBmi1K9oSItuSXMxo6fGgK7uUETjLC17KUnyouVYoQIvtqJ1B/pmuhELMroJp6JEsUk WywJ1nMGF4zmXKKc4TM5sNv7U3V+MDce4anA8PoW/DajUtLOBg6PcYfN7oCXdRFn6xVk zdDBPMrFYcD9ht8j5uE6W8UX22j1mzW2y9tFAtNSsYaTrhOp85PD5tWTmNkXg/XY2nX7 Rrbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DC1lDQTVGWiZyc47Vd2HTq0B83lbDHqEnIy5EBZ8fmk=; b=nrpkUPYtvEJS5J6nmOvL0flrYSzc7xLuSL4NmAiVT/70w1SdrcmngAV+T30Iq/yyp7 DYFz23+USWI6EsyKMMscqoHAPQud60ICqlFasNo4VLG0MdW0EvsYbRhjE36tMQkbz54j m56EK9fLcx3J3hT4Ogi/pO7AF5D3bcXLPcd7AFSZfPfrVWegMdO6gf6EPYXklbV9ShpB ura4kPyGMXyfjQoYSyv2GasX+atshiXQOTph9h1oPTLEhHLx1cmMoTqjaQsp0GkSwsbN 7QUX+1PHUsKqT2y0+b4WLVPsMo6pMSYrEWVaHFAvKyGzoNNEA28NsfYL6dq7MR8PSFaP cMIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p7erjCGJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si1627220oia.264.2019.12.11.10.13.02; Wed, 11 Dec 2019 10:13:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p7erjCGJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731186AbfLKSK6 (ORCPT + 99 others); Wed, 11 Dec 2019 13:10:58 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37595 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbfLKSK5 (ORCPT ); Wed, 11 Dec 2019 13:10:57 -0500 Received: by mail-pl1-f195.google.com with SMTP id c23so1730094plz.4; Wed, 11 Dec 2019 10:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DC1lDQTVGWiZyc47Vd2HTq0B83lbDHqEnIy5EBZ8fmk=; b=p7erjCGJxie+gsJ5gNv6yyP8UEGIYUryfLkT29PiTkBlTy7xUvH/z4836TdtoFqPq6 0kOWqjKUKyWnLANLIGaOHzDqbrdrWlOmRopA+hPWSbLHxR2eGdkmQCCOTkoFtbYDtOH4 bJplBxvgrKhTSHyhjWkW7YpCMQ3fRG3/9l2OX7+94y3Jx+vwERpZNctRhm74MclskxZL gvEb1jhOflVXMbmRLWEua5gQukz1S+5ZzpF32hTXB58kY0e0e/zWIPSO2ZSi39JzYJ2g cSg7TMCr64sRse8S0sDD6tvApA/BUFO50Op3h/HKX359SzJPJco26MfKBSaDllzz0K5u tlVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DC1lDQTVGWiZyc47Vd2HTq0B83lbDHqEnIy5EBZ8fmk=; b=rCj1jp/DLjKRzU1vEhbSU6l1Q7qffWWs7aMa8q53KOBH3+btqWtoMWoO00/xAMLFTg AD5EPx3PJvsq7hz/3yzJDlrH9HkmS90d9yJ7DaNfllzWNTLbvEpnPut//xw/IfubkCLf jTrw0RIVFPQRdHhzD2ablptrbjmg4XU2IRG7aTwV0rphK0/iAgUiu1VXabJwgzGNSI3H DiMUhNdS02jW5h3eJl5xiKRxJ3WHyRLh8Y4Er0HUwQ3qV0++sh8EHWhKQGCbJv8a/skB 8sxXZQB6ZithtN2CUnQGqIpMOoA1svZnNqo2sknHF8MINDNwN5j2dfcQxDLnDSnwm4uU 7YlQ== X-Gm-Message-State: APjAAAW837VGV43UP6GZELhfjwQVnDFNzcLDpjJs5Brr7tCKA6rzZ+XJ GvxQzh+OsnBA74Spsogyfcs= X-Received: by 2002:a17:902:6bc3:: with SMTP id m3mr4555759plt.185.1576087856306; Wed, 11 Dec 2019 10:10:56 -0800 (PST) Received: from localhost.localdomain (campus-094-212.ucdavis.edu. [168.150.94.212]) by smtp.gmail.com with ESMTPSA id x33sm3552651pga.86.2019.12.11.10.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 10:10:55 -0800 (PST) From: SeongJae Park X-Google-Original-From: SeongJae Park To: jgross@suse.com, axboe@kernel.dk, konrad.wilk@oracle.com Cc: SeongJae Park , pdurrant@amazon.com, sjpark@amazon.com, sj38.park@gmail.com, xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 3/3] xen/blkback: Remove unnecessary static variable name prefixes Date: Wed, 11 Dec 2019 18:10:16 +0000 Message-Id: <20191211181016.14366-4-sjpark@amazon.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191211181016.14366-1-sjpark@amazon.de> References: <20191211181016.14366-1-sjpark@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A few of static variables in blkback have 'xen_blkif_' prefix, though it is unnecessary for static variables. This commit removes such prefixes. Reviewed-by: Roger Pau Monné Signed-off-by: SeongJae Park --- drivers/block/xen-blkback/blkback.c | 37 +++++++++++++---------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 98823d150905..f41c698dd854 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -62,8 +62,8 @@ * IO workloads. */ -static int xen_blkif_max_buffer_pages = 1024; -module_param_named(max_buffer_pages, xen_blkif_max_buffer_pages, int, 0644); +static int max_buffer_pages = 1024; +module_param_named(max_buffer_pages, max_buffer_pages, int, 0644); MODULE_PARM_DESC(max_buffer_pages, "Maximum number of free pages to keep in each block backend buffer"); @@ -78,8 +78,8 @@ MODULE_PARM_DESC(max_buffer_pages, * algorithm. */ -static int xen_blkif_max_pgrants = 1056; -module_param_named(max_persistent_grants, xen_blkif_max_pgrants, int, 0644); +static int max_pgrants = 1056; +module_param_named(max_persistent_grants, max_pgrants, int, 0644); MODULE_PARM_DESC(max_persistent_grants, "Maximum number of grants to map persistently"); @@ -88,8 +88,8 @@ MODULE_PARM_DESC(max_persistent_grants, * use. The time is in seconds, 0 means indefinitely long. */ -static unsigned int xen_blkif_pgrant_timeout = 60; -module_param_named(persistent_grant_unused_seconds, xen_blkif_pgrant_timeout, +static unsigned int pgrant_timeout = 60; +module_param_named(persistent_grant_unused_seconds, pgrant_timeout, uint, 0644); MODULE_PARM_DESC(persistent_grant_unused_seconds, "Time in seconds an unused persistent grant is allowed to " @@ -137,9 +137,8 @@ module_param(log_stats, int, 0644); static inline bool persistent_gnt_timeout(struct persistent_gnt *persistent_gnt) { - return xen_blkif_pgrant_timeout && - (jiffies - persistent_gnt->last_used >= - HZ * xen_blkif_pgrant_timeout); + return pgrant_timeout && (jiffies - persistent_gnt->last_used >= + HZ * pgrant_timeout); } /* Once a memory pressure is detected, squeeze free page pools for a while. */ @@ -249,7 +248,7 @@ static int add_persistent_gnt(struct xen_blkif_ring *ring, struct persistent_gnt *this; struct xen_blkif *blkif = ring->blkif; - if (ring->persistent_gnt_c >= xen_blkif_max_pgrants) { + if (ring->persistent_gnt_c >= max_pgrants) { if (!blkif->vbd.overflow_max_grants) blkif->vbd.overflow_max_grants = 1; return -EBUSY; @@ -412,14 +411,13 @@ static void purge_persistent_gnt(struct xen_blkif_ring *ring) goto out; } - if (ring->persistent_gnt_c < xen_blkif_max_pgrants || - (ring->persistent_gnt_c == xen_blkif_max_pgrants && + if (ring->persistent_gnt_c < max_pgrants || + (ring->persistent_gnt_c == max_pgrants && !ring->blkif->vbd.overflow_max_grants)) { num_clean = 0; } else { - num_clean = (xen_blkif_max_pgrants / 100) * LRU_PERCENT_CLEAN; - num_clean = ring->persistent_gnt_c - xen_blkif_max_pgrants + - num_clean; + num_clean = (max_pgrants / 100) * LRU_PERCENT_CLEAN; + num_clean = ring->persistent_gnt_c - max_pgrants + num_clean; num_clean = min(ring->persistent_gnt_c, num_clean); pr_debug("Going to purge at least %u persistent grants\n", num_clean); @@ -614,8 +612,7 @@ static void print_stats(struct xen_blkif_ring *ring) current->comm, ring->st_oo_req, ring->st_rd_req, ring->st_wr_req, ring->st_f_req, ring->st_ds_req, - ring->persistent_gnt_c, - xen_blkif_max_pgrants); + ring->persistent_gnt_c, max_pgrants); ring->st_print = jiffies + msecs_to_jiffies(10 * 1000); ring->st_rd_req = 0; ring->st_wr_req = 0; @@ -675,7 +672,7 @@ int xen_blkif_schedule(void *arg) if (time_before(jiffies, buffer_squeeze_end)) shrink_free_pagepool(ring, 0); else - shrink_free_pagepool(ring, xen_blkif_max_buffer_pages); + shrink_free_pagepool(ring, max_buffer_pages); if (log_stats && time_after(jiffies, ring->st_print)) print_stats(ring); @@ -902,7 +899,7 @@ static int xen_blkbk_map(struct xen_blkif_ring *ring, continue; } if (use_persistent_gnts && - ring->persistent_gnt_c < xen_blkif_max_pgrants) { + ring->persistent_gnt_c < max_pgrants) { /* * We are using persistent grants, the grant is * not mapped but we might have room for it. @@ -929,7 +926,7 @@ static int xen_blkbk_map(struct xen_blkif_ring *ring, pages[seg_idx]->persistent_gnt = persistent_gnt; pr_debug("grant %u added to the tree of persistent grants, using %u/%u\n", persistent_gnt->gnt, ring->persistent_gnt_c, - xen_blkif_max_pgrants); + max_pgrants); goto next; } if (use_persistent_gnts && !blkif->vbd.overflow_max_grants) { -- 2.17.1