From patchwork Fri Apr 13 14:05:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 7789 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 D9D0A23E4D for ; Fri, 13 Apr 2012 14:06:47 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 92F35A18396 for ; Fri, 13 Apr 2012 14:06:47 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so5856270iag.11 for ; Fri, 13 Apr 2012 07:06:47 -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=/A8HTaHQQXT5PF5KvgUcuxToszETGgXZrO9dJi0C1EM=; b=ai3BS9J6gBCR9UEZUnjWdliWxukcOK/Ihk1EIaJrNHTML1vxUqSBlCRCQiE4RFMB0I YT0kQ1VP5rfyNhOQs2f9vz3Iu/sDqTvz6Rn2xWBTljC6INftWDoU7vMFqnRObFlZVtEe TZGco/IdniI0kPgDz7qO2rH8KtZp1IkYuU4tdRqOn8uVLBsKBWdWAKYpSCCzy9NepBjU S42jZIBgUNfwqeVEfKih+em/LnTXde06+GwgPPgo3rsaFM8udJ5qORKksRre2kWj57X7 fIYjT3ajNTA1ptu8DD6gpVidaj9KNtaCmm1m0h+rN0nvJUryqmoSrveI7hy60c7YKF8Q JiAQ== Received: by 10.50.149.163 with SMTP id ub3mr1644653igb.30.1334326007355; Fri, 13 Apr 2012 07:06:47 -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.70.69 with SMTP id c5csp30276ibj; Fri, 13 Apr 2012 07:06:46 -0700 (PDT) Received: by 10.213.4.134 with SMTP id 6mr155300ebr.244.1334326000853; Fri, 13 Apr 2012 07:06:40 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id n16si9590057wee.15.2012.04.13.07.06.09; Fri, 13 Apr 2012 07:06:40 -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 1SIh8Z-0005hd-8W; Fri, 13 Apr 2012 14:06:07 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SIh8X-00053x-Cc for linaro-mm-sig@lists.linaro.org; Fri, 13 Apr 2012 14:06:05 +0000 MIME-version: 1.0 Received: from euspt2 ([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 <0M2F00JTV8I8PV10@mailout4.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 13 Apr 2012 15:06:08 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M2F00GWW8HZDZ@spt2.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 13 Apr 2012 15:05:59 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id B5F7C270079; Fri, 13 Apr 2012 16:16:28 +0200 (CEST) Date: Fri, 13 Apr 2012 16:05:48 +0200 From: Marek Szyprowski In-reply-to: <1334325950-7881-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: <1334325950-7881-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.1 References: <1334325950-7881-1-git-send-email-m.szyprowski@samsung.com> Cc: Russell King - ARM Linux , Arnd Bergmann , Konrad Rzeszutek Wilk , Kyungmin Park Subject: [Linaro-mm-sig] [PATCH 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: ALoCoQkFfu9k93LDPZy5wbpkikE3tZQvMsKfuxbhewCFcOArSPXbMPpwIikK/0JPor6QRQUVIi9y 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 deletions(-) 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 8bc7f3e..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;