From patchwork Wed Jan 18 09:43:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13105978 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 9E2A7C32793 for ; Wed, 18 Jan 2023 09:44:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 359886B0075; Wed, 18 Jan 2023 04:44:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 309C06B0080; Wed, 18 Jan 2023 04:44:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D20E6B0081; Wed, 18 Jan 2023 04:44:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0DED46B0075 for ; Wed, 18 Jan 2023 04:44:14 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 84669C072D for ; Wed, 18 Jan 2023 09:44:13 +0000 (UTC) X-FDA: 80367433986.29.75C831B Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf22.hostedemail.com (Postfix) with ESMTP id 020F8C0015 for ; Wed, 18 Jan 2023 09:44:11 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=tjja759e; spf=none (imf22.hostedemail.com: domain of BATV+aec3eaf5b774c69d00f8+7087+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+aec3eaf5b774c69d00f8+7087+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674035052; a=rsa-sha256; cv=none; b=uLag+LiLt6QNXMuhYjJSQn7y/2eRO0nQNSfDXNXJczp12APutgcF/3Cna7WF5KP8Yk/aBa hYtqQSbdF1o+odajq8FIXXN/Zyk/uQIgt8qX7SamSGqgF5vAhTjV+25A1gZy06bQcw6aO3 XmyI7Ij2q75yWuSbn+1oFiF219yhIC4= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=tjja759e; spf=none (imf22.hostedemail.com: domain of BATV+aec3eaf5b774c69d00f8+7087+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+aec3eaf5b774c69d00f8+7087+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674035052; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=72dbPnQldghXJsWt6hBZ/ADNkiEKaZsKzxCkekJEdAU=; b=lLsJGV4MKPSSMmAyXy6UgiReumYTVu1u+p9vLqCLDrExJgkA+bzHS/Lb93TmwaLt72CWo0 xkCbZA5UmIxghmBDYul7c9IMcsUsZDlR9k1+XdbV9ZTacOy2mu/IAfVYeU71AsGmDPqrmp 72MZqYIbk7Tt/2cctxIAHONCpeImSIo= 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=72dbPnQldghXJsWt6hBZ/ADNkiEKaZsKzxCkekJEdAU=; b=tjja759eWnm9v7J+IWUXZozttN OxM313yixMNrLZv2p6AMh7dEVQGQVttdzzpXCUjYtd/HJPHTDFptjOcJ/ztghPLG4FjwymkosilRR 71WeRyXnd9cVWvfYK3gwuP8UaCscXZDWNsVkdryui1LtBz7pHrZZlDwm9tOHPzeUWlqVpzLwqs/Nv mQ1wr0mKPRM1oh8fBHkrDd2dD+F4LxbURzWCJO9Qy9VO5kKDaaZ+uUch5hrYQMx04GTYHXBA0yLFD xDHDaJbPbxJzhcRQVGE0fXG65DXX8GVYqTbsMDsQUxetnUYXCE7Y+e2Jxxpl5o1Oq0PIR9p1np8O6 uUlibs6Q==; Received: from 213-147-167-250.nat.highway.webapn.at ([213.147.167.250] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pI4zD-000A5d-GP; Wed, 18 Jan 2023 09:44:04 +0000 From: Christoph Hellwig To: Andrew Morton , Matthew Wilcox , Hugh Dickins Cc: linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, cluster-devel@redhat.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nilfs@vger.kernel.org Subject: [PATCH 6/9] mm: remove FGP_ENTRY Date: Wed, 18 Jan 2023 10:43:26 +0100 Message-Id: <20230118094329.9553-7-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230118094329.9553-1-hch@lst.de> References: <20230118094329.9553-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-Rspam-User: X-Rspamd-Queue-Id: 020F8C0015 X-Rspamd-Server: rspam01 X-Stat-Signature: u994ywcq6wtdntzftbjsupocyic38rtc X-HE-Tag: 1674035051-682239 X-HE-Meta: U2FsdGVkX1/5HvqMb47KSCp2DfFA1l6T7sqZ1ltTiBxlyZwLHx7LbBLMfSG9eZke2vyC6zs5xlvsqPbDnJw9PejvHRgwXL/jjAUvQ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IQzs/lDhQPRiQ2dUO3rkC/TiLCxzik7jaR18= 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: FGP_ENTRY is unused now, so remove it. Signed-off-by: Christoph Hellwig --- include/linux/pagemap.h | 3 +-- mm/filemap.c | 7 +------ mm/folio-compat.c | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 24dedf6b12be49..e2208ee36966ea 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -504,8 +504,7 @@ pgoff_t page_cache_prev_miss(struct address_space *mapping, #define FGP_NOFS 0x00000010 #define FGP_NOWAIT 0x00000020 #define FGP_FOR_MMAP 0x00000040 -#define FGP_ENTRY 0x00000080 -#define FGP_STABLE 0x00000100 +#define FGP_STABLE 0x00000080 void *filemap_get_entry(struct address_space *mapping, pgoff_t index); struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index, diff --git a/mm/filemap.c b/mm/filemap.c index ed0583f9e27512..35baadd130795c 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1889,8 +1889,6 @@ void *filemap_get_entry(struct address_space *mapping, pgoff_t index) * * * %FGP_ACCESSED - The folio will be marked accessed. * * %FGP_LOCK - The folio is returned locked. - * * %FGP_ENTRY - If there is a shadow / swap / DAX entry, return it - * instead of allocating a new folio to replace it. * * %FGP_CREAT - If no page is present then a new page is allocated using * @gfp and added to the page cache and the VM's LRU list. * The page is returned locked and with an increased refcount. @@ -1916,11 +1914,8 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index, repeat: folio = filemap_get_entry(mapping, index); - if (xa_is_value(folio)) { - if (fgp_flags & FGP_ENTRY) - return folio; + if (xa_is_value(folio)) folio = NULL; - } if (!folio) goto no_page; diff --git a/mm/folio-compat.c b/mm/folio-compat.c index 18c48b55792635..f3841b4977b68e 100644 --- a/mm/folio-compat.c +++ b/mm/folio-compat.c @@ -97,8 +97,8 @@ struct page *pagecache_get_page(struct address_space *mapping, pgoff_t index, struct folio *folio; folio = __filemap_get_folio(mapping, index, fgp_flags, gfp); - if (!folio || xa_is_value(folio)) - return &folio->page; + if (!folio) + return NULL; return folio_file_page(folio, index); } EXPORT_SYMBOL(pagecache_get_page);