Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
[deliverable/linux.git] / mm / memory_hotplug.c
index 6e625f60dbcc2d1e4937ddbe51f42a46971cfb05..b81a367b9f39bb056cc4127a674e8a3dd4d2567d 100644 (file)
@@ -218,7 +218,7 @@ void register_page_bootmem_info_node(struct pglist_data *pgdat)
        }
 
        pfn = pgdat->node_start_pfn;
-       end_pfn = pfn + pgdat->node_spanned_pages;
+       end_pfn = pgdat_end_pfn(pgdat);
 
        /* register_section info */
        for (; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
@@ -300,12 +300,9 @@ static int __meminit move_pfn_range_left(struct zone *z1, struct zone *z2,
        unsigned long flags;
        unsigned long z1_start_pfn;
 
-       if (!z1->wait_table) {
-               ret = init_currently_empty_zone(z1, start_pfn,
-                       end_pfn - start_pfn, MEMMAP_HOTPLUG);
-               if (ret)
-                       return ret;
-       }
+       ret = ensure_zone_is_initialized(z1, start_pfn, end_pfn - start_pfn);
+       if (ret)
+               return ret;
 
        pgdat_resize_lock(z1->zone_pgdat, &flags);
 
@@ -345,12 +342,9 @@ static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2,
        unsigned long flags;
        unsigned long z2_end_pfn;
 
-       if (!z2->wait_table) {
-               ret = init_currently_empty_zone(z2, start_pfn,
-                       end_pfn - start_pfn, MEMMAP_HOTPLUG);
-               if (ret)
-                       return ret;
-       }
+       ret = ensure_zone_is_initialized(z2, start_pfn, end_pfn - start_pfn);
+       if (ret)
+               return ret;
 
        pgdat_resize_lock(z1->zone_pgdat, &flags);
 
@@ -403,16 +397,13 @@ static int __meminit __add_zone(struct zone *zone, unsigned long phys_start_pfn)
        int nid = pgdat->node_id;
        int zone_type;
        unsigned long flags;
+       int ret;
 
        zone_type = zone - pgdat->node_zones;
-       if (!zone->wait_table) {
-               int ret;
+       ret = ensure_zone_is_initialized(zone, phys_start_pfn, nr_pages);
+       if (ret)
+               return ret;
 
-               ret = init_currently_empty_zone(zone, phys_start_pfn,
-                                               nr_pages, MEMMAP_HOTPLUG);
-               if (ret)
-                       return ret;
-       }
        pgdat_resize_lock(zone->zone_pgdat, &flags);
        grow_zone_span(zone, phys_start_pfn, phys_start_pfn + nr_pages);
        grow_pgdat_span(zone->zone_pgdat, phys_start_pfn,
This page took 0.027485 seconds and 5 git commands to generate.