[02/17] vmalloc: add const

Previous thread: [00/17] Virtual Compound Page Support V1 by Christoph Lameter on Tuesday, September 25, 2007 - 7:42 pm. (1 message)

Next thread: [03/17] i386: Resolve dependency of asm-i386/pgtable.h on highmem.h by Christoph Lameter on Tuesday, September 25, 2007 - 7:42 pm. (1 message)
To: <unlisted-recipients@...>, <@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Tuesday, September 25, 2007 - 7:42 pm

Make vmalloc functions work the same way as kfree() and friends that
take a const void * argument.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

---
include/linux/mm.h | 4 ++--
include/linux/vmalloc.h | 6 +++---
mm/vmalloc.c | 16 ++++++++--------
3 files changed, 13 insertions(+), 13 deletions(-)

Index: linux-2.6/mm/vmalloc.c
===================================================================
--- linux-2.6.orig/mm/vmalloc.c 2007-09-24 16:58:37.000000000 -0700
+++ linux-2.6/mm/vmalloc.c 2007-09-24 16:58:45.000000000 -0700
@@ -169,7 +169,7 @@ EXPORT_SYMBOL_GPL(map_vm_area);
/*
* Map a vmalloc()-space virtual address to the physical page.
*/
-struct page *vmalloc_to_page(void *vmalloc_addr)
+struct page *vmalloc_to_page(const void *vmalloc_addr)
{
unsigned long addr = (unsigned long) vmalloc_addr;
struct page *page = NULL;
@@ -198,7 +198,7 @@ EXPORT_SYMBOL(vmalloc_to_page);
/*
* Map a vmalloc()-space virtual address to the physical page frame number.
*/
-unsigned long vmalloc_to_pfn(void *vmalloc_addr)
+unsigned long vmalloc_to_pfn(const void *vmalloc_addr)
{
return page_to_pfn(vmalloc_to_page(vmalloc_addr));
}
@@ -305,7 +305,7 @@ struct vm_struct *get_vm_area_node(unsig
}

/* Caller must hold vmlist_lock */
-static struct vm_struct *__find_vm_area(void *addr)
+static struct vm_struct *__find_vm_area(const void *addr)
{
struct vm_struct *tmp;

@@ -318,7 +318,7 @@ static struct vm_struct *__find_vm_area(
}

/* Caller must hold vmlist_lock */
-static struct vm_struct *__remove_vm_area(void *addr)
+static struct vm_struct *__remove_vm_area(const void *addr)
{
struct vm_struct **p, *tmp;

@@ -347,7 +347,7 @@ found:
* This function returns the found VM area, but using it is NOT safe
* on SMP machines, except for its size or flags.
*/
-struct vm_struct *remove_vm_area(void *addr)
+struct vm_struct *remove_vm_area(const void *addr)
{
struct vm_struct *v;
write_lock(&vmlist_lo...

Previous thread: [00/17] Virtual Compound Page Support V1 by Christoph Lameter on Tuesday, September 25, 2007 - 7:42 pm. (1 message)

Next thread: [03/17] i386: Resolve dependency of asm-i386/pgtable.h on highmem.h by Christoph Lameter on Tuesday, September 25, 2007 - 7:42 pm. (1 message)