From patchwork Tue Jun 22 12:15:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12337119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7743DC48BE5 for ; Tue, 22 Jun 2021 12:18:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4153360C41 for ; Tue, 22 Jun 2021 12:18:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4153360C41 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C0FA96B0075; Tue, 22 Jun 2021 08:18:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BAD616B0078; Tue, 22 Jun 2021 08:18:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9C526B007B; Tue, 22 Jun 2021 08:18:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id 797736B0075 for ; Tue, 22 Jun 2021 08:18:42 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 24C5910F80 for ; Tue, 22 Jun 2021 12:18:42 +0000 (UTC) X-FDA: 78281263284.01.E68BD85 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id AC017E002CCA for ; Tue, 22 Jun 2021 12:18:41 +0000 (UTC) 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=JDaUOJALMebNh4PadqGaBGITP/KUBgH2yokzmVW+A+Q=; b=HflKthEcpfi4iEAIp8kWdu7tVj /aLeavFL4VgsDHgAZAcACmjs6+Cn0/AxJJITR0CZlP9f7lkBKWiVdLg9nMeoeCuoju2GhTxA//oYv faMfxLbL/5qgFaWJq11KPxSf9YPDEZREpcan+N07u+nV80ySl2IN/L1EFHFW/HJeYnQdhjmqV8GYm OMaHQxf/UD0n1VIFRV8QvENzEp3JRjLZtc7xJdhciGlbDJeCVk6Ub+Z9UX5xMfQ6vBzw6c7ai9/yW gCkHw0nqqXGs8Hs8vGdDLI5tKzmXYIGOVLdpDZQHtPVy8GR4oYILzPCxAKVNIt36fqqEgFXLwFU/X b7b3Ml9g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvfKl-00EGEF-FG; Tue, 22 Jun 2021 12:17:21 +0000 From: "Matthew Wilcox (Oracle)" To: akpm@linux-foundation.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/46] mm: Add folio_to_pfn() Date: Tue, 22 Jun 2021 13:15:06 +0100 Message-Id: <20210622121551.3398730-2-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210622121551.3398730-1-willy@infradead.org> References: <20210622121551.3398730-1-willy@infradead.org> MIME-Version: 1.0 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=HflKthEc; dmarc=none; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam02 X-Stat-Signature: hixi9a8hjys7pffufi57ooiw9ut9kpae X-Rspamd-Queue-Id: AC017E002CCA X-HE-Tag: 1624364321-843351 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The pfn of a folio is the pfn of its head page. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 9b7030d1899f..2c7b6ae1d3fc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1619,6 +1619,11 @@ static inline unsigned long page_to_section(const struct page *page) } #endif +static inline unsigned long folio_to_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)