From mboxrd@z Thu Jan 1 00:00:00 1970 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 E193EC433FE for ; Sat, 22 Jan 2022 06:15:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 799666B00F8; Sat, 22 Jan 2022 01:15:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 723836B00F9; Sat, 22 Jan 2022 01:15:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E9F96B00FA; Sat, 22 Jan 2022 01:15:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0180.hostedemail.com [216.40.44.180]) by kanga.kvack.org (Postfix) with ESMTP id 4997A6B00F8 for ; Sat, 22 Jan 2022 01:15:12 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0FAC61818286B for ; Sat, 22 Jan 2022 06:15:12 +0000 (UTC) X-FDA: 79056910464.09.42B893A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf10.hostedemail.com (Postfix) with ESMTP id E13E1C0014 for ; Sat, 22 Jan 2022 06:15:10 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AE74FB820FD; Sat, 22 Jan 2022 06:15:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09239C340E4; Sat, 22 Jan 2022 06:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1642832108; bh=UGLNdrZxiweLcJpohTqmdPSk289/22nfc2ysBkOSbhQ=; h=Date:From:To:Subject:In-Reply-To:From; b=whRpb9Rf2MNXMsY9cwFt744Y+82Uye4ce8uSI387f6R89yuUssO/3caN+tVR8nghI ofcunWnXzi+IEsY+iyAMrhb06YT29Bz4DGqbQCodrQaJ3lZGj/MpzkAvgcmzR9ZuUG /PUcTU7lJmIayLO4/VDyrLifplfz73XSbwm9ss2s= Date: Fri, 21 Jan 2022 22:15:07 -0800 From: Andrew Morton To: akpm@linux-foundation.org, ddstreet@ieee.org, geert@linux-m68k.org, hch@lst.de, hughd@google.com, jgross@suse.com, Konrad.wilk@oracle.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, sjenning@redhat.com, torvalds@linux-foundation.org, vitaly.wool@konsulko.com, willy@infradead.org Subject: [patch 67/69] mm: mark swap_lock and swap_active_head static Message-ID: <20220122061507.g8juJ_8I0%akpm@linux-foundation.org> In-Reply-To: <20220121221021.60533b009c357d660791476e@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: E13E1C0014 X-Stat-Signature: h6c4xhg9db7pz9hem1cmecanrt3oyr7r Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=whRpb9Rf; spf=pass (imf10.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: nil X-HE-Tag: 1642832110-491680 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: From: Christoph Hellwig Subject: mm: mark swap_lock and swap_active_head static swap_lock and swap_active_head are only used in swapfile.c, so mark them static. Link: https://lkml.kernel.org/r/20211224062246.1258487-12-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton --- include/linux/swapfile.h | 2 -- mm/swapfile.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) --- a/include/linux/swapfile.h~mm-mark-swap_lock-and-swap_active_head-static +++ a/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); --- a/mm/swapfile.c~mm-mark-swap_lock-and-swap_active_head-static +++ a/mm/swapfile.c @@ -49,7 +49,7 @@ static bool swap_count_continued(struct 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[] = "Unu * 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 _