From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1742C43331 for ; Thu, 2 Apr 2020 04:11:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8309820784 for ; Thu, 2 Apr 2020 04:11:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="PIW2UtfY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8309820784 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1CB2F8E009A; Thu, 2 Apr 2020 00:11:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A38B8E000D; Thu, 2 Apr 2020 00:11:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06B008E009A; Thu, 2 Apr 2020 00:11:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id DE2D08E000D for ; Thu, 2 Apr 2020 00:11:56 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A7915180AD807 for ; Thu, 2 Apr 2020 04:11:56 +0000 (UTC) X-FDA: 76661591832.05.step09_683e4d4479f41 X-HE-Tag: step09_683e4d4479f41 X-Filterd-Recvd-Size: 4246 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 04:11:56 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 224D7206E9; Thu, 2 Apr 2020 04:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585800715; bh=yF21G7wa7wUhn83doRijPOIpfLJPz5iJkq+P5a9Y/o0=; h=Date:From:To:Subject:In-Reply-To:From; b=PIW2UtfYdF7X4zuc3kFj1v88hEK/zoittc8Zn74g6QUt0gFSqI7oRIFcN/60yf56I IcrdCloIPaKY6f/F3FR49Im3dliYoUSUcJPMCCZAGoNWnJcdeIPM+cJEtbVsIeGt+P ZXToeJRZ4RkaFWzRduRao4dEcp4GL46NvJPVECb4= Date: Wed, 01 Apr 2020 21:11:54 -0700 From: Andrew Morton To: agl@us.ibm.com, ak@suse.de, akpm@linux-foundation.org, bhe@redhat.com, christophe.leroy@c-s.fr, linux-mm@kvack.org, lkp@intel.com, mike.kravetz@oracle.com, mm-commits@vger.kernel.org, nacc@us.ibm.com, npiggin@suse.de, torvalds@linux-foundation.org Subject: [patch 154/155] mm/hugetlb: fix build failure with HUGETLB_PAGE but not HUGEBTLBFS Message-ID: <20200402041154.rvrGUeBta%akpm@linux-foundation.org> In-Reply-To: <20200401210155.09e3b9742e1c6e732f5a7250@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Christophe Leroy Subject: mm/hugetlb: fix build failure with HUGETLB_PAGE but not HUGEBTLBFS When CONFIG_HUGETLB_PAGE is set but not CONFIG_HUGETLBFS, the following build failure is encoutered: In file included from arch/powerpc/mm/fault.c:33:0: ./include/linux/hugetlb.h: In function 'hstate_inode': ./include/linux/hugetlb.h:477:9: error: implicit declaration of function 'HUGETLBFS_SB' [-Werror=implicit-function-declaration] return HUGETLBFS_SB(i->i_sb)->hstate; ^ ./include/linux/hugetlb.h:477:30: error: invalid type argument of '->' (have 'int') return HUGETLBFS_SB(i->i_sb)->hstate; ^ Gate hstate_inode() with CONFIG_HUGETLBFS instead of CONFIG_HUGETLB_PAGE. Link: http://lkml.kernel.org/r/7e8c3a3c9a587b9cd8a2f146df32a421b961f3a2.1584432148.git.christophe.leroy@c-s.fr Link: https://patchwork.ozlabs.org/patch/1255548/#2386036 Fixes: a137e1cc6d6e ("hugetlbfs: per mount huge page sizes") Signed-off-by: Christophe Leroy Reported-by: kbuild test robot Reviewed-by: Mike Kravetz Cc: Baoquan He Cc: Nishanth Aravamudan Cc: Nick Piggin Cc: Adam Litke Cc: Andi Kleen Signed-off-by: Andrew Morton --- include/linux/hugetlb.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) --- a/include/linux/hugetlb.h~mm-hugetlb-fix-build-failure-with-hugetlb_page-but-not-hugebtlbfs +++ a/include/linux/hugetlb.h @@ -443,7 +443,10 @@ static inline bool is_file_hugepages(str return is_file_shm_hugepages(file); } - +static inline struct hstate *hstate_inode(struct inode *i) +{ + return HUGETLBFS_SB(i->i_sb)->hstate; +} #else /* !CONFIG_HUGETLBFS */ #define is_file_hugepages(file) false @@ -455,6 +458,10 @@ hugetlb_file_setup(const char *name, siz return ERR_PTR(-ENOSYS); } +static inline struct hstate *hstate_inode(struct inode *i) +{ + return NULL; +} #endif /* !CONFIG_HUGETLBFS */ #ifdef HAVE_ARCH_HUGETLB_UNMAPPED_AREA @@ -525,11 +532,6 @@ extern unsigned int default_hstate_idx; #define default_hstate (hstates[default_hstate_idx]) -static inline struct hstate *hstate_inode(struct inode *i) -{ - return HUGETLBFS_SB(i->i_sb)->hstate; -} - static inline struct hstate *hstate_file(struct file *f) { return hstate_inode(file_inode(f)); @@ -781,11 +783,6 @@ static inline struct hstate *hstate_vma( { return NULL; } - -static inline struct hstate *hstate_inode(struct inode *i) -{ - return NULL; -} static inline struct hstate *page_hstate(struct page *page) { _