Commit 64dd1b29 authored by Cody P Schafer's avatar Cody P Schafer Committed by Linus Torvalds

mm/memory_hotplug: use ensure_zone_is_initialized()

Remove open coding of ensure_zone_is_initialzied().
Signed-off-by: default avatarCody P Schafer <cody@linux.vnet.ibm.com>
Cc: David Hansen <dave@linux.vnet.ibm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f6bbb78e
...@@ -300,12 +300,9 @@ static int __meminit move_pfn_range_left(struct zone *z1, struct zone *z2, ...@@ -300,12 +300,9 @@ static int __meminit move_pfn_range_left(struct zone *z1, struct zone *z2,
unsigned long flags; unsigned long flags;
unsigned long z1_start_pfn; unsigned long z1_start_pfn;
if (!z1->wait_table) { ret = ensure_zone_is_initialized(z1, start_pfn, end_pfn - start_pfn);
ret = init_currently_empty_zone(z1, start_pfn, if (ret)
end_pfn - start_pfn, MEMMAP_HOTPLUG); return ret;
if (ret)
return ret;
}
pgdat_resize_lock(z1->zone_pgdat, &flags); pgdat_resize_lock(z1->zone_pgdat, &flags);
...@@ -345,12 +342,9 @@ static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2, ...@@ -345,12 +342,9 @@ static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2,
unsigned long flags; unsigned long flags;
unsigned long z2_end_pfn; unsigned long z2_end_pfn;
if (!z2->wait_table) { ret = ensure_zone_is_initialized(z2, start_pfn, end_pfn - start_pfn);
ret = init_currently_empty_zone(z2, start_pfn, if (ret)
end_pfn - start_pfn, MEMMAP_HOTPLUG); return ret;
if (ret)
return ret;
}
pgdat_resize_lock(z1->zone_pgdat, &flags); pgdat_resize_lock(z1->zone_pgdat, &flags);
...@@ -403,16 +397,13 @@ static int __meminit __add_zone(struct zone *zone, unsigned long phys_start_pfn) ...@@ -403,16 +397,13 @@ static int __meminit __add_zone(struct zone *zone, unsigned long phys_start_pfn)
int nid = pgdat->node_id; int nid = pgdat->node_id;
int zone_type; int zone_type;
unsigned long flags; unsigned long flags;
int ret;
zone_type = zone - pgdat->node_zones; zone_type = zone - pgdat->node_zones;
if (!zone->wait_table) { ret = ensure_zone_is_initialized(zone, phys_start_pfn, nr_pages);
int ret; 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); pgdat_resize_lock(zone->zone_pgdat, &flags);
grow_zone_span(zone, phys_start_pfn, phys_start_pfn + nr_pages); grow_zone_span(zone, phys_start_pfn, phys_start_pfn + nr_pages);
grow_pgdat_span(zone->zone_pgdat, phys_start_pfn, grow_pgdat_span(zone->zone_pgdat, phys_start_pfn,
......
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