From patchwork Wed Jan 18 09:43:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13105975 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 61AE8C38159 for ; Wed, 18 Jan 2023 09:44:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C34F76B007B; Wed, 18 Jan 2023 04:43:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B6E976B007D; Wed, 18 Jan 2023 04:43:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A367C6B007E; Wed, 18 Jan 2023 04:43:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8ED4F6B007B for ; Wed, 18 Jan 2023 04:43:58 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4CDD71A028C for ; Wed, 18 Jan 2023 09:43:58 +0000 (UTC) X-FDA: 80367433356.19.CB78F3D Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf20.hostedemail.com (Postfix) with ESMTP id C7C551C0006 for ; Wed, 18 Jan 2023 09:43:56 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=oK86k6pK; spf=none (imf20.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=1674035036; 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=1tivNYnlYVjl+dCfTLCmKC5DzLdFgx18xVeklobnFOc=; b=IOhvaTYvkO9YfmSrAPlCy94xvqos1Tqv0ALXS+sgUY7c9I0fPu5cOcx8uTD2YQwz/ItnGC S4noS1DkqfnDlBg+7/uh/+QwuJ9I3mrxRg8/j78cq0FQP+9k/heXuF3jhjsmLkdFnv0IwH xOOCJ8ve5YPVXBR62zmAxvohUbIMhL4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=oK86k6pK; spf=none (imf20.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=1674035036; a=rsa-sha256; cv=none; b=7Hnq5nsVfc0v37czJFZc6HsR4WBLRLFcRyAwuc1R8tt5RKvMAeK10uG3WdMtDeN91hJD27 j4bWlgezE0u16gosAW9mcIcrx0c/IJmzTkMIOZUe8s1KL1n2i6Pw9t0KP7JBLPUSR2a/MP RYyi9XZNOSbJOuyo20ZjgkL9DEFMRQg= 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=1tivNYnlYVjl+dCfTLCmKC5DzLdFgx18xVeklobnFOc=; b=oK86k6pKeZIcKg+Va0m3zSYnjp gdfBbtk752RFEObSR9dD/b0hSJZ+q6liwdtaOTuc+dZZjdn0uEBzCqUHQzMjPvwG/Uy75gc4xEjYT Zc6N0l/AGGagjNvK0usj0Ru2kn67AlvrxYxEIlLGFWVxDaD3WX4PRNuqYGnhJ+eTsWFF4cJ/nIic7 8ZA18lYUNGRHuUCEsd4YsVPU+DUCq5f/B4gOa9Vj5CrRRw+uKTHIiRdsE0s7zrKs48MkWSVwFXKmZ CcxQZeEif++QTTZv/8MNZaoq60DHPDo1DfYTsTFm1cnoaVz2hBTo7sJJbPBtPznpgeAWzzQ/Vqvco bg2FpGKQ==; 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 1pI4yx-0009xj-Fn; Wed, 18 Jan 2023 09:43:48 +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 3/9] mm: use filemap_get_entry in filemap_get_incore_folio Date: Wed, 18 Jan 2023 10:43:23 +0100 Message-Id: <20230118094329.9553-4-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-Stat-Signature: 4i3zhdrfq7gscfnkgo6rhozdr7b18u58 X-Rspam-User: X-Rspamd-Queue-Id: C7C551C0006 X-Rspamd-Server: rspam06 X-HE-Tag: 1674035036-522409 X-HE-Meta: U2FsdGVkX1+tgI2wZECn02BF6Rl/ZA3fNqo2lXtC1+cJUD9ygDVbNUHZ7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AtPA2ph9tXx6qrm0E80UrARmN3bXUSes+JPP1bssmRanvupSpTirKnWcA5iNy5Dk+fT/sv7lVMTOdcw/S/RJonDiof1W2m0U= 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: filemap_get_incore_folio wants to look at the details of xa_is_value entries, but doesn't need any of the other logic in filemap_get_folio. Switch it to use the lower-level filemap_get_entry interface. Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) --- mm/swap_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swap_state.c b/mm/swap_state.c index cb9aaa00951d99..c39ea34bc4fc10 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -380,7 +380,7 @@ struct folio *filemap_get_incore_folio(struct address_space *mapping, { swp_entry_t swp; struct swap_info_struct *si; - struct folio *folio = __filemap_get_folio(mapping, index, FGP_ENTRY, 0); + struct folio *folio = filemap_get_entry(mapping, index); if (!xa_is_value(folio)) goto out;