diff options
author | Johannes Weiner <hannes@saeurebad.de> | 2008-07-24 00:28:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:20 -0400 |
commit | 4cc278b721d5bf3569dfc5f1100253042e097bc3 (patch) | |
tree | a2e1a918b76a68c72152f8f9c95449d1a5ba69ab /mm/bootmem.c | |
parent | 0f3caba211babef6e3fbde1ba76ddc79321bc92f (diff) |
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>
Diffstat (limited to 'mm/bootmem.c')
-rw-r--r-- | mm/bootmem.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c index 89646f77b427..459da4710b8f 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c | |||
@@ -587,6 +587,19 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align, | |||
587 | return ___alloc_bootmem(size, align, goal, 0); | 587 | return ___alloc_bootmem(size, align, goal, 0); |
588 | } | 588 | } |
589 | 589 | ||
590 | static void * __init ___alloc_bootmem_node(bootmem_data_t *bdata, | ||
591 | unsigned long size, unsigned long align, | ||
592 | unsigned long goal, unsigned long limit) | ||
593 | { | ||
594 | void *ptr; | ||
595 | |||
596 | ptr = alloc_bootmem_core(bdata, size, align, goal, limit); | ||
597 | if (ptr) | ||
598 | return ptr; | ||
599 | |||
600 | return ___alloc_bootmem(size, align, goal, limit); | ||
601 | } | ||
602 | |||
590 | /** | 603 | /** |
591 | * __alloc_bootmem_node - allocate boot memory from a specific node | 604 | * __alloc_bootmem_node - allocate boot memory from a specific node |
592 | * @pgdat: node to allocate from | 605 | * @pgdat: node to allocate from |
@@ -605,13 +618,7 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align, | |||
605 | void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, | 618 | void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, |
606 | unsigned long align, unsigned long goal) | 619 | unsigned long align, unsigned long goal) |
607 | { | 620 | { |
608 | void *ptr; | 621 | return ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0); |
609 | |||
610 | ptr = alloc_bootmem_core(pgdat->bdata, size, align, goal, 0); | ||
611 | if (ptr) | ||
612 | return ptr; | ||
613 | |||
614 | return __alloc_bootmem(size, align, goal); | ||
615 | } | 622 | } |
616 | 623 | ||
617 | #ifdef CONFIG_SPARSEMEM | 624 | #ifdef CONFIG_SPARSEMEM |
@@ -705,6 +712,6 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, | |||
705 | void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, | 712 | void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, |
706 | unsigned long align, unsigned long goal) | 713 | unsigned long align, unsigned long goal) |
707 | { | 714 | { |
708 | return alloc_bootmem_core(pgdat->bdata, size, align, goal, | 715 | return ___alloc_bootmem_node(pgdat->bdata, size, align, |
709 | ARCH_LOW_ADDRESS_LIMIT); | 716 | goal, ARCH_LOW_ADDRESS_LIMIT); |
710 | } | 717 | } |