From patchwork Thu Dec 22 21:18:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 9486899 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8108C601C0 for ; Thu, 22 Dec 2016 21:20:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CB9327AB2 for ; Thu, 22 Dec 2016 21:20:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 616CE27FAD; Thu, 22 Dec 2016 21:20:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A91F228066 for ; Thu, 22 Dec 2016 21:20:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966922AbcLVVUE (ORCPT ); Thu, 22 Dec 2016 16:20:04 -0500 Received: from mga03.intel.com ([134.134.136.65]:2589 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966782AbcLVVTI (ORCPT ); Thu, 22 Dec 2016 16:19:08 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 22 Dec 2016 13:19:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,390,1477983600"; d="scan'208";a="1075369269" Received: from rzwisler-desk1.amr.corp.intel.com (HELO tarkir.intel.com) ([10.255.0.224]) by orsmga001.jf.intel.com with ESMTP; 22 Dec 2016 13:19:05 -0800 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , Alexander Viro , Andrew Morton , Arnd Bergmann , Christoph Hellwig , Dan Williams , Dave Chinner , Dave Hansen , Jan Kara , Matthew Wilcox , linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org Subject: [PATCH v2 2/4] dax: add stub for pmdp_huge_clear_flush() Date: Thu, 22 Dec 2016 14:18:54 -0700 Message-Id: <1482441536-14550-3-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482441536-14550-1-git-send-email-ross.zwisler@linux.intel.com> References: <1482441536-14550-1-git-send-email-ross.zwisler@linux.intel.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a pmdp_huge_clear_flush() stub for configs that don't define CONFIG_TRANSPARENT_HUGEPAGE. We use a WARN_ON_ONCE() instead of a BUILD_BUG() because in the DAX code at least we do want this compile successfully even for configs without CONFIG_TRANSPARENT_HUGEPAGE. It'll be a runtime decision whether we call this code gets called, based on whether we find DAX PMD entries in our tree. We shouldn't ever find such PMD entries for !CONFIG_TRANSPARENT_HUGEPAGE configs, so this function should never be called. Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara --- include/asm-generic/pgtable.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 18af2bc..65e9536 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -178,9 +178,19 @@ extern pte_t ptep_clear_flush(struct vm_area_struct *vma, #endif #ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH +#ifdef CONFIG_TRANSPARENT_HUGEPAGE extern pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp); +#else +static inline pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, + unsigned long address, + pmd_t *pmdp) +{ + WARN_ON_ONCE(1); + return *pmdp; +} +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT