From patchwork Mon May 9 13:14:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12843534 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 464A4C433FE for ; Mon, 9 May 2022 13:14:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 011D36B0081; Mon, 9 May 2022 09:14:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DE6AD6B0088; Mon, 9 May 2022 09:14:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5E796B0081; Mon, 9 May 2022 09:14:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 67D926B0081 for ; Mon, 9 May 2022 09:14:16 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9ED4725849 for ; Mon, 9 May 2022 13:14:12 +0000 (UTC) X-FDA: 79446247944.19.45390BB Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf07.hostedemail.com (Postfix) with ESMTP id E6D374005D for ; Mon, 9 May 2022 13:14:05 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KxhST1mWxzhZ42; Mon, 9 May 2022 21:13:29 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 9 May 2022 21:14:04 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , Subject: [PATCH 08/15] mm/swap: make page_swapcount and __lru_add_drain_all Date: Mon, 9 May 2022 21:14:09 +0800 Message-ID: <20220509131416.17553-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220509131416.17553-1-linmiaohe@huawei.com> References: <20220509131416.17553-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E6D374005D X-Stat-Signature: mueg8ng1f4meq7cwige8kbdo9qz49yhh X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf07.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-HE-Tag: 1652102045-240507 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: Make page_swapcount and __lru_add_drain_all static. They are only used within the file now. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador --- include/linux/swap.h | 7 ------- mm/swap.c | 2 +- mm/swapfile.c | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 999c7d79c2d5..8772132d21dc 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -490,7 +490,6 @@ int swap_type_of(dev_t device, sector_t offset); int find_first_swap(dev_t *device); extern unsigned int count_swap_pages(int, int); extern sector_t swapdev_block(int, pgoff_t); -extern int page_swapcount(struct page *); extern int __swap_count(swp_entry_t entry); extern int __swp_swapcount(swp_entry_t entry); extern int swp_swapcount(swp_entry_t entry); @@ -562,12 +561,6 @@ static inline void put_swap_page(struct page *page, swp_entry_t swp) { } - -static inline int page_swapcount(struct page *page) -{ - return 0; -} - static inline int __swap_count(swp_entry_t entry) { return 0; diff --git a/mm/swap.c b/mm/swap.c index 7e320ec08c6a..6d2c37f781f8 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -748,7 +748,7 @@ static void lru_add_drain_per_cpu(struct work_struct *dummy) * Calling this function with cpu hotplug locks held can actually lead * to obscure indirect dependencies via WQ context. */ -inline void __lru_add_drain_all(bool force_all_cpus) +static inline void __lru_add_drain_all(bool force_all_cpus) { /* * lru_drain_gen - Global pages generation number diff --git a/mm/swapfile.c b/mm/swapfile.c index 7b4c99ca2aea..133e03fea104 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1430,7 +1430,7 @@ void swapcache_free_entries(swp_entry_t *entries, int n) * This does not give an exact answer when swap count is continued, * but does include the high COUNT_CONTINUED flag to allow for that. */ -int page_swapcount(struct page *page) +static int page_swapcount(struct page *page) { int count = 0; struct swap_info_struct *p;