From patchwork Fri Dec 24 06:22:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12698826 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 F18A4C433F5 for ; Fri, 24 Dec 2021 06:23:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 81F936B0080; Fri, 24 Dec 2021 01:23:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A88E6B0081; Fri, 24 Dec 2021 01:23:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D31F6B0082; Fri, 24 Dec 2021 01:23:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 338C46B0080 for ; Fri, 24 Dec 2021 01:23:15 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D6E388249980 for ; Fri, 24 Dec 2021 06:23:14 +0000 (UTC) X-FDA: 78951695508.03.4F9F932 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf27.hostedemail.com (Postfix) with ESMTP id A54774001A for ; Fri, 24 Dec 2021 06:23:13 +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=rCuzByWk/UBcQEl9w7lyfHY1O6NBiGqe+DaoOZw9lf4=; b=WZgFE/0ht2Dhs+huwb3RV6nCRV laDZzK2vPGT3eiF21vo7mCuWOptjzCOz8DCELmp75DNIykNhHazH3OOmiusTDqdb3X7byyd5foqeI yCT0F3ra2iDpIkBJBRlR6rxKwGxVeA4MbPc2sfcxpnPd/SMKskDnbmQWgoGa06t+aD/oWkuRukmlA 0DL6RcrByaBwJKFjzdySB8brl5XnegdQsJe1LHcwNXrTZYEgm2Tc/yUflQwIgCUreNmkckTz+235C tJTtUErycBfpQdTCi7Jj3ZN1pu4XC40YVWgEgkYOR2p2IcjK5Gdg8ba7mrqkQtf3WtwE8SgQAqhfn 78NKxupQ==; 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 1n0dyp-00Dn1I-RV; Fri, 24 Dec 2021 06:23:04 +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 05/13] frontswap: remove frontswap_curr_pages Date: Fri, 24 Dec 2021 07:22:38 +0100 Message-Id: <20211224062246.1258487-6-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-Rspamd-Queue-Id: A54774001A X-Stat-Signature: rzf7g54n85k6ohmmkq5azkrphi5dfkai Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="WZgFE/0h"; dmarc=none; spf=none (imf27.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 X-Rspamd-Server: rspam02 X-HE-Tag: 1640326993-19025 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: frontswap_curr_pages is never called, so remove it. Signed-off-by: Christoph Hellwig --- include/linux/frontswap.h | 1 - mm/frontswap.c | 28 ---------------------------- 2 files changed, 29 deletions(-) diff --git a/include/linux/frontswap.h b/include/linux/frontswap.h index d268d7bb65134..5205c2977b208 100644 --- a/include/linux/frontswap.h +++ b/include/linux/frontswap.h @@ -24,7 +24,6 @@ struct frontswap_ops { }; extern void frontswap_register_ops(struct frontswap_ops *ops); -extern unsigned long frontswap_curr_pages(void); extern bool __frontswap_test(struct swap_info_struct *, pgoff_t); extern void __frontswap_init(unsigned type, unsigned long *map); diff --git a/mm/frontswap.c b/mm/frontswap.c index a77ebba6101bd..af8f68d0e5cc0 100644 --- a/mm/frontswap.c +++ b/mm/frontswap.c @@ -330,34 +330,6 @@ void __frontswap_invalidate_area(unsigned type) } EXPORT_SYMBOL(__frontswap_invalidate_area); -static unsigned long __frontswap_curr_pages(void) -{ - unsigned long totalpages = 0; - struct swap_info_struct *si = NULL; - - assert_spin_locked(&swap_lock); - plist_for_each_entry(si, &swap_active_head, list) - totalpages += atomic_read(&si->frontswap_pages); - return totalpages; -} - -/* - * Count and return the number of frontswap pages across all - * swap devices. This is exported so that backend drivers can - * determine current usage without reading debugfs. - */ -unsigned long frontswap_curr_pages(void) -{ - unsigned long totalpages = 0; - - spin_lock(&swap_lock); - totalpages = __frontswap_curr_pages(); - spin_unlock(&swap_lock); - - return totalpages; -} -EXPORT_SYMBOL(frontswap_curr_pages); - static int __init init_frontswap(void) { #ifdef CONFIG_DEBUG_FS