aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 349b328763b7..8dc8f2735d22 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2042,7 +2042,6 @@ static __meminit void init_currently_empty_zone(struct zone *zone,
2042 zone_wait_table_init(zone, size); 2042 zone_wait_table_init(zone, size);
2043 pgdat->nr_zones = zone_idx(zone) + 1; 2043 pgdat->nr_zones = zone_idx(zone) + 1;
2044 2044
2045 zone->zone_mem_map = pfn_to_page(zone_start_pfn);
2046 zone->zone_start_pfn = zone_start_pfn; 2045 zone->zone_start_pfn = zone_start_pfn;
2047 2046
2048 memmap_init(size, pgdat->node_id, zone_idx(zone), zone_start_pfn); 2047 memmap_init(size, pgdat->node_id, zone_idx(zone), zone_start_pfn);
@@ -2768,9 +2767,8 @@ struct page *pfn_to_page(unsigned long pfn)
2768} 2767}
2769unsigned long page_to_pfn(struct page *page) 2768unsigned long page_to_pfn(struct page *page)
2770{ 2769{
2771 struct zone *zone = page_zone(page); 2770 struct pglist_data *pgdat = NODE_DATA(page_to_nid(page));
2772 return (page - zone->zone_mem_map) + zone->zone_start_pfn; 2771 return (page - pgdat->node_mem_map) + pgdat->node_start_pfn;
2773
2774} 2772}
2775#elif defined(CONFIG_SPARSEMEM) 2773#elif defined(CONFIG_SPARSEMEM)
2776struct page *pfn_to_page(unsigned long pfn) 2774struct page *pfn_to_page(unsigned long pfn)