From patchwork Wed Jan 18 09:43:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13105973 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 21645C38159 for ; Wed, 18 Jan 2023 09:43:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 519716B0074; Wed, 18 Jan 2023 04:43:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A7036B007B; Wed, 18 Jan 2023 04:43:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26F596B007D; Wed, 18 Jan 2023 04:43:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 16DD06B0074 for ; Wed, 18 Jan 2023 04:43:55 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DCE74A0559 for ; Wed, 18 Jan 2023 09:43:54 +0000 (UTC) X-FDA: 80367433188.11.7C8D2C5 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf01.hostedemail.com (Postfix) with ESMTP id 72C0A40008 for ; Wed, 18 Jan 2023 09:43:53 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=fWwuU2mF; dmarc=none; spf=none (imf01.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674035033; 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=OEkmrOTp9bp0MHf7fBWQdFeBfwkVijLbFt/ZuD+SID8=; b=oemTuv/y4cfav4eO8ZIQJbKDZfWtATj9/inQwiZfa+AE2BwqTtM5SaXIevtWyeI24Q/Deo +DZkjuu8FR2rnvK+u8rISVgUNjyxeQRKxr5khYf+NFbkDK/4kfX5XtAvE7ZRP3DSxC8Ejm O78fG8GROGXrVkALVAbRp4YX5amgBxM= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=fWwuU2mF; dmarc=none; spf=none (imf01.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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674035033; a=rsa-sha256; cv=none; b=Qke91QvXxahdui2FfZUaGk8lb457DvH8u1BQXyHyVVi3jNRxyx+NBFJ7Tfqc/k1rMFbBjV /tXLFP1mp6wntSrKv+DpCl8jA0fdlJVSsvLElX0oWuOFCeogRlVq9WGXCE88G6YLBMAfar kW45hYuPp4xmzgTEFL06FNfBwqvjVjY= 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=OEkmrOTp9bp0MHf7fBWQdFeBfwkVijLbFt/ZuD+SID8=; b=fWwuU2mFDmXn7LwEaystbVgNKf 6W93ZUCVYBEuM6BrPk3yZuB09IzyaYZNsTkpzicBlyvZKyWPX0ki0J49msMlHfuxugAu1eEpI689X y3CMYNJbf3x3e3glDVCfRkR2AGRlBUjvBFY2PU2onSO73vKdDz+4yihTQap94U2geZXsUIy3Nugm1 wwPypEDOLE1/EGs/LD+ckYeTYmWPL3OM5Ra2Ppy9xP69HNLk6e/o8aBvYgPktsz2IXYbniaEeToGZ 4S8+Y9JfE4TjlT4PHg3Q+l/NnOBJcLddPWjYBKnTtMY7K5Z+TnqSyyRu9ooFbBu2aIsdGxbH9f2oO xXZ8yYKQ==; 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 1pI4yt-0009wo-CP; Wed, 18 Jan 2023 09:43:43 +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 2/9] mm: make mapping_get_entry available outside of filemap.c Date: Wed, 18 Jan 2023 10:43:22 +0100 Message-Id: <20230118094329.9553-3-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-Server: rspam02 X-Rspamd-Queue-Id: 72C0A40008 X-Stat-Signature: i34cdyad1m8u1piaakfutqn4pin7bcxf X-HE-Tag: 1674035033-788102 X-HE-Meta: U2FsdGVkX1/K8I6vOPpaC46WFyT/VTc+QgzJL2y7/dd441YYYljLv8FucV/+ON+Mcd6Fguk3m5BFcIdX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ccS15OimAeEk/0WqtEJOQ3wt5RsHmP8gwauBjkfrrOxYtuneAOd2AOtmR1I43CJ0JDfU7mnFJ+pcg= 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: mapping_get_entry is useful for page cache API users that need to know about xa_value internals. Rename it and make it available in pagemap.h. Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 1 + mm/filemap.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 9f108168377195..24dedf6b12be49 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -507,6 +507,7 @@ pgoff_t page_cache_prev_miss(struct address_space *mapping, #define FGP_ENTRY 0x00000080 #define FGP_STABLE 0x00000100 +void *filemap_get_entry(struct address_space *mapping, pgoff_t index); struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index, int fgp_flags, gfp_t gfp); struct page *pagecache_get_page(struct address_space *mapping, pgoff_t index, diff --git a/mm/filemap.c b/mm/filemap.c index c915ded191f03f..ed0583f9e27512 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1834,7 +1834,7 @@ EXPORT_SYMBOL(page_cache_prev_miss); */ /* - * mapping_get_entry - Get a page cache entry. + * filemap_get_entry - Get a page cache entry. * @mapping: the address_space to search * @index: The page cache index. * @@ -1845,7 +1845,7 @@ EXPORT_SYMBOL(page_cache_prev_miss); * * Return: The folio, swap or shadow entry, %NULL if nothing is found. */ -static void *mapping_get_entry(struct address_space *mapping, pgoff_t index) +void *filemap_get_entry(struct address_space *mapping, pgoff_t index) { XA_STATE(xas, &mapping->i_pages, index); struct folio *folio; @@ -1915,7 +1915,7 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index, struct folio *folio; repeat: - folio = mapping_get_entry(mapping, index); + folio = filemap_get_entry(mapping, index); if (xa_is_value(folio)) { if (fgp_flags & FGP_ENTRY) return folio;