Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp925936pxf; Thu, 8 Apr 2021 16:45:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/ktUxj2Ijg2JQ34gQYve1HKHcc+kr3q0ndQ8Nw6A1QLGO92UxmT7ls3wcfLc+ibwegl6j X-Received: by 2002:a17:902:e889:b029:e7:1490:9da5 with SMTP id w9-20020a170902e889b02900e714909da5mr9841978plg.20.1617925535055; Thu, 08 Apr 2021 16:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617925535; cv=none; d=google.com; s=arc-20160816; b=ehiZhlZXud6nSpBVyNfcv+Izj28Vaa6XgyG6MtfxDwPo8tmp+zRfj5KltyaE5O79r2 Kk4AQDnyy5epAGZfA/pUgxNEktKmRnTO2aclG+SLjGNx8Dy3AUiFNdKeRYazS741UMY3 Uiua/LiXk9QEOpSnC+pAlPNfFuqR8zNtyUf8W2nhGZ0b9Odz8z3SU8/tzhWGkN7w4DnH GwFfV6Y0VLKi36jM/tnd9IqNv2AV+1UdeXBrTL55IvJM6ijSxOKj9Q0VSRGw//GCbKdD e4xc/45fP0V93/RzdJBtNp0T9qz6tYSgKA1/JeieYMhYIsUPPNW3V60Nl/gOc90f4tou yROQ== 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=vPRUOYIolP6Zcf38F8T1KJCfFhHdJ3+UjhE2Kl0rYHk=; b=Fnx27ohGs6eWWwWqlgA1unAT03Z2QfPP5pZfkoq/+bRDVqD5cpjuR4bK6KR2Dl19C+ gzjQgnm5K8y1IjoLEu/5g6CeJtHeZ53keu+131/XgCWFzPe3kstfk9Rdx8iChIHQM3uh 7CGwPG8ZGI/mhYsKw54aYBMdmy0m7BnPmCQnBzV6CXAi37+IspjFUlVeft3IkMCPysK9 rgx/S4mMFDwLyM/r+9s2x9PEE6okUb0Uce/ehHcsmrOzypXjplEAS5gq7CfHpMNGVDa3 OQEtYc2o/mLBL6c015pRGzTIi5Gcd4IMkcFwrODXjq/eZK8JOSW1ktdOs3FS71AVyTOI 5Dmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=quRxZdtC; 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 gz6si985746pjb.36.2021.04.08.16.45.20; Thu, 08 Apr 2021 16:45:35 -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=quRxZdtC; 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 S233003AbhDHXnr (ORCPT + 99 others); Thu, 8 Apr 2021 19:43:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232976AbhDHXnq (ORCPT ); Thu, 8 Apr 2021 19:43:46 -0400 Received: from mail-qv1-xf49.google.com (mail-qv1-xf49.google.com [IPv6:2607:f8b0:4864:20::f49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4167AC061760 for ; Thu, 8 Apr 2021 16:43:34 -0700 (PDT) Received: by mail-qv1-xf49.google.com with SMTP id dz17so2082260qvb.14 for ; Thu, 08 Apr 2021 16:43:34 -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=vPRUOYIolP6Zcf38F8T1KJCfFhHdJ3+UjhE2Kl0rYHk=; b=quRxZdtCDPR6OhkaUBqKezAnyT6r8AW9F0E7tfBCP1bYDJm9ipupmhQTfWf9kyG8xt m+SRz2SscoDX7EKEaGoKp6HuzxgAH9yyaAZnP1bqfMzue9WosB9yW8iN1l8qLendN2u1 SajVcyh9h5+huUD1MAQQtB5RQml42Fd9SPwoJOUPopR/TD0Rb1xJKaaw7UHHj8+VQOHo V90Oya1oHmZ/yMZm3KOejvvgtvJeOqsPh/uMFmWHV6u4s66e2Oj6tsTt+PntFWwuwGbK U1vk1/unTU4bvIaSYQBJUJ1gBFp0dRJM3bnsdhNxGOPJs+aWVKzxhR86usPdXp74qQBT OU7g== 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=vPRUOYIolP6Zcf38F8T1KJCfFhHdJ3+UjhE2Kl0rYHk=; b=Dwsh8zWpCRvfvxw+jUhwJwy8UFA4c7xHlfjSRSW2wYGrT/6uIc2J7tHc6gfganfH8y KQ6+YlrKJFxiWWRmyfAyjQtW37xWYBeya0tFfDk4B7EzZVpNjObfJ/o7c4uuwTkXENoK rv32k4LE6R82cC37nDWDMHSsHGM/LgjfBcmYDqFhL/IGWrAw6+n/ETigbGIgcvOdCC4A zFDoX03RMg//yLsGaeLZsZyvqDlqUC6GL8QJ6t46kOXsdz+/gsi4nNd5BE0qhp8OzJq3 1iFr8G1nZgDaMIqq3rs8/Y6fl6CJavsbcvjkNv8WykIdr5ppmNgKixr5EcxZYKh1HFWR mB1Q== X-Gm-Message-State: AOAM530Cx42Fnu8sZ5OnjfqrtUAV7NzPr7MLgUHPj+rJ0KX/IWJngVMb r74tV2pvsw/idE8Cw5EVTMoleR4ZCrzgwPpRiil/ X-Received: from ajr0.svl.corp.google.com ([2620:15c:2cd:203:3d06:d00f:a626:675a]) (user=axelrasmussen job=sendgmr) by 2002:a05:6214:905:: with SMTP id dj5mr11624979qvb.34.1617925413457; Thu, 08 Apr 2021 16:43:33 -0700 (PDT) Date: Thu, 8 Apr 2021 16:43:19 -0700 In-Reply-To: <20210408234327.624367-1-axelrasmussen@google.com> Message-Id: <20210408234327.624367-2-axelrasmussen@google.com> Mime-Version: 1.0 References: <20210408234327.624367-1-axelrasmussen@google.com> X-Mailer: git-send-email 2.31.1.295.g9ea45b61b8-goog Subject: [PATCH 1/9] userfaultfd/hugetlbfs: avoid including userfaultfd_k.h in hugetlb.h From: Axel Rasmussen To: Alexander Viro , Andrea Arcangeli , Andrew Morton , Daniel Colascione , 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. Signed-off-by: Axel Rasmussen --- include/linux/hugetlb.h | 5 ++++- mm/hugetlb.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 1d3246b31a41..dfb749eaf348 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; @@ -136,6 +135,8 @@ 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 +enum mcopy_atomic_mode; + int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, struct vm_area_struct *dst_vma, unsigned long dst_addr, @@ -315,6 +316,8 @@ static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, } #ifdef CONFIG_USERFAULTFD +enum mcopy_atomic_mode; + static inline int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, struct vm_area_struct *dst_vma, diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 9973dec4976c..3b93bbf8c80f 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