Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1018561pxb; Thu, 15 Apr 2021 11:49:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOSiy89UWbXRvUYZWex5wJcjB09DPCf8JS1L2FI+urxK3D5SfxyFm/1w0UvmSp6Jw1mNee X-Received: by 2002:a62:ae07:0:b029:257:7af6:e14 with SMTP id q7-20020a62ae070000b02902577af60e14mr4059246pff.69.1618512586020; Thu, 15 Apr 2021 11:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618512586; cv=none; d=google.com; s=arc-20160816; b=IHKW1rMH/f3BjdpMfDlJ6trIaKLWgV+5u2Qp/T8hBTmev1rieNgX+Nd/LGHwPLWm/Y 1R3D6zil7ERPRvTsh4yDFDvwefa9kA7ZbTHXRdvfX4RkU1jCpYhoyQKy2ehUidjYJUz/ VayJDVJzKj+vnUTzYzFgU4OMhDZlXE78AAR2XYNJKkmyPhDMb8uUxlA4BhnyHmte5chN 6JOZZHjTZoPgy4f3EvI7wSFLHB8CsdvJbji73kmzeQQtBHbjomY3rjHhwbb2+TIF/Yq0 2Aw1jvFFyFluftz6AJk2xhbrA2mXdFRMTqJ9E+s3IiCWE55wARj/WTrzzgH4MzLXVIle mXMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=BHYviFd/YPB5fVcgCUB7J8bATrNglnMGKIuCG5hxWmE=; b=0HUZh4u8yO0jAK2baUtfGqe3z/p7VJ/6h8SJZ8rTIVJh32zAqgDK7K6NMIjZUsAYUU DjaqrfzoOeUhQWMibXf2bAhILMOWjLt1jSQj7AUJlgEUHk3lndQk+AGU5SteqeY/z0uY L2ea9Ohj8MPXdlGDqk8Rt5wp4/sobyXsqOws4t6/eAvU8OCdYQzIkyS6gzf1Tu067nTR W384ADxY8wx8ZJ/XHlPiv5pQcN1jvhRH3o4JjQWmvOhNrUh7uQUYFSeZOmBg1u5ElelJ 8CQsMHFM4B15BoumIN2m4pMpiN0Wq1mjAu5fh+KYwMr6UXgn9K8QhbTRuGBBgBW5eNgh lNpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nbZDAI2t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cl3si3974789pjb.145.2021.04.15.11.49.33; Thu, 15 Apr 2021 11:49:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nbZDAI2t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234625AbhDOSsF (ORCPT + 99 others); Thu, 15 Apr 2021 14:48:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234505AbhDOSsC (ORCPT ); Thu, 15 Apr 2021 14:48:02 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82685C061574 for ; Thu, 15 Apr 2021 11:47:38 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id n13-20020ac86f4d0000b02901b35920b3cbso4604637qtv.23 for ; Thu, 15 Apr 2021 11:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=BHYviFd/YPB5fVcgCUB7J8bATrNglnMGKIuCG5hxWmE=; b=nbZDAI2t1tEIDKCN/R/T2PG8dcUxRyJ5P2spKm+max9ERxY1ssfwywTbzRFe8loB+i lY2qDWkUELrFSOo8dzG3izekfJjHzMeICxuIBktECtcWRxF247KYabg8JgIvIaACDuBY IIzAwbxpc2vL85XLU2PWPys32uA3iJIc96CEOth4ouBL/d80aHAmad8eslMs4pkf4HRt y2VVAiTFxniPoFvHOdZ3izblDIRTZmCWMx6SXHGH66fvRs4R5zauAma9IzFKna2E7Nnu s41q6dO+C7dRMsZFcdddS9qpG8kXJJ3Y5+9UsZYX04m/rhxUIE4j884TycYq3faLnEl4 fmPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=BHYviFd/YPB5fVcgCUB7J8bATrNglnMGKIuCG5hxWmE=; b=ndqBH8/LXqgfkaZMGX99gebx7dLZOigEaMVuriZSsp6qddXsovocTEWf/2KtjHnsyL A4pqTBc1tZVIjM1b6+WJfbktB2nWm+rInY92ckU5PYuPMcIGiNtT3nTVgTrSmQRJv+x2 FWBDQ35Az2yLuU9euzX0d3iDlLimyxf41bAS5eAQ4D3A+0ng5FeRArBzcCLvY3aD7765 GYnBp8f0VJcZM3YAVUqvvGTVx0WQ953V+SoLW9+TqGhL8dyJutyaOJex4C11ECEfjxd+ CDS6IE8HrA8bHEY7jXB352I6bI3JFjMShGZXF8FfZqzuvBHlHoKlP99dJOjtVa03CuOc gm3w== X-Gm-Message-State: AOAM532g4RKNW2MVEGTjj85PslD09uiWfUSb+oMBE5P/zPwsiw2YwfsC x6zidtHfTelcLwUbZOushZ9gnnIXYarkcYU71iJk X-Received: from ajr0.svl.corp.google.com ([2620:15c:2cd:203:21b1:6e5c:b371:7e3]) (user=axelrasmussen job=sendgmr) by 2002:a0c:fc12:: with SMTP id z18mr4779788qvo.38.1618512457568; Thu, 15 Apr 2021 11:47:37 -0700 (PDT) Date: Thu, 15 Apr 2021 11:47:23 -0700 In-Reply-To: <20210415184732.3410521-1-axelrasmussen@google.com> Message-Id: <20210415184732.3410521-2-axelrasmussen@google.com> Mime-Version: 1.0 References: <20210415184732.3410521-1-axelrasmussen@google.com> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog Subject: [PATCH v3 01/10] userfaultfd/hugetlbfs: avoid including userfaultfd_k.h in hugetlb.h From: Axel Rasmussen To: Alexander Viro , Andrea Arcangeli , Andrew Morton , Hugh Dickins , Jerome Glisse , Joe Perches , Lokesh Gidra , Mike Kravetz , Mike Rapoport , Peter Xu , Shaohua Li , Shuah Khan , Stephen Rothwell , Wang Qing Cc: linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, Axel Rasmussen , Brian Geffon , "Dr . David Alan Gilbert" , Mina Almasry , Oliver Upton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Minimizing header file inclusion is desirable. In this case, we can do so just by forward declaring the enumeration our signature relies upon. Reviewed-by: Peter Xu Signed-off-by: Axel Rasmussen --- include/linux/hugetlb.h | 4 +++- mm/hugetlb.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 09f1fd12a6fa..ca8868cdac16 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -11,11 +11,11 @@ #include #include #include -#include struct ctl_table; struct user_struct; struct mmu_gather; +enum mcopy_atomic_mode; #ifndef is_hugepd typedef struct { unsigned long pd; } hugepd_t; @@ -135,6 +135,7 @@ void hugetlb_show_meminfo(void); unsigned long hugetlb_total_pages(void); vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, unsigned int flags); + #ifdef CONFIG_USERFAULTFD int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, struct vm_area_struct *dst_vma, @@ -143,6 +144,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, enum mcopy_atomic_mode mode, struct page **pagep); #endif /* CONFIG_USERFAULTFD */ + bool hugetlb_reserve_pages(struct inode *inode, long from, long to, struct vm_area_struct *vma, vm_flags_t vm_flags); diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 54d81d5947ed..b1652e747318 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "internal.h" int hugetlb_max_hstate __read_mostly; -- 2.31.1.368.gbe11c130af-goog