Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7013801rdb; Wed, 3 Jan 2024 01:17:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0SAWmT3deo+eteyZGmW2tUD2CR6kOVjlHe53bNJgCCGcJnkPX48GzCHjQWtQhfTdMitjC X-Received: by 2002:a9d:4e96:0:b0:6dc:7c2:3c7d with SMTP id v22-20020a9d4e96000000b006dc07c23c7dmr6330719otk.75.1704273436594; Wed, 03 Jan 2024 01:17:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704273436; cv=none; d=google.com; s=arc-20160816; b=ogKTx/5JO+adJqqV2sUlq42mgeT5EWf3/AA5UEc/dJdmO7MJXMa6QniuHrumlbpN+I vUFBvTOoy01PW9LugFYs49706nfS5qgaWxqGxhEyLw3yxJ7AIpHjhP//50bg8p3LAp1U kc6HWSEyS3mTXZSCHVXChKMaTjzmyeIBef7VEGHmy0vn7vQur7S1DYWfoNE0hw3Glx5M wJChbU0nxzSYwCIzpMawPX17YMXq7TB7r8iOOg0Yyzk1S1jI7CI6ex3nBKNKiE8P2M8l NspEHo5bS6vacr6wVqFen9z8de3qmKWFl2SvYBKNFK8JdoXOdXcIC/iFsa90xRKANaAb 0mhg== 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=UYdbUpgayprdP7mOXYmvw/zAFGJlyw1zyb2FaqhnNyk=; fh=JvQ3nGflNTIwPBfhSW2OJAIjHOHR+R1SiFkwzYoQoWY=; b=tuc5yVgf3bWXsBL71gbNuHIsNp95vBTQmzQvlJ2ItqvHppa1566ICpRlp//N9+xbR5 d0USjd392ZV9H9tCLz+PnYr7Esx9w20tftMJIsXPM6Sl+gzQFSs3Tl6lWJJhPJXc9O1W Y34zqQFPkl0iaNq1pcUFMKiOoeSHa7n2ywaHpiDiz1AhfEhJRVfimvOSnp+IBWfhzydn f6Tn51tHnCwKlWQfkXAK8k86oxfTScH14gRFGisk54CNeG0WekXNTrkfskzwMyydYDBs 8ctTWdkqv0ZZ2Hh6R3+r9pCAsgTwpwRqs0tduhBayr+RpqK/8sKZYiNZbJ1UvqxS3oAU h0Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eyLdagZo; spf=pass (google.com: domain of linux-kernel+bounces-15317-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15317-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c7-20020a6566c7000000b005ce1968c4cfsi15830677pgw.526.2024.01.03.01.17.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 01:17:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15317-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eyLdagZo; spf=pass (google.com: domain of linux-kernel+bounces-15317-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15317-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8B87BB231C5 for ; Wed, 3 Jan 2024 09:16:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28E0318E1A; Wed, 3 Jan 2024 09:15:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eyLdagZo" 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 001C418E14 for ; Wed, 3 Jan 2024 09:15:09 +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=1704273308; 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=UYdbUpgayprdP7mOXYmvw/zAFGJlyw1zyb2FaqhnNyk=; b=eyLdagZoQKSxjruraGbK7BkKzn/SQWlTSmyUFA7CDkEyv2lIGO/Xb5ZK6DFaoTBIrrHxvv T+kiWTmQPx5DtE4sfjfcA0mNqfz4VsB43nIms0WJ0b+evWSs+WcJUH+CByMhtZE/Ym1zFN XAOn2nX9u4ik6lYtdjBIOlz3evqZOdg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-298-bCcbehl8OCy9I42YtKqcXA-1; Wed, 03 Jan 2024 04:15:05 -0500 X-MC-Unique: bCcbehl8OCy9I42YtKqcXA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 20CC685CBA6; Wed, 3 Jan 2024 09:15:04 +0000 (UTC) Received: from x1n.redhat.com (unknown [10.72.116.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id B69E3492BE6; Wed, 3 Jan 2024 09:14:52 +0000 (UTC) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: James Houghton , David Hildenbrand , "Kirill A . Shutemov" , Yang Shi , peterx@redhat.com, linux-riscv@lists.infradead.org, Andrew Morton , "Aneesh Kumar K . V" , Rik van Riel , Andrea Arcangeli , Axel Rasmussen , Mike Rapoport , John Hubbard , Vlastimil Babka , Michael Ellerman , Christophe Leroy , Andrew Jones , linuxppc-dev@lists.ozlabs.org, Mike Kravetz , Muchun Song , linux-arm-kernel@lists.infradead.org, Jason Gunthorpe , Christoph Hellwig , Lorenzo Stoakes , Matthew Wilcox Subject: [PATCH v2 02/13] mm/hugetlb: Declare hugetlbfs_pagecache_present() non-static Date: Wed, 3 Jan 2024 17:14:12 +0800 Message-ID: <20240103091423.400294-3-peterx@redhat.com> In-Reply-To: <20240103091423.400294-1-peterx@redhat.com> References: <20240103091423.400294-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.10 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 c1ee640d87b1..e8eddd51fc17 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 0d262784ce60..bfb52bb8b943 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6017,8 +6017,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