From patchwork Fri Dec 24 06:22:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12698832 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EE77C433FE for ; Fri, 24 Dec 2021 06:23:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 140A86B0095; Fri, 24 Dec 2021 01:23:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F0C76B0096; Fri, 24 Dec 2021 01:23:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFA276B0098; Fri, 24 Dec 2021 01:23:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id E2AA46B0095 for ; Fri, 24 Dec 2021 01:23:32 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AAFB58249980 for ; Fri, 24 Dec 2021 06:23:32 +0000 (UTC) X-FDA: 78951696264.15.8D7EC23 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf22.hostedemail.com (Postfix) with ESMTP id 77C77C0029 for ; Fri, 24 Dec 2021 06:23:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=TXOg6vAqASAtXPc4PNjieJzyV7xM2+Tbu5xGMKnWiwg=; b=Xs9iWhoTKLK3zCqDrDiBJ9agGb RCP0wHnFSbW5sI/jLd4O634Q6AnHsu3zpw1JUZyorSLPs4Qk5fjcjifU8s1BhitewH+Iqc9da0WKR y5g5wk5ErDspgUCncqSG/RGzXOBarTvKUsg2Tmy80w9HCLebL2/h7D1YYtAUJqHO3ucmS7zySuc1B 9oeMfW+nTEEOX5ObVVGFAujTLUAdBwHKpz5IZeY1KgAjuHpRlON2feYCOVGTABQtTjr7EYHqzudje CDauuNIuPtSkhysUkzbwycfRQCqyQ1l2CCWUDjp6VomRMrLO43XIfjd6YrhPFg7LUIyB73OdDZrRR wWhz05FQ==; Received: from p4fdb0b85.dip0.t-ipconnect.de ([79.219.11.133] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0dz7-00Dn8N-IH; Fri, 24 Dec 2021 06:23:22 +0000 From: Christoph Hellwig To: Andrew Morton , Konrad Rzeszutek Wilk Cc: Hugh Dickins , Seth Jennings , Dan Streetman , Vitaly Wool , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 11/13] mm: mark swap_lock and swap_active_head static Date: Fri, 24 Dec 2021 07:22:44 +0100 Message-Id: <20211224062246.1258487-12-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211224062246.1258487-1-hch@lst.de> References: <20211224062246.1258487-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Stat-Signature: 8nu74j79ezxcqg4ojd996xe46dnu566a X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 77C77C0029 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Xs9iWhoT; spf=none (imf22.hostedemail.com: domain of BATV+afcec93cc8ffef6ccdbc+6697+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+afcec93cc8ffef6ccdbc+6697+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-HE-Tag: 1640327011-274112 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: swap_lock and swap_active_head are only used in swapfile.c, so mark them static. Signed-off-by: Christoph Hellwig --- include/linux/swapfile.h | 2 -- mm/swapfile.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/swapfile.h b/include/linux/swapfile.h index 809cd01ef2c57..54078542134c1 100644 --- a/include/linux/swapfile.h +++ b/include/linux/swapfile.h @@ -6,8 +6,6 @@ * these were static in swapfile.c but frontswap.c needs them and we don't * want to expose them to the dozens of source files that include swap.h */ -extern spinlock_t swap_lock; -extern struct plist_head swap_active_head; extern struct swap_info_struct *swap_info[]; extern unsigned long generic_max_swapfile_size(void); extern unsigned long max_swapfile_size(void); diff --git a/mm/swapfile.c b/mm/swapfile.c index 82342c77791bb..bf0df7aa7158f 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -49,7 +49,7 @@ static bool swap_count_continued(struct swap_info_struct *, pgoff_t, unsigned char); static void free_swap_count_continuations(struct swap_info_struct *); -DEFINE_SPINLOCK(swap_lock); +static DEFINE_SPINLOCK(swap_lock); static unsigned int nr_swapfiles; atomic_long_t nr_swap_pages; /* @@ -71,7 +71,7 @@ static const char Unused_offset[] = "Unused swap offset entry "; * all active swap_info_structs * protected with swap_lock, and ordered by priority. */ -PLIST_HEAD(swap_active_head); +static PLIST_HEAD(swap_active_head); /* * all available (active, not full) swap_info_structs