From patchwork Sat Jan 21 06:57:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13110984 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 0A6D6C38A23 for ; Sat, 21 Jan 2023 06:58:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 81E066B0072; Sat, 21 Jan 2023 01:58:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CD966B0075; Sat, 21 Jan 2023 01:58:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 674E96B0073; Sat, 21 Jan 2023 01:58:11 -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 4728C6B0072 for ; Sat, 21 Jan 2023 01:58:11 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 156681A0F70 for ; Sat, 21 Jan 2023 06:58:11 +0000 (UTC) X-FDA: 80377901982.06.F6FD63E Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf10.hostedemail.com (Postfix) with ESMTP id 53852C0002 for ; Sat, 21 Jan 2023 06:58:09 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="o85/NWmc"; spf=none (imf10.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=1674284289; 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=bHu6JRelc+qZi6VORfZamvMyu/HPfdmrjb1TOTy3Elw=; b=OufWn8ssRwfTv94N3WzhqQC4EiBB4/fKfWkiompi1rPXDLBtsoVOHswfXk4ExQo+MoyzbF R8k4HhFlQe9BYhq5ekZPS/If15tz3GOybf1NLX/4KlOQviYXavQN/L13Y5a4Piinmhla6E P/E/K1ijDfm8i+NGHJ8NVdW/tgvtCrs= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="o85/NWmc"; spf=none (imf10.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=1674284289; a=rsa-sha256; cv=none; b=AgF2EfMW/t8LWjVbhDVOmS+WQKGDYY1e1ADmH2cIb54ufzGG651erZrxN1pg2re7BCMEQF JMBzmB+Vycw/PNQ2xDkR+/OncSlZDjqIcsFFEMfvUeAn17R4APUadhvLUiuEhZsUSlHFbM 17Gfh/h+Nl2wkzZUHYwIYU3JrrpRXuE= 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=bHu6JRelc+qZi6VORfZamvMyu/HPfdmrjb1TOTy3Elw=; b=o85/NWmcxDB/Xm7nZyJ0u/OaV4 ggW//BSlYDr37PRhsjTqUedxbeyHbfv86D0FnsnWS/acgHDwbC7vRGBjt++MRUgQ/3pbPOeeMsEB+ yjRRjbsrkonl6kRfgvlX4vfhstx9bcDnXebOYT7/I0dFKcfOFG+xhP8bJ1sS4rofk1BV3nKNKtCGc HP9YgxyOp5ORr9AQtDyrxpJvPs+obr8M5TM+rXPqQkOu3400e818tBxrWdFkj8ktdzJIM00uyH77B JKhwoaJWyaUV/XVYcRHjxVXq35tjpdi8v6cqJRfKVL3Oajn10ei14YSeO22Z6+5oB5hPcuEztJVSc Ss7hYuVg==; 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 1pJ7pC-00DSMf-Vk; Sat, 21 Jan 2023 06:58:03 +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/7] mm: make mapping_get_entry available outside of filemap.c Date: Sat, 21 Jan 2023 07:57:50 +0100 Message-Id: <20230121065755.1140136-3-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: rspam07 X-Rspamd-Queue-Id: 53852C0002 X-Rspam-User: X-Stat-Signature: do9jf4f4ot3yzwpsmxs9t3aigk41ftzr X-HE-Tag: 1674284289-185983 X-HE-Meta: U2FsdGVkX18p/UlKC9B+sF55l9l/KJ3DGR+5vbMiGinyUyUE5i4pKjSXxQHqgKJcDdJx97lCBO2tdlDUjEK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dFt2+6owSYKae1zBQ7Dd38Y+pXHDZirl6mh/PwzuzVLmv44TIE14ur1D5/sYiUcBhWuaK1LIs3ZAJJzL44IWVotWBmigirrJnO6vsvmnY4p4NBusCdnLSnlDqKvA1VBwrRrrWKdo37SltlqaCZCRxmoL/Wczl9xC0HRLDutnwMK/ZsQn5vzZzz8YUdHDpXoE4j1oQ/Fr+wI2b1FbD3I0BEY+N5ZoACU0ZcKfzdl205OsmKU+3CIRDgFHeN/2acQeg+2RFKK/Oc0cNwcZHsWsRanTWvYob54v+ZDZKsUAGSSZ1K04X2Tr4LB7F+Co7E8FAJbFU4nKV48qBrN76R0XAWAd3+V9aFwc0rCQTaW6Xt2iticstYs 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;