Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp346580rdh; Tue, 19 Dec 2023 00:06:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IF76y8xA1sWeUnDgv7XTR/EURNFZWTCv0nRTQ5kGGAYWHOziP2y1jYDyiXl/ZLEBtpASGU5 X-Received: by 2002:a17:907:2d26:b0:a18:615c:66ff with SMTP id gs38-20020a1709072d2600b00a18615c66ffmr11829367ejc.49.1702973214207; Tue, 19 Dec 2023 00:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702973214; cv=none; d=google.com; s=arc-20160816; b=gsyFoSR0k/v/xVWvBNi8XcKvZKAsI3xEXRmYUputCTJqlE4dLw4W4ZpwiJi3Zdj5Sw JebFdpiKdC4wl0NcMvR14g5xA5DFjHk9NxXqOtV5/F+PW01AB5VqkQeQ9iDdilK763/+ KLAgtWrYHCcCBOBBubTcx2QJBAbBcfd1CS9R+xr4VIdPdNgqiolhyCoADzUUNe3EFGV2 WY9tm5WiNLp2JIc6By/1/bf1SJW225BQoOhBqnlLnPDz6SDjkNG6RFD5+rS87oCOHCvL YyJ2upE3YWXGjmm0cqPMMuC+erVaV7yfaqJn16FaasT2OUdKVLAiePhlKOS152OunRMh OJ4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=75YlhRgpWvz7xroPDJtpCNniQimqN/967LqIgG1M+eM=; fh=3mpu6Yyr5hMzDKtkQvzcApl7ZSQGU4G8QyIY2BAU7VY=; b=UtX/pk8eh1hP0sT8PfMC+vTmIpBSLVAKIOHA2wYYsU4nPnCBvDkn3E9wHwI5bmp+oJ AXJvRR+BLnxWDem4bYD5+3HqW1tlP54mxnrm1yR4xjsOkwkhxtt87i60ws1IRmy2oNjX vOzFYdcBjNEawNUKL2wImipsBfwzFxfvaucSPcuXSKSMm/1ppyj3cVVN9M6T8w6RfDLz A8k5WYfjp9LiNlWu7qwu5AitImaaUPFTFl/CQSTdhlj/DxOwXlMQ8soFYB+PPrEOVWEu iN2RC443kuBsTDadPKzM6jW1SmHtuiQ4CC79KJhv4Zh7sYagN4L6anIUUr7Xbuh9QqRM cpmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZI0L6sbL; spf=pass (google.com: domain of linux-kernel+bounces-4835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g3-20020a170906198300b00a1de299f229si10798735ejd.439.2023.12.19.00.06.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 00:06:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZI0L6sbL; spf=pass (google.com: domain of linux-kernel+bounces-4835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7C24F1F25915 for ; Tue, 19 Dec 2023 07:56:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6515C13FF7; Tue, 19 Dec 2023 07:56:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZI0L6sbL" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 465C113FF9 for ; Tue, 19 Dec 2023 07:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702972582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=75YlhRgpWvz7xroPDJtpCNniQimqN/967LqIgG1M+eM=; b=ZI0L6sbLTVFrGtkM+vcH5a+0jUqvkNkPr9K0tgOuyp9vXoDi8cBVG27Wm53nyinNMN/xVS V32BRHn1bNGcUF/lp8HfBlDFIzSsLWJ7fdLBsZV80fHI2H69vt0x8Jr3Nlq+z/Ee2b6hhW rJpr8bJicawuydJn8QwZ7KT/5UDZfjU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-356-wW0mlPoONC2GJ2s_aRZ7hQ-1; Tue, 19 Dec 2023 02:56:18 -0500 X-MC-Unique: wW0mlPoONC2GJ2s_aRZ7hQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE4F23813F24; Tue, 19 Dec 2023 07:56:16 +0000 (UTC) Received: from x1n.redhat.com (unknown [10.72.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 993A82026D66; Tue, 19 Dec 2023 07:56:05 +0000 (UTC) From: peterx@redhat.com To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Matthew Wilcox , Christophe Leroy , Lorenzo Stoakes , David Hildenbrand , Vlastimil Babka , Mike Kravetz , Mike Rapoport , Christoph Hellwig , John Hubbard , Andrew Jones , linux-arm-kernel@lists.infradead.org, Michael Ellerman , "Kirill A . Shutemov" , linuxppc-dev@lists.ozlabs.org, Rik van Riel , linux-riscv@lists.infradead.org, Yang Shi , James Houghton , "Aneesh Kumar K . V" , Andrew Morton , Jason Gunthorpe , Andrea Arcangeli , peterx@redhat.com, Axel Rasmussen Subject: [PATCH 02/13] mm/hugetlb: Declare hugetlbfs_pagecache_present() non-static Date: Tue, 19 Dec 2023 15:55:27 +0800 Message-ID: <20231219075538.414708-3-peterx@redhat.com> In-Reply-To: <20231219075538.414708-1-peterx@redhat.com> References: <20231219075538.414708-1-peterx@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 From: Peter Xu It will be used outside hugetlb.c soon. Signed-off-by: Peter Xu --- include/linux/hugetlb.h | 9 +++++++++ mm/hugetlb.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 236ec7b63c54..f8c5c174c8a6 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -174,6 +174,9 @@ u32 hugetlb_fault_mutex_hash(struct address_space *mapping, pgoff_t idx); pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, pud_t *pud); +bool hugetlbfs_pagecache_present(struct hstate *h, + struct vm_area_struct *vma, + unsigned long address); struct address_space *hugetlb_page_mapping_lock_write(struct page *hpage); @@ -1221,6 +1224,12 @@ static inline void hugetlb_register_node(struct node *node) static inline void hugetlb_unregister_node(struct node *node) { } + +static inline bool hugetlbfs_pagecache_present( + struct hstate *h, struct vm_area_struct *vma, unsigned long address) +{ + return false; +} #endif /* CONFIG_HUGETLB_PAGE */ static inline spinlock_t *huge_pte_lock(struct hstate *h, diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6feb3e0630d1..29705e5c6f40 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6018,8 +6018,8 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, /* * Return whether there is a pagecache page to back given address within VMA. */ -static bool hugetlbfs_pagecache_present(struct hstate *h, - struct vm_area_struct *vma, unsigned long address) +bool hugetlbfs_pagecache_present(struct hstate *h, + struct vm_area_struct *vma, unsigned long address) { struct address_space *mapping = vma->vm_file->f_mapping; pgoff_t idx = linear_page_index(vma, address); -- 2.41.0