Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp345118pxk; Thu, 24 Sep 2020 07:04:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3LpWKpKCI/003e0NLRao//Uhji8IB7nwU8YmUY3h4lTKH+Ju1Lwvoxkw0b4Hbq7Fzq+By X-Received: by 2002:a17:906:c1c3:: with SMTP id bw3mr38440ejb.516.1600956243734; Thu, 24 Sep 2020 07:04:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600956243; cv=none; d=google.com; s=arc-20160816; b=idQHwziOcowpwg5Ik6SiYI8NEpMgqVRHUlHLkWA//1i5f+Gnz79jY0Eu7Kk+Ej1RI8 shx5AZjLFOMFutLx3fK+PKyX6tPCpmXl/zvw46x2E/dLBcWx41mcQqvSiHdV4Bxdep1q nJwr0UfaGApgoXX8ek0m80yOMJcnfJuz4uFwq4IabpIu5b/AB6P8OA/+seD9nQm5QLJ9 7HS6lFec0ZAdWgez9+0iHwYjvgB0nCg2AE1OIW1BYOBtU9U0Fk9Oe7hr5nMrC1VfOcaV IAs32CwFRjZfeHsFBDw4ti5AubJMErUpk/CLiJvY3mk9cmBHb3EZlE7lUQCCa04UOvg4 W8zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ix+nhROFgS2R/TvryqxFuXEm6pOX6uuPKFVKed32kPg=; b=VjJUIUIs7r5xEQ+/cXMnRUQSr46fwP7vthuVTKETYqnRRE1QZgHEfd2elnXG9APVlS VUsbouTrklmCr+AgPZBhaWS8Fkrh2ugErdntnlMZoSNNhDuCQhJkqpyQpRgTtLAP1/uA jtZLNBv2KM7ZhPt++87jLERYbfQUdCnzpSkuNP91/wJsSziALE512nyYRYGycuglFEQH uXrJtvvquG/TrRwLWpzt56sqmnTkrjBoGyxNYYkw67/PWmuZhS+Y8HsMdFqlrwrx5wIO 4FzlXA4dcXiqp3swDF6pkwHHdQZnPuii/4EFFGItSMzTQ4iaYt/dgQe6CALPCeNs6DYt mW+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OVPmZrJg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf14si2046821ejb.441.2020.09.24.07.03.33; Thu, 24 Sep 2020 07:04:03 -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=@infradead.org header.s=casper.20170209 header.b=OVPmZrJg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728277AbgIXOAE (ORCPT + 99 others); Thu, 24 Sep 2020 10:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728169AbgIXN7W (ORCPT ); Thu, 24 Sep 2020 09:59:22 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E5D7C0613D6 for ; Thu, 24 Sep 2020 06:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=ix+nhROFgS2R/TvryqxFuXEm6pOX6uuPKFVKed32kPg=; b=OVPmZrJgH+Pd3TIC054x3Xgco3 7oGmXl82TkDdK0Vh5KCQpoZD/y6iJKCrvS5JfHCO268Rcks+sjtogTI7hxgsYdd8THh6+Xm03NwA/ nQSwz1iqy+wyOXFQq0KSdVcBk+SjF+56iu4mwCNLNHRxIsJJMhHZBWOblrbbAH8backTeVk6U7UmA ZC4B1JByCHrx56YZYKJFh1qIrsDVXR+VRYO8ABqzCHrmyx7iB0tT5M9+/RzuHzBRe8EoMyoRfSHxM A4oHQYC/CNQ5KAH44hXhbOZRWvrWEpjk/ICZynCvG/XViwCDKUi/5djGYLvw8cD9foW31fpXWZ1q0 YO9BHotA==; Received: from p4fdb0c34.dip0.t-ipconnect.de ([79.219.12.52] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLRm8-0003xk-Oj; Thu, 24 Sep 2020 13:59:09 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Peter Zijlstra , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Jani Nikula , Joonas Lahtinen , Tvrtko Ursulin , Chris Wilson , Matthew Auld , Rodrigo Vivi , Minchan Kim , Matthew Wilcox , Nitin Gupta , x86@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org Subject: [PATCH 11/11] mm: remove alloc_vm_area Date: Thu, 24 Sep 2020 15:58:53 +0200 Message-Id: <20200924135853.875294-12-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200924135853.875294-1-hch@lst.de> References: <20200924135853.875294-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All users are gone now. Signed-off-by: Christoph Hellwig --- include/linux/vmalloc.h | 5 +---- mm/nommu.c | 7 ------ mm/vmalloc.c | 48 ----------------------------------------- 3 files changed, 1 insertion(+), 59 deletions(-) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index c77efeac242514..938eaf9517e266 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -169,6 +169,7 @@ extern struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags, unsigned long start, unsigned long end, const void *caller); +void free_vm_area(struct vm_struct *area); extern struct vm_struct *remove_vm_area(const void *addr); extern struct vm_struct *find_vm_area(const void *addr); @@ -204,10 +205,6 @@ static inline void set_vm_flush_reset_perms(void *addr) } #endif -/* Allocate/destroy a 'vmalloc' VM area. */ -extern struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes); -extern void free_vm_area(struct vm_struct *area); - /* for /dev/kmem */ extern long vread(char *buf, char *addr, unsigned long count); extern long vwrite(char *buf, char *addr, unsigned long count); diff --git a/mm/nommu.c b/mm/nommu.c index 75a327149af127..9272f30e4c4726 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -354,13 +354,6 @@ void vm_unmap_aliases(void) } EXPORT_SYMBOL_GPL(vm_unmap_aliases); -struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes) -{ - BUG(); - return NULL; -} -EXPORT_SYMBOL_GPL(alloc_vm_area); - void free_vm_area(struct vm_struct *area) { BUG(); diff --git a/mm/vmalloc.c b/mm/vmalloc.c index e2a2ded8d93478..3bc5b832451ef2 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3083,54 +3083,6 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, } EXPORT_SYMBOL(remap_vmalloc_range); -static int f(pte_t *pte, unsigned long addr, void *data) -{ - pte_t ***p = data; - - if (p) { - *(*p) = pte; - (*p)++; - } - return 0; -} - -/** - * alloc_vm_area - allocate a range of kernel address space - * @size: size of the area - * @ptes: returns the PTEs for the address space - * - * Returns: NULL on failure, vm_struct on success - * - * This function reserves a range of kernel address space, and - * allocates pagetables to map that range. No actual mappings - * are created. - * - * If @ptes is non-NULL, pointers to the PTEs (in init_mm) - * allocated for the VM area are returned. - */ -struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes) -{ - struct vm_struct *area; - - area = get_vm_area_caller(size, VM_IOREMAP, - __builtin_return_address(0)); - if (area == NULL) - return NULL; - - /* - * This ensures that page tables are constructed for this region - * of kernel virtual address space and mapped into init_mm. - */ - if (apply_to_page_range(&init_mm, (unsigned long)area->addr, - size, f, ptes ? &ptes : NULL)) { - free_vm_area(area); - return NULL; - } - - return area; -} -EXPORT_SYMBOL_GPL(alloc_vm_area); - void free_vm_area(struct vm_struct *area) { struct vm_struct *ret; -- 2.28.0