Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp284186rwn; Wed, 14 Sep 2022 21:01:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR7SrhhYjZs7JMjQa0FLykqbf+fqbJ7o6M9dljRGS2DYDe+CZZJcr93zSd72Eaf7HSw1VH98 X-Received: by 2002:a05:6402:4d9:b0:451:f433:dced with SMTP id n25-20020a05640204d900b00451f433dcedmr13099169edw.42.1663214509421; Wed, 14 Sep 2022 21:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663214509; cv=none; d=google.com; s=arc-20160816; b=sTcmeHYa7shs1N6uMug1rVUUqCBVrLbZHvd6vG/wYXsPUFP5uMuo+DQIg2libh+WyY Lobic1Boj4ZIVmAyK0UbNM1uAZmC57ndorZWgD8eCxG59VgURZo0P4GOlHkYFM/jFlnd KqoDV3dlFKRO/pSxIPjqLb7U+W3AQkDBhZZT86VZmWlggk7xjXLvA74dwaUPcT5mwVUW lvp+UGLTItx+2JOOHZDfU+TE117Q7TgjHGw3graFpEIHgiSb0YQNhKbEiUDKbJodCGqc GYUSNVfQA0K/4QtU+66/ZUfaaL3kJhUxfNCpPUzffoGjWKJLAoqRnRxs0oi98gwfceOo hvZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ysb6lrI5RZOlgACFnqJEsH8gquEOGQoKh0o5Ep3eycA=; b=pn67qzeuuBa3dW8e2Oar8BK0zHbKRO2lvGkRrmunrUFg1LolkX9eBZRjpl0zTKrrXI uaC76pDGC93S+kkLP7Zn8/CjTzqnJDSEUhtZibSgP+zr1/rT71nSJ5FYuBnHGsmYxdll K+E9tdKukcahLsW2uqkuHb/SCs6DkjqQ7/FWrVr9dUd9krS/HK070o1S2h5egpo0vy93 9C+OHd5cl0t5rfQScaX2fI3Fvo+WD4mF7zyElaaodoUkIwwBRvqGFpj7Q91nS9BoGKJ6 WPK6YXi873QvPVNhtsHEDL9mk7VhZlY17G5nMCykXuVaweJjfJfctasICSFTUyACfm84 aAEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o9-20020a170906974900b0073d045866b3si6618724ejy.225.2022.09.14.21.01.17; Wed, 14 Sep 2022 21:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbiIODQn (ORCPT + 99 others); Wed, 14 Sep 2022 23:16:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbiIODQ0 (ORCPT ); Wed, 14 Sep 2022 23:16:26 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 085BB91D2D for ; Wed, 14 Sep 2022 20:16:19 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MSj0Y1twvzNmKD; Thu, 15 Sep 2022 11:11:41 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 15 Sep 2022 11:16:06 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 15 Sep 2022 11:16:06 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , Nathan Chancellor , "Christoph Hellwig" CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v5 1/5] Revert "mm: mark swap_lock and swap_active_head static" Date: Thu, 15 Sep 2022 11:49:59 +0800 Message-ID: <20220915035003.3347466-2-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220915035003.3347466-1-liushixin2@huawei.com> References: <20220915035003.3347466-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 633423a09cb5cfe61438283e1ce49c23cf4a0611. swap_lock and swap_active_head will be used in next patch, so export it again. Signed-off-by: Liu Shixin --- include/linux/swapfile.h | 2 ++ mm/swapfile.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/swapfile.h b/include/linux/swapfile.h index 7ed529a77c5b..a2540b8396e2 100644 --- a/include/linux/swapfile.h +++ b/include/linux/swapfile.h @@ -6,6 +6,8 @@ * 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); unsigned long arch_max_swapfile_size(void); diff --git a/mm/swapfile.c b/mm/swapfile.c index 4efcfe34e45b..6cdb34c01dd3 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -51,7 +51,7 @@ static bool swap_count_continued(struct swap_info_struct *, pgoff_t, unsigned char); static void free_swap_count_continuations(struct swap_info_struct *); -static DEFINE_SPINLOCK(swap_lock); +DEFINE_SPINLOCK(swap_lock); static unsigned int nr_swapfiles; atomic_long_t nr_swap_pages; /* @@ -77,7 +77,7 @@ static const char Unused_offset[] = "Unused swap offset entry "; * all active swap_info_structs * protected with swap_lock, and ordered by priority. */ -static PLIST_HEAD(swap_active_head); +PLIST_HEAD(swap_active_head); /* * all available (active, not full) swap_info_structs -- 2.25.1