Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp534952ybb; Wed, 8 Apr 2020 05:04:34 -0700 (PDT) X-Google-Smtp-Source: APiQypIkrXr00IdzCb97TmFjvPgDUaC+Hol678McphmJzkpoDo2RhajAA6XOXtOHpKa/kU3UNEiB X-Received: by 2002:a9d:24e8:: with SMTP id z95mr994441ota.347.1586347474356; Wed, 08 Apr 2020 05:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586347474; cv=none; d=google.com; s=arc-20160816; b=oGVdNg9IYmNvGUgKfusdwBBJLj3G77nSBSsyh1StjveLD6tF+KKslCy9jK5eZ0+1Qr dWNDyu+8z6ndGTBcYujhNq2Efm1tENbFXPNUgYugzTKfRbwgUTxiSduS4oPC0CqQBExg DGA8tz+i6Jaf+jc9KPz4V1uPry0kbiy7teKbbM1fb6nKux9QrpCelxuzlotwAfdXwUc5 ajQzCaYVs+qmUeMNLoAxW6U422aB1IuDMNHOBUoU+HnkqSEtRwArcZryJzib8UtYrxZJ 9yZRje3N1fH4474N2IjKMxQSlezuNNaLH1LiqXBvQE7996KaLb3eQ0uf3jmEbHp32I95 O/KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kSiif4wtedwpdt50zgS9p2DvMcuq0oyuGm5DAffS2Lc=; b=Hh6lfMQiCQi6GRR01Ulj89wcf18FKWfzOREOIGEFu44ckMMGjibjAo1y/MLqt/CEJn d6G1VWxnmNGd1BDyummwqwXjyK+Atnb9+OLQgGsIzrJWeK0n6/1h0Y/5+NwcPoVibjO3 VHl7CN9kAsJeAz6HnQdS1ZyYAM9ebbMmfDE0JqbszxIvRoZc+t2ozEqLVNUrh0WQZRLV ucm3u25dqUmDaoh9qhMw8RYNhYg20+hC9/y8c+MHBP8KwAtgwpmF9KhhKBlnjYxpNB65 iEYGPfivSpL92A6Y/jpbqqlw1CKsMqEc3bo9f5RWlpfOjL/wLKSDF35m6xkEEJF+daqu JIrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=O5jAerjD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w79si2322616oif.21.2020.04.08.05.03.52; Wed, 08 Apr 2020 05:04:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=O5jAerjD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729014AbgDHMBM (ORCPT + 99 others); Wed, 8 Apr 2020 08:01:12 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51286 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbgDHMBI (ORCPT ); Wed, 8 Apr 2020 08:01:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=kSiif4wtedwpdt50zgS9p2DvMcuq0oyuGm5DAffS2Lc=; b=O5jAerjDMyDSpUBMTA/oevrNio S+TlXAsFGadlEtQRn1K3WEKNHl4L8/5pvGWwOLyvixbzEcvd+/ni+/XU7d+F+gFhv2eHAswYI0p5y 3vblTkwNDKub9/GntTSs3x8s7XoXcgKJWPdjELcFB03oSS6bmMLVCycLYwliDuP1T49LyprcML2MU I+lYkcJVsuhyarlTX3/yPf/XwGZTqxWVjwXdtAKHkAKx9VvIp4YlafGpxerk1luAU75O4vT1PQ0f6 jtPBngw3NtlCkVbEBYkQYZEyDSVKr4FEj31ywgR/Pkbn4h44juFzKCV/mmP8+2Spa1LpO8PFmgUYF +AaNY5dQ==; Received: from [2001:4bb8:180:5765:65b6:f11e:f109:b151] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jM9Nw-0005cH-PA; Wed, 08 Apr 2020 12:00:49 +0000 From: Christoph Hellwig To: Andrew Morton , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , x86@kernel.org, David Airlie , Daniel Vetter , Laura Abbott , Sumit Semwal , Sakari Ailus , Minchan Kim , Nitin Gupta Cc: Robin Murphy , Christophe Leroy , Peter Zijlstra , linuxppc-dev@lists.ozlabs.org, linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 22/28] mm: remove both instances of __vmalloc_node_flags Date: Wed, 8 Apr 2020 13:59:20 +0200 Message-Id: <20200408115926.1467567-23-hch@lst.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200408115926.1467567-1-hch@lst.de> References: <20200408115926.1467567-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The real version just had a few callers that can open code it and remove one layer of indirection. The nommu stub was public but only had a single caller, so remove it and avoid a CONFIG_MMU ifdef in vmalloc.h. Signed-off-by: Christoph Hellwig --- include/linux/vmalloc.h | 9 --------- mm/nommu.c | 3 ++- mm/vmalloc.c | 20 ++++++-------------- 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index c1b9d6eca05f..4a46d296e70d 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -115,17 +115,8 @@ extern void *__vmalloc_node_range(unsigned long size, unsigned long align, unsigned long start, unsigned long end, gfp_t gfp_mask, pgprot_t prot, unsigned long vm_flags, int node, const void *caller); -#ifndef CONFIG_MMU -extern void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags); -static inline void *__vmalloc_node_flags_caller(unsigned long size, int node, - gfp_t flags, void *caller) -{ - return __vmalloc_node_flags(size, node, flags); -} -#else extern void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void *caller); -#endif extern void vfree(const void *addr); extern void vfree_atomic(const void *addr); diff --git a/mm/nommu.c b/mm/nommu.c index 2df549adb22b..9553efa59787 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -150,7 +150,8 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask) } EXPORT_SYMBOL(__vmalloc); -void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags) +void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, + void *caller) { return __vmalloc(size, flags); } diff --git a/mm/vmalloc.c b/mm/vmalloc.c index de7952959e82..3d59d848ad48 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2566,14 +2566,6 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask) } EXPORT_SYMBOL(__vmalloc); -static inline void *__vmalloc_node_flags(unsigned long size, - int node, gfp_t flags) -{ - return __vmalloc_node(size, 1, flags, node, - __builtin_return_address(0)); -} - - void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, void *caller) { @@ -2594,8 +2586,8 @@ void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags, */ void *vmalloc(unsigned long size) { - return __vmalloc_node_flags(size, NUMA_NO_NODE, - GFP_KERNEL); + return __vmalloc_node(size, 1, GFP_KERNEL, NUMA_NO_NODE, + __builtin_return_address(0)); } EXPORT_SYMBOL(vmalloc); @@ -2614,8 +2606,8 @@ EXPORT_SYMBOL(vmalloc); */ void *vzalloc(unsigned long size) { - return __vmalloc_node_flags(size, NUMA_NO_NODE, - GFP_KERNEL | __GFP_ZERO); + return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_ZERO, NUMA_NO_NODE, + __builtin_return_address(0)); } EXPORT_SYMBOL(vzalloc); @@ -2670,8 +2662,8 @@ EXPORT_SYMBOL(vmalloc_node); */ void *vzalloc_node(unsigned long size, int node) { - return __vmalloc_node_flags(size, node, - GFP_KERNEL | __GFP_ZERO); + return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_ZERO, node, + __builtin_return_address(0)); } EXPORT_SYMBOL(vzalloc_node); -- 2.25.1