[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1334325950-7881-3-git-send-email-m.szyprowski@samsung.com>
Date: Fri, 13 Apr 2012 16:05:48 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: linux-arm-kernel@...ts.infradead.org,
linaro-mm-sig@...ts.linaro.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: Marek Szyprowski <m.szyprowski@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Arnd Bergmann <arnd@...db.de>,
Russell King - ARM Linux <linux@....linux.org.uk>,
Chunsang Jeong <chunsang.jeong@...aro.org>,
Krishna Reddy <vdumpa@...dia.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Hiroshi Doyu <hdoyu@...dia.com>,
Subash Patel <subashrp@...il.com>
Subject: [PATCH 2/4] mm: vmalloc: export find_vm_area() function
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 <m.szyprowski@...sung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@...sung.com>
---
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;
--
1.7.1.569.g6f426
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists