Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3497704pxb; Wed, 14 Apr 2021 06:55:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8QlerChRzxGdUN1Utb86R1ca2u4jZnKAyjIALq04avLqfyZOg92u6uBVzCP9iYM2nv6rW X-Received: by 2002:a17:907:3f20:: with SMTP id hq32mr30757831ejc.226.1618408528977; Wed, 14 Apr 2021 06:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618408528; cv=none; d=google.com; s=arc-20160816; b=mPz3tt+gKzllBNoy+HrhsIBdlg+pl02dcIyvQThm11ueVFP9CxgmWS/ofBwB28uf7s p/WRN+S5mjy61ZCD9s0ps5fFJ+48krJ+dTwXJ/fpf6Nsq5DaQX7Xu8LfelbLZJTChiRK iFobSwtTJWMv5gxhSOSihpmW7eEJGj1m1v4vOwD6Hrnrq28QQyH2jNfA+kdRFD+j9sCN yjE/ypq39Nuffd1HTvpuU2zM/CIz5HtWXsvpAgESLmBwPeGHwOyLP+9Ca/a088HRvk7q 5WtBRK7si6cOrP4L23lt5x4Xcgc/5P9Xu7pRe6B4eayewt6F6TuJ2iossUs+Sa+PXNTQ Dx+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=xAItGVctj4Ym5XgJXrEHjFWuIEiXbFDkgH2LTVJTlqw=; b=eRqctg61fIPLFkDl5/0btDMvJVUSV3snQdQ9WvVQOUnUr3xkFD9nQyr7p8v1t5/XCs OnzjldlQJlZpIO+3tMdANRYtH+ixAlSYVl6VH4L1Gt+5xhJvrBScHZcatR9qkKCahnYB jauJs7eYSUk9GZKbnUrfzqJnHW5VqdSR/SXF7jroa2MFItFFBGdypF5VbIhAWViDHJ7I 2SHjl9SPC5DGSrr7PCA8lWezIGITCpLyXUaoxDmlEG5CgvTmc53BwXAFPV4BFxY99BNq VwqqHOI6Jw+5CzSjfXw7tSdCJRMQx10jKoNMsDZB/Jmf2dt82V+3n3X8i/hEBuJRavlq dL2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=boogogHO; 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 o13si12409160eje.367.2021.04.14.06.55.04; Wed, 14 Apr 2021 06:55:28 -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=boogogHO; 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 S231508AbhDNGo0 (ORCPT + 99 others); Wed, 14 Apr 2021 02:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345962AbhDNGoT (ORCPT ); Wed, 14 Apr 2021 02:44:19 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E56CC061574 for ; Tue, 13 Apr 2021 23:43:58 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id x11so20411412qkp.11 for ; Tue, 13 Apr 2021 23:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=xAItGVctj4Ym5XgJXrEHjFWuIEiXbFDkgH2LTVJTlqw=; b=boogogHOP6aMxYaO4TKu7w6/UT0zb6tK49kFGEqd/tGljpv/chIVdkvDoZiKgvcWl3 uD72xEs3pGMozk801LATYIGOzSooQdo333X4M4rD3PNeWeoZ9/oX6LUPDbjvhVvQyG6/ nTt5wmIPnMoq8lxe0TYVtm4DE/rQlDzKDa0fCpcwtw5WUsLaifXWcqsMidIkzaY8/9og +s8FqQNRmO6BXRBVpR03kz2epvzqQrKFmi5Hh/Dr9nzx9eIzWvOC83DKTQkse5T5QfKN OwqGrAsqVhMbFN/3vaxP0hsIwcf4UGB3beOYirKF+LBu4y8XLIbOcMpkmguDaeVt3yZa ZVXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=xAItGVctj4Ym5XgJXrEHjFWuIEiXbFDkgH2LTVJTlqw=; b=CTOLF0SI4SZdVe53AFhXpxrGehBrYea7ouYOyIfF3HtmZrXQkcQJOf4iZp7GRym4ip zyE5IH8sfaEVHLdpPwA+Or4TwA8MIgvHQnMsN82KPappO29DuKrvZBJ8ush3tSSyK4Ew 7Sk55Dw7bBAoV04XHtIqQ5xtEjsLkbm4C0HUWzeIHXpkO7dbYpe4h18hOSsLERXaS4ZU x56MRFXzwuCb7euUa3yumHGt7PpHnkG3KbkbKhBl1p7zkOrnp1HTd9dGGSn309DbakaL bVGTC4vm6EUlBhSrLK6RLdDoTBTb5GhrR6Bvz4Gf+/pN3kpsNgu0iOjVaKJYYZO+YIXe Fptg== X-Gm-Message-State: AOAM533+pxNXX8wUNpxoY7RaeZOZvhwGeyWg4BdLGR+5kp5UCAem28ZL oHkL2pdf2oly2DyIAx3xwb3kOQ== X-Received: by 2002:ae9:e113:: with SMTP id g19mr34615511qkm.480.1618382637457; Tue, 13 Apr 2021 23:43:57 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id x22sm5174625qtq.93.2021.04.13.23.43.55 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Tue, 13 Apr 2021 23:43:57 -0700 (PDT) Date: Tue, 13 Apr 2021 23:43:41 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Axel Rasmussen cc: 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 , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, Brian Geffon , "Dr . David Alan Gilbert" , Mina Almasry , Oliver Upton Subject: Re: [PATCH v2 1/9] userfaultfd/hugetlbfs: avoid including userfaultfd_k.h in hugetlb.h In-Reply-To: <20210413051721.2896915-2-axelrasmussen@google.com> Message-ID: References: <20210413051721.2896915-1-axelrasmussen@google.com> <20210413051721.2896915-2-axelrasmussen@google.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Apr 2021, Axel Rasmussen wrote: > 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..3f47650ab79b 100644 > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -11,7 +11,6 @@ > #include > #include > #include > -#include > > struct ctl_table; > struct user_struct; > @@ -135,6 +134,8 @@ 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); > + > +enum mcopy_atomic_mode; Wrongly placed: the CONFIG_USERFAULTFD=y CONFIG_HUGETLB_PAGE=n build fails. Better place it up above with struct ctl_table etc. > #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.295.g9ea45b61b8-goog > >