Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3106940rwe; Mon, 29 Aug 2022 06:04:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR6PY3tbuq591dD1OZ2wUvdV359kvdLTeqkwA715iae600OWXAMUeJblB37w9BhVu6iFCGkV X-Received: by 2002:a17:906:9b8b:b0:741:56d3:b8fc with SMTP id dd11-20020a1709069b8b00b0074156d3b8fcmr6351618ejc.337.1661778249114; Mon, 29 Aug 2022 06:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661778249; cv=none; d=google.com; s=arc-20160816; b=Yk28M63C5Bu6PPNjYv8ro631xtJ5uuKORpGy9p4gHs3mKxAsnXCCn6Xao7MvSOWtVd pJHKgM9kAlXgG08VmZRSfuDDEtgT9PFfFtQpc+wPABPGhnEUh3QMjn6LKMBcQxtliM/b IouwiOtZTIBCuGt4Da/z1m/CjcoEU9sNpEI7NAzR18VaqGAyZf8do76BeJYX5tZGX4WQ ZTwxPEENiKj6vMUGkNB5ULpRIc/dedotJF6AT64SqGlfY1aO+V9WTOVmMGasFJWdUGsQ T9KTPS8gHblvNh/82FYj7JqWjYlKdQh7srAkg5sjyMejDv9g0HIWqNHi3xOnoVU6+F+U CudQ== 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=dV3Bom0lrrpsZq3vBj6qgnv42s9Ihha7hTjTKzw7AEg=; b=idtM6hIkTS3el/ipwceancAgAw8rRVP3a/IdktPerL/KEzOD7NDOmRZCzYx8pvj1EK j2F9LVJ+GYlkItl/CFv1FGmr23AG8GZBoJYtreDX7zzYsUMnHWW9pFMQ+CobxrBXhOjo b3Z0ARHF7tPz74FYMeODfFbu2YGCpUsUvrkbg5fSLydjqFG0xylTLt1B4xcRor58GZcn d11FAGbhumT4XKezgoYYWa27zUEP3GkkILUOc4U4t/1RMZJQBZS8NXuChgq2hMye6CMj fipnvMHurag6TWtlyYHts/Xre3AVTlGjIWSTXnv3D3xoRdgLLhM/nGeS+pEYapFI7btz oHgA== 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 m22-20020a056402431600b0044877f26882si2304223edc.154.2022.08.29.06.03.43; Mon, 29 Aug 2022 06:04:09 -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 S230508AbiH2M6C (ORCPT + 99 others); Mon, 29 Aug 2022 08:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbiH2M4h (ORCPT ); Mon, 29 Aug 2022 08:56:37 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E65186DC for ; Mon, 29 Aug 2022 05:48:37 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MGVWs5TzdzkWkq; Mon, 29 Aug 2022 20:44:57 +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; Mon, 29 Aug 2022 20:48:34 +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; Mon, 29 Aug 2022 20:48:34 +0800 From: Liu Shixin To: Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , Nathan Chancellor , "Christoph Hellwig" CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH -next v4 2/6] Revert "mm: mark swap_lock and swap_active_head static" Date: Mon, 29 Aug 2022 21:22:58 +0800 Message-ID: <20220829132302.3367054-3-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829132302.3367054-1-liushixin2@huawei.com> References: <20220829132302.3367054-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 2fbcc9afd814..75fc069594a5 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); /* Maximum swapfile size supported for the arch (not inclusive). */ diff --git a/mm/swapfile.c b/mm/swapfile.c index 469d9af86be2..d383b282f269 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