Skip to content

Commit

Permalink
bootmem: Move contig_page_data definition to bootmem.c/nobootmem.c
Browse files Browse the repository at this point in the history
Now that bootmem.c and nobootmem.c are separate, it's cleaner to
define contig_page_data in each file than in page_alloc.c with #ifdef.
Move it.

This patch doesn't introduce any behavior change.

-v2: According to Andrew, fixed the struct layout.
-tj: Updated commit description.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Yinghai Lu authored and Tejun Heo committed Feb 24, 2011
1 parent 0932587 commit e782ab4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 7 additions & 0 deletions mm/bootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@

#include "internal.h"

#ifndef CONFIG_NEED_MULTIPLE_NODES
struct pglist_data __refdata contig_page_data = {
.bdata = &bootmem_node_data[0]
};
EXPORT_SYMBOL(contig_page_data);
#endif

unsigned long max_low_pfn;
unsigned long min_low_pfn;
unsigned long max_pfn;
Expand Down
5 changes: 5 additions & 0 deletions mm/nobootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

#include "internal.h"

#ifndef CONFIG_NEED_MULTIPLE_NODES
struct pglist_data __refdata contig_page_data;
EXPORT_SYMBOL(contig_page_data);
#endif

unsigned long max_low_pfn;
unsigned long min_low_pfn;
unsigned long max_pfn;
Expand Down
9 changes: 0 additions & 9 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4841,15 +4841,6 @@ void __init set_dma_reserve(unsigned long new_dma_reserve)
dma_reserve = new_dma_reserve;
}

#ifndef CONFIG_NEED_MULTIPLE_NODES
struct pglist_data __refdata contig_page_data = {
#ifndef CONFIG_NO_BOOTMEM
.bdata = &bootmem_node_data[0]
#endif
};
EXPORT_SYMBOL(contig_page_data);
#endif

void __init free_area_init(unsigned long *zones_size)
{
free_area_init_node(0, zones_size,
Expand Down

0 comments on commit e782ab4

Please sign in to comment.