Commit 8ae04463 authored by Johannes Weiner's avatar Johannes Weiner Committed by Linus Torvalds

mm: normalize internal argument passing of bootmem data

All _core functions only need the bootmem data, not the whole node descriptor.
Adjust the two functions that take the node descriptor unneededly.
Signed-off-by: default avatarJohannes Weiner <hannes@saeurebad.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6b312c0e
...@@ -87,10 +87,9 @@ static unsigned long __init get_mapsize(bootmem_data_t *bdata) ...@@ -87,10 +87,9 @@ static unsigned long __init get_mapsize(bootmem_data_t *bdata)
/* /*
* Called once to set up the allocator itself. * Called once to set up the allocator itself.
*/ */
static unsigned long __init init_bootmem_core(pg_data_t *pgdat, static unsigned long __init init_bootmem_core(bootmem_data_t *bdata,
unsigned long mapstart, unsigned long start, unsigned long end) unsigned long mapstart, unsigned long start, unsigned long end)
{ {
bootmem_data_t *bdata = pgdat->bdata;
unsigned long mapsize; unsigned long mapsize;
mminit_validate_memmodel_limits(&start, &end); mminit_validate_memmodel_limits(&start, &end);
...@@ -372,11 +371,10 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size, ...@@ -372,11 +371,10 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size,
return ret; return ret;
} }
static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat) static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata)
{ {
struct page *page; struct page *page;
unsigned long pfn; unsigned long pfn;
bootmem_data_t *bdata = pgdat->bdata;
unsigned long i, count; unsigned long i, count;
unsigned long idx; unsigned long idx;
unsigned long *map; unsigned long *map;
...@@ -441,7 +439,7 @@ static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat) ...@@ -441,7 +439,7 @@ static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat)
unsigned long __init init_bootmem_node(pg_data_t *pgdat, unsigned long freepfn, unsigned long __init init_bootmem_node(pg_data_t *pgdat, unsigned long freepfn,
unsigned long startpfn, unsigned long endpfn) unsigned long startpfn, unsigned long endpfn)
{ {
return init_bootmem_core(pgdat, freepfn, startpfn, endpfn); return init_bootmem_core(pgdat->bdata, freepfn, startpfn, endpfn);
} }
int __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, int __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
...@@ -466,14 +464,14 @@ void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, ...@@ -466,14 +464,14 @@ void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
unsigned long __init free_all_bootmem_node(pg_data_t *pgdat) unsigned long __init free_all_bootmem_node(pg_data_t *pgdat)
{ {
register_page_bootmem_info_node(pgdat); register_page_bootmem_info_node(pgdat);
return free_all_bootmem_core(pgdat); return free_all_bootmem_core(pgdat->bdata);
} }
unsigned long __init init_bootmem(unsigned long start, unsigned long pages) unsigned long __init init_bootmem(unsigned long start, unsigned long pages)
{ {
max_low_pfn = pages; max_low_pfn = pages;
min_low_pfn = start; min_low_pfn = start;
return init_bootmem_core(NODE_DATA(0), start, 0, pages); return init_bootmem_core(NODE_DATA(0)->bdata, start, 0, pages);
} }
#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
...@@ -504,7 +502,7 @@ void __init free_bootmem(unsigned long addr, unsigned long size) ...@@ -504,7 +502,7 @@ void __init free_bootmem(unsigned long addr, unsigned long size)
unsigned long __init free_all_bootmem(void) unsigned long __init free_all_bootmem(void)
{ {
return free_all_bootmem_core(NODE_DATA(0)); return free_all_bootmem_core(NODE_DATA(0)->bdata);
} }
void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align, void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment