From patchwork Thu May 17 10:54:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 8716 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5CF5723E63 for ; Thu, 17 May 2012 10:55:21 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 2D0C3A18B21 for ; Thu, 17 May 2012 10:55:21 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so1944147yhp.11 for ; Thu, 17 May 2012 03:55:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :mime-version:date:from:in-reply-to:to:message-id:x-mailer :references:cc:subject:x-beenthere:x-mailman-version:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:content-type:content-transfer-encoding:sender :errors-to:x-gm-message-state; bh=70bIZVvPtWjuKqtX+uhJ6tIlLmLYH+AJVCah7WJwmoo=; b=GUnLUiQJ8vZEBZNfci2a9/6g15m/clDZQRmuuIvko0W10BJWbXnOIjxFvic8v4YakQ 7fHfdyIF2eY2FuW/mhwYHrsj3HrdEnUPPCYeFGU/b5k0b6dEQ8KSOsy4P6ijZtTSoNXW mbf5dNwG/UAPnNMyvrS/iX3CrGgHnk7khqqy2vCcNNyLepssdv9fbJVxvPYHFH3WcJX0 zlbOUGlAeyVYH8D/MulWO7vkpkMYwQomWt1xrGHzxiUsaWxFBUBsC6H4egm0921ZB5I7 YKUhiqwc5AuJHLHqnFdXe4MZtbrjK+ZQVyHFBcARk8v7bkIRsxJNcDNCeJc+oqgx8MFM Vlag== Received: by 10.50.154.169 with SMTP id vp9mr12637609igb.53.1337252120686; Thu, 17 May 2012 03:55:20 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.35.72 with SMTP id o8csp19654ibd; Thu, 17 May 2012 03:55:19 -0700 (PDT) Received: by 10.180.86.5 with SMTP id l5mr49697990wiz.6.1337252119283; Thu, 17 May 2012 03:55:19 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id h14si7590777wiv.35.2012.05.17.03.55.07; Thu, 17 May 2012 03:55:19 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SUyMN-0004wm-39; Thu, 17 May 2012 10:55:07 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SUyMK-0004v6-LO for linaro-mm-sig@lists.linaro.org; Thu, 17 May 2012 10:55:04 +0000 MIME-version: 1.0 Received: from euspt1 ([210.118.77.14]) by mailout4.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0M4500567YC5HT40@mailout4.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 17 May 2012 11:55:17 +0100 (BST) Received: from ubuntu.arm.acom ([106.210.236.191]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M4500MKCYBFX2@spt1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 17 May 2012 11:55:02 +0100 (BST) Date: Thu, 17 May 2012 12:54:43 +0200 From: Marek Szyprowski In-reply-to: <1337252085-22039-1-git-send-email-m.szyprowski@samsung.com> To: linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Message-id: <1337252085-22039-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.10.1 References: <1337252085-22039-1-git-send-email-m.szyprowski@samsung.com> Cc: Russell King - ARM Linux , Arnd Bergmann , Konrad Rzeszutek Wilk , Kyungmin Park Subject: [Linaro-mm-sig] [PATCHv2 2/4] mm: vmalloc: export find_vm_area() function X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQn8wZxs5nhzq8ffkqyux0DK1fFhy1YKz/wmK7d0AET5i6wE/domSzXGzD1HWvVzB2yQDn1r find_vm_area() function is usefull for other core subsystems (like dma-mapping) to get access to vm_area internals. Signed-off-by: Marek Szyprowski Reviewed-by: Kyungmin Park --- include/linux/vmalloc.h | 1 + mm/vmalloc.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 2e28f4d..6071e91 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -93,6 +93,7 @@ extern struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long start, unsigned long end, const void *caller); extern struct vm_struct *remove_vm_area(const void *addr); +extern struct vm_struct *find_vm_area(const void *addr); extern int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages); diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 8bc7f3ef..8cb7f22 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1402,7 +1402,15 @@ struct vm_struct *get_vm_area_caller(unsigned long size, unsigned long flags, -1, GFP_KERNEL, caller); } -static struct vm_struct *find_vm_area(const void *addr) +/** + * find_vm_area - find a continuous kernel virtual area + * @addr: base address + * + * Search for the kernel VM area starting at @addr, and return it. + * It is up to the caller to do all required locking to keep the returned + * pointer valid. + */ +struct vm_struct *find_vm_area(const void *addr) { struct vmap_area *va;