Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp150549pxy; Tue, 20 Apr 2021 15:09:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTKvOxNJDvJLtTh0UW/HKJmWfXbLmrtMrEY8GtEqvcbI8KKigFRsrEuldTOZ0UFIWNyls3 X-Received: by 2002:a05:6402:350:: with SMTP id r16mr27315336edw.227.1618956589305; Tue, 20 Apr 2021 15:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618956589; cv=none; d=google.com; s=arc-20160816; b=okrICDLwCNeTfoF9xvSFFWW6DLG3Va2rYnfvIEhxBiJjmbnrrt2IHakOY4rrCxAaZB NjDfwLax73NoHjPoFRhZDTgcwdsgpBcV1MOcKyi8YFxtpUVm+FaXaRxtuuUAygiEY70T IPd1BaimsMsZ4h0G8PvbtncpdqNOhXAcj1grJM3g91JhpuriLfnFORy9JRKSt4IoqL6G Ojw+wvQvT5mrVp++3Mjf2KkY/rMyRjhWQDiK0T1YbhP48E7vwUynRvGS7DHX2IRv9FoV 68FPWMHXEBbgk6JEvea2HII2gYywHGaxHVTlEdL26gfgjlQ5eD1rCDfpo4xugnN5sW5t OGIg== 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=uWjtM2SHo8LyRbqpg4vswdH6oetQHWLigTEyrPk+LC8DbvXMKBFStsdcJk2u2ET2hL Gpe5uUiON1ZXCRWFBos142+iKfk78j7DJZWtpDFI02o/zGpQQfw36k9SeApXQF9AQgDp ckAMUP08Yy7jMhz8KoB0GxkUZHs+VL5tsLCtI2dJhtUprsCv62tYkNVYoKubwtsx36n4 07P9/7OPDKZQcUxAlFKY5BzU3TR5RbjcAUEYfDKWpPAwoOziYGxJe5iX3LZwRCzQFd/0 l6F3kdACYgX5a9L56E6IQmmnUXGuuO3UCW0PDxpNZcgszhAo7ryK1EBnKWx0r2ewLU4N zRow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=F0MCudZT; 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 dg14si294057edb.316.2021.04.20.15.09.26; Tue, 20 Apr 2021 15:09:49 -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=F0MCudZT; 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 S234201AbhDTWIr (ORCPT + 99 others); Tue, 20 Apr 2021 18:08:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234227AbhDTWIn (ORCPT ); Tue, 20 Apr 2021 18:08:43 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DBFFC06138E for ; Tue, 20 Apr 2021 15:08:10 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id u3-20020a2509430000b02904e7f1a30cffso13400173ybm.8 for ; Tue, 20 Apr 2021 15:08:10 -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=F0MCudZTC5xOkb1RbDntraZ92HIBRT2ez5Xhnsp+DXLuS8Ep5h2F99v8xIdO5zxY1b Ofcj74faZHlYP3e+3wnOZD5ZfzF2jLBMby2Jeiefq2bLIQsWDk7/JWsoMukk7UYrpSyV nKtYxWXQfTaV3Qb7U4U55Mf1pliJt3K1GW0Xy+qcsjJVyUQxYiAzbRCpwE5AzkhugM65 dUWgT4kjntrfbW0RMCruU2f51LKy6LcZBAM2caerJaeA0zjRANie+zQxZlILDItwLDj1 Lrk57AR8MByVdyJgsNEH6mrlEeMHKFgKXZ0fckx77ByEyHiS6pOa0GxHKc+5Bvhh+cqX 388g== 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=YW7R+eHHR1V4I40RpCjg/PYMUamCJwv5Ge0zMMWpD0hBhveObmWa5AViUcxe7LIsWb PaBQJ3DxYARFUNm5qx/zmeJfonTRgcyv+TBSLtjE1OmLOuBw14mKNy17XE7J9s/lE4sE ps7irOez9NfLf6/F2dF/zxhYfdmCZ3ZoEWU5o2kkoYL2HoemGYhRuMYntcvUZnYKkLfS MLawQq/+vszQavPF4NWvW2Hm68TPWyHwJK3EGr4yGh5txVAxDOBoVMVp93vpcYO09sdL HvI3IuuIoibLZcBQS/PRHQszqQVJ3/eTf8ecyOMrbtCECxnGJD/xpd2DT8J2uKr+xST5 1BNA== X-Gm-Message-State: AOAM530gid+ZRNfxThyhRwcgxd0lphKbdJh+U0b4FOIG3iIVNvPkfISJ BlVt1hvYksnFaO/oUe7vfgDlIqU9XrvEKO8U51dE X-Received: from ajr0.svl.corp.google.com ([2620:15c:2cd:203:c40e:ee2c:2ab8:257a]) (user=axelrasmussen job=sendgmr) by 2002:a25:bd83:: with SMTP id f3mr27137266ybh.29.1618956489545; Tue, 20 Apr 2021 15:08:09 -0700 (PDT) Date: Tue, 20 Apr 2021 15:07:55 -0700 In-Reply-To: <20210420220804.486803-1-axelrasmussen@google.com> Message-Id: <20210420220804.486803-2-axelrasmussen@google.com> Mime-Version: 1.0 References: <20210420220804.486803-1-axelrasmussen@google.com> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog Subject: [PATCH v4 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