Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp103538pxv; Wed, 14 Jul 2021 23:52:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxieXeeF5erNczAOCe7gLHj73zMFnrBZmAFjjOcEHDR9380uECQ3FEszlRkngE+z8nNLjIN X-Received: by 2002:a50:f0d4:: with SMTP id a20mr4588942edm.354.1626331940798; Wed, 14 Jul 2021 23:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626331940; cv=none; d=google.com; s=arc-20160816; b=zZEqHVUDD5RoCynpCkuYgsWE9e8R8iqTUtZIwNtuo7icEfg/IKuzNes12+n+iX3Gxm 5Bd1q2Wdhn3zZJykhfixCOxJOIF2K6rE0IydCXGemA8qcVCUZSXMteusOc2GaeUUf1T6 D2nQBmFET0rC80qF+Tmb3kyAXceL9lMVcvJBB2DqfO1Qcrn1rs1eFhV5t3o0HymbbfP4 S7C7j46w7XC2fJLcWEjb8KCqH90LkXrR6GP7Lq1Ido+uN1lLpvWWFs8QE+dmpJ02+CfJ +bcr6C6S0QOW2CJolLEQYQnenJ4AoCEpuf1kRVIBkxwaqVGmQhwV30wVp7VLQWEeGKsV rY0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3MhUuhvN5PSzy3FDchiZH89Zo2RpiYRVaWvbf1NSsWY=; b=rFiW4nbMVpIxSwsL/PyCbvvii/v6ulFJWH3YZ/KPQh22RdL2MX6YWBo3Vj4r82jCRy eXBR1r/ZJOscI8kXNS/idDwezQDNlJ8aOcKmK8VqLf8WeVBQyFi1/SJ5P5ajJoA7PuAy 5J56VBUJppaXCrx/GaGLliDedOaH09AIYKekrboVFE419GRW+CSrPhHqNguKss/wtxDZ Hd4fi9De4lDaRgremviw3RLFIpwFaVVLep0pJ4gSJ3YsC3EfrGH1oymBRsZw9G+iaCRr /d6UO1++HU/lCW0b7W17P82hTDcCsIvFJUQrLvZjXHdMA5vUB3Cm/23DCges3lpxo3E3 jqeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kjDHlMef; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m4si6576983eja.691.2021.07.14.23.51.58; Wed, 14 Jul 2021 23:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kjDHlMef; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235429AbhGOEV4 (ORCPT + 99 others); Thu, 15 Jul 2021 00:21:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233862AbhGOEVz (ORCPT ); Thu, 15 Jul 2021 00:21:55 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7B1DC06175F; Wed, 14 Jul 2021 21:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=3MhUuhvN5PSzy3FDchiZH89Zo2RpiYRVaWvbf1NSsWY=; b=kjDHlMefUZNhNNaGGwuh7CT9D6 XeO13Tz2B8j9im+ZA4alHATGSiQJ3qFX18jn8B7rk1EnioSI+u17DQqCz5VWO1VbeCaD6DYKozSF9 qwKr3ObX7ohWGqAEvj8eYh/ZhD+2a6XpsUbjon9j0BHFDkGaXEupt25N+N2av0fREmHSiuwtrWK1L 0Y82XUJv0RV35eZmz0c8na6rjWIJmmiUpk6mLjDSqpt9gLYeGRihqIWDUHiCgwqzAycHzJ+K7njOS QFH8BNG9u+g3fGGUcPwmgEjHu69eoCaCiru+2VumGlw4lXWeSaX4LG3B0Lt9KNVEPFZgqSuAFLiXS vZzuixeQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3soY-002wg5-TI; Thu, 15 Jul 2021 04:18:02 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v14 051/138] mm: Add folio_pfn() Date: Thu, 15 Jul 2021 04:35:37 +0100 Message-Id: <20210715033704.692967-52-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715033704.692967-1-willy@infradead.org> References: <20210715033704.692967-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is the folio equivalent of page_to_pfn(). Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index c6e2a1682a6d..89daae93aa9b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1623,6 +1623,20 @@ static inline unsigned long page_to_section(const struct page *page) } #endif +/** + * folio_pfn - Return the Page Frame Number of a folio. + * @folio: The folio. + * + * A folio may contain multiple pages. The pages have consecutive + * Page Frame Numbers. + * + * Return: The Page Frame Number of the first page in the folio. + */ +static inline unsigned long folio_pfn(struct folio *folio) +{ + return page_to_pfn(&folio->page); +} + /* MIGRATE_CMA and ZONE_MOVABLE do not allow pin pages */ #ifdef CONFIG_MIGRATION static inline bool is_pinnable_page(struct page *page) -- 2.30.2