bootmem: Make __alloc_bootmem_low_node fall back to other nodes

__alloc_bootmem_node already does this, make the interface consistent.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Johannes Weiner 2008-07-23 21:28:08 -07:00 committed by Linus Torvalds
parent 0f3caba211
commit 4cc278b721

View file

@ -587,6 +587,19 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align,
return ___alloc_bootmem(size, align, goal, 0); return ___alloc_bootmem(size, align, goal, 0);
} }
static void * __init ___alloc_bootmem_node(bootmem_data_t *bdata,
unsigned long size, unsigned long align,
unsigned long goal, unsigned long limit)
{
void *ptr;
ptr = alloc_bootmem_core(bdata, size, align, goal, limit);
if (ptr)
return ptr;
return ___alloc_bootmem(size, align, goal, limit);
}
/** /**
* __alloc_bootmem_node - allocate boot memory from a specific node * __alloc_bootmem_node - allocate boot memory from a specific node
* @pgdat: node to allocate from * @pgdat: node to allocate from
@ -605,13 +618,7 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align,
void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
unsigned long align, unsigned long goal) unsigned long align, unsigned long goal)
{ {
void *ptr; return ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0);
ptr = alloc_bootmem_core(pgdat->bdata, size, align, goal, 0);
if (ptr)
return ptr;
return __alloc_bootmem(size, align, goal);
} }
#ifdef CONFIG_SPARSEMEM #ifdef CONFIG_SPARSEMEM
@ -705,6 +712,6 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align,
void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size,
unsigned long align, unsigned long goal) unsigned long align, unsigned long goal)
{ {
return alloc_bootmem_core(pgdat->bdata, size, align, goal, return ___alloc_bootmem_node(pgdat->bdata, size, align,
ARCH_LOW_ADDRESS_LIMIT); goal, ARCH_LOW_ADDRESS_LIMIT);
} }