mm: unify module_alloc code for vmalloc
authorDavid Rientjes <rientjes@google.com>
Thu, 13 Jan 2011 23:46:02 +0000 (15:46 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Jan 2011 01:32:34 +0000 (17:32 -0800)
commitd0a21265dfb5fa8ae54e90d0fb6d1c215b10a28a
treea3bf2c96ad8e180f32a52e208667a40bb972275b
parentec3f64fc9c196a304c4b7db3e1ff56d640628509
mm: unify module_alloc code for vmalloc

Four architectures (arm, mips, sparc, x86) use __vmalloc_area() for
module_init().  Much of the code is duplicated and can be generalized in a
globally accessible function, __vmalloc_node_range().

__vmalloc_node() now calls into __vmalloc_node_range() with a range of
[VMALLOC_START, VMALLOC_END) for functionally equivalent behavior.

Each architecture may then use __vmalloc_node_range() directly to remove
the duplication of code.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arm/kernel/module.c
arch/mips/kernel/module.c
arch/sparc/kernel/module.c
arch/x86/kernel/module.c
include/linux/vmalloc.h
mm/vmalloc.c