[PATCH] memory hotplug: move section_mem_map alloc to sparse.c
This basically keeps up from having to extern __kmalloc_section_memmap(). The vaddr_in_vmalloc_area() helper could go in a vmalloc header, but that header gets hard to work with, because it needs some arch-specific macros. Just stick it in here for now, instead of creating another header. Signed-off-by: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Lion Vollnhals <webmaster@schiggl.de> Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz> Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
3947be1969
commit
0b0acbec1b
@@ -340,15 +340,12 @@ static int memory_probe_init(void)
|
||||
static int add_memory_block(unsigned long node_id, struct mem_section *section,
|
||||
unsigned long state, int phys_device)
|
||||
{
|
||||
size_t size = sizeof(struct memory_block);
|
||||
struct memory_block *mem = kmalloc(size, GFP_KERNEL);
|
||||
struct memory_block *mem = kzalloc(sizeof(*mem), GFP_KERNEL);
|
||||
int ret = 0;
|
||||
|
||||
if (!mem)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(mem, 0, size);
|
||||
|
||||
mem->phys_index = __section_nr(section);
|
||||
mem->state = state;
|
||||
init_MUTEX(&mem->state_sem);
|
||||
|
Reference in New Issue
Block a user