aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/bootmem.c25
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
590static 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,
605void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, 618void * __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,
705void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, 712void * __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}