From patchwork Mon Feb 28 13:22:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 12763275 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 5740AC43217 for ; Mon, 28 Feb 2022 13:23:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 819738D0002; Mon, 28 Feb 2022 08:23:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C74B8D0001; Mon, 28 Feb 2022 08:23:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B6AA8D0002; Mon, 28 Feb 2022 08:23:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id 592148D0001 for ; Mon, 28 Feb 2022 08:23:07 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1927F181C77A0 for ; Mon, 28 Feb 2022 13:23:07 +0000 (UTC) X-FDA: 79192254414.25.0AD4D31 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 7ADDF180002 for ; Mon, 28 Feb 2022 13:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646054586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PlD7TMS0jB91fn4FULs2gWc+/7qJIEEnhaVLcZF9VF0=; b=ImlxyeqOuIYrSZ6/ylhEEDX8zBaDTqTsSDuIuAhgo6bor5g8YY28NfLTfJaDpFuvhKqAsv 2bHcT32BMm6oQm8P4xI29HJPI4+WZ4A21EAtmEMTYrtWdGD4+yFDSbrAl2LMrFs3U4M9dL /Zb7WvNHaMCRUXALUUf2fPEQPkpEHjM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-290-tmaySKIlOYekywmpiySahA-1; Mon, 28 Feb 2022 08:23:00 -0500 X-MC-Unique: tmaySKIlOYekywmpiySahA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D0488066F4; Mon, 28 Feb 2022 13:22:59 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.37.0]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAAC8838C0; Mon, 28 Feb 2022 13:22:57 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: torvalds@linux-foundation.org, akpm@linux-foundation.org cc: dhowells@redhat.com, willy@infradead.org, kirill@shutemov.name, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: Export PageHeadHuge() MIME-Version: 1.0 Content-ID: <2494561.1646054576.1@warthog.procyon.org.uk> Date: Mon, 28 Feb 2022 13:22:56 +0000 Message-ID: <2494562.1646054576@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Rspamd-Queue-Id: 7ADDF180002 X-Stat-Signature: 5o7ayjkc758pm7hmux16dj8xh97hrj5e X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ImlxyeqO; spf=none (imf24.hostedemail.com: domain of dhowells@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam07 X-HE-Tag: 1646054586-835015 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: 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. Signed-off-by: David Howells cc: willy@infradead.org Link: https://lore.kernel.org/r/163707085314.3221130.14783857863702203440.stgit@warthog.procyon.org.uk/ --- mm/hugetlb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 61895cc01d09..5768df43b05c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1854,6 +1854,7 @@ int PageHeadHuge(struct page *page_head) return page_head[1].compound_dtor == HUGETLB_PAGE_DTOR; } +EXPORT_SYMBOL(PageHeadHuge); /* * Find and lock address space (mapping) in write mode.