From patchwork Tue Mar 22 21:45:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789219 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 D3087C433F5 for ; Tue, 22 Mar 2022 21:45:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BEB46B0132; Tue, 22 Mar 2022 17:45:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66DF56B0133; Tue, 22 Mar 2022 17:45:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 535ED6B0134; Tue, 22 Mar 2022 17:45:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 411E86B0132 for ; Tue, 22 Mar 2022 17:45:30 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 20DF522B99 for ; Tue, 22 Mar 2022 21:45:30 +0000 (UTC) X-FDA: 79273354020.11.9EB6CD1 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf28.hostedemail.com (Postfix) with ESMTP id 8DF29C002D for ; Tue, 22 Mar 2022 21:45:29 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5E559B81D77; Tue, 22 Mar 2022 21:45:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05F8DC340EC; Tue, 22 Mar 2022 21:45:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985527; bh=OetOeqPdLI4ZR8ZX+aYpyGdrzB+LenaHlloTwIB5/zo=; h=Date:To:From:In-Reply-To:Subject:From; b=0NRfyC9mVWsQ2z6NwepGE44iY/ttwFuM+IrsGtJazjJ6psqb4bLNkayertwW2EDcl BR9wLLR5fjUE6S87h21iXE7NLN8iIqEyMYiYw1FiTtRec3eh4sPlnAbHrJ007Pr9MB AQzdyigSVQbmWHLVsP49D+3n0Ud1+NFIRRv0Eo3A= Date: Tue, 22 Mar 2022 14:45:26 -0700 To: willy@infradead.org,mike.kravetz@oracle.com,kirill@shutemov.name,hch@infradead.org,dhowells@redhat.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 136/227] mm/hugetlb.c: export PageHeadHuge() Message-Id: <20220322214527.05F8DC340EC@smtp.kernel.org> X-Stat-Signature: yub7f65qyzu4rsi3qjno48x7rx47gwke X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 8DF29C002D Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=0NRfyC9m; dmarc=none; spf=pass (imf28.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-HE-Tag: 1647985529-770832 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: From: David Howells Subject: mm/hugetlb.c: export PageHeadHuge() Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by such as folio_file_page() and folio_contains(). Matthew suggested I use the first of those instead of doing the same calculation manually - but I can't call it from a module. Kirill suggested rearranging things to put it in a header, but that introduces header dependencies because of where constants are defined. [akpm@linux-foundation.org: s/EXPORT_SYMBOL/EXPORT_SYMBOL_GPL/, per Christoph] Link: https://lkml.kernel.org/r/2494562.1646054576@warthog.procyon.org.uk Link: https://lore.kernel.org/r/163707085314.3221130.14783857863702203440.stgit@warthog.procyon.org.uk/ Signed-off-by: David Howells Cc: Matthew Wilcox (Oracle) Cc: Kirill A. Shutemov Cc: Christoph Hellwig Cc: Mike Kravetz Signed-off-by: Andrew Morton --- mm/hugetlb.c | 1 + 1 file changed, 1 insertion(+) --- a/mm/hugetlb.c~mm-export-pageheadhuge +++ a/mm/hugetlb.c @@ -1855,6 +1855,7 @@ int PageHeadHuge(struct page *page_head) return page_head[1].compound_dtor == HUGETLB_PAGE_DTOR; } +EXPORT_SYMBOL_GPL(PageHeadHuge); /* * Find and lock address space (mapping) in write mode.