From patchwork Sat Jan 21 06:57:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13110988 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 B8424C38A23 for ; Sat, 21 Jan 2023 06:58:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5605F6B007B; Sat, 21 Jan 2023 01:58:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C0A36B007E; Sat, 21 Jan 2023 01:58:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C5FD8E0001; Sat, 21 Jan 2023 01:58:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 188076B007B for ; Sat, 21 Jan 2023 01:58:23 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id ACCC61A05BD for ; Sat, 21 Jan 2023 06:58:22 +0000 (UTC) X-FDA: 80377902444.29.6D2CD90 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf12.hostedemail.com (Postfix) with ESMTP id 1129C4000B for ; Sat, 21 Jan 2023 06:58:20 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=EwtGJdYh; spf=none (imf12.hostedemail.com: domain of BATV+1651c3ebed9361b307e7+7090+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+1651c3ebed9361b307e7+7090+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=1674284301; 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=KsJYUKCBPxMXQNHi3WnL4RA6ftOvpH5p5PgVWYGya7ALN7y6QjYnCFZatWpSxLch31qc31 ByCiysRY/aIBYZy74G8habcBPeMwd84WFAlexNz94P4bllN3xBCFu0XEwEnCiYwZUDU1XU 3s3dmbyMt0AirL0LT06/hYlOwJs6BWU= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=EwtGJdYh; spf=none (imf12.hostedemail.com: domain of BATV+1651c3ebed9361b307e7+7090+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+1651c3ebed9361b307e7+7090+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674284301; a=rsa-sha256; cv=none; b=f4qOlvFxICQ0soIuNEpJ/EdPRU1plHg3qf4EgN8FhUHQGBuigNEYDfII5TeTvndB/S16uD JwbTCkaYdsWWXvBm1vPaEoOhpbroN6st1oEQ9bbMocj3oROxQEDd/molz2yOAWRcQfhlKo fph4xfjvIteuxbaLcZgyBzUxuuhiaA4= 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=EwtGJdYhbY2t5msbayuhoiWkpe t6MwHMua7C4MCPLQpu3tFasW+WmUYj7lC4AOYQnwz08fambYeKpMPRiROaZQd5HO+QYqJCB1TNKNy NDrFLEbFZd7oXPqhg22FKmQ/iZyvTzrfDVoCr7fi/kMrj5I5xwyScolm4xH6P4xCA8wakx0Djui6w 5gGQm0cHzgcYY4fVBu0uPaBIxMKCzwsH1+EMy0qjvlNu7sv+t/x+2tPkuaoQrrof7B6CQmFfx/lm6 cNXGZSlwSjg0xTj8OBxNz35zWnQF3+xHMG9XkqAuteCgpWjW/af6YwE6nakL4Pe/4B+KdbLazR4zp PKWk1kjg==; Received: from [2001:4bb8:19a:2039:6754:cc81:9ace:36fc] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJ7pN-00DSRH-Cq; Sat, 21 Jan 2023 06:58:14 +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/7] mm: remove FGP_ENTRY Date: Sat, 21 Jan 2023 07:57:54 +0100 Message-Id: <20230121065755.1140136-7-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230121065755.1140136-1-hch@lst.de> References: <20230121065755.1140136-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-Server: rspam05 X-Rspamd-Queue-Id: 1129C4000B X-Stat-Signature: ozo8xsq4xos8p6t8bwgiiem3rd1psrtn X-Rspam-User: X-HE-Tag: 1674284300-881622 X-HE-Meta: U2FsdGVkX18pD15fGN44PCSUHN1VT4dMzSa80uXASvgxYdIvmTKFj6FkJyBZW89nTAkLClBEaszyumm9W9wVZs0O49g7Y/9E4qVRJqg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+NWb1IxWnMMIMEoNL3SYn7b7Jp6aC2By1Jeuzb7jCiiZtgf4HFDQ1NB0XReqJU9HKq5C+BGAvGhidQxaobX1upPhcHo/F9s4jQG9YphTFpzI38x+kglLtRmCp4z1q/EVAuN1qh3HpkWB1Y2agAGP0WjLU6/H5EzilzpQoTfLdGuEEZXcYGCXDKrzSJpuJMgRbgg3lnuCX2IrSJWGQ4qnUrwjEtVt+WoZ7fw/bmRquHrBRCgnkBqML1zWff3VUW5n01dp9mV6d8dXAtuJ36WpDle3hrQhzFEhNgt 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);