aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorCody P Schafer <cody@linux.vnet.ibm.com>2013-02-22 19:35:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 20:50:21 -0500
commit64dd1b29bfd76cec0f0db95efa68167d7245dcaf (patch)
tree281f16a4da65b840e6cc58574e86f0afd06030f0 /mm
parentf6bbb78e5bcbe45cfb8ed0d7ecd1549f4eb46a30 (diff)
mm/memory_hotplug: use ensure_zone_is_initialized()
Remove open coding of ensure_zone_is_initialzied(). Signed-off-by: Cody 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory_hotplug.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 6e625f60dbcc..84fdcf5633c3 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -300,12 +300,9 @@ static int __meminit move_pfn_range_left(struct zone *z1, struct zone *z2,
300 unsigned long flags; 300 unsigned long flags;
301 unsigned long z1_start_pfn; 301 unsigned long z1_start_pfn;
302 302
303 if (!z1->wait_table) { 303 ret = ensure_zone_is_initialized(z1, start_pfn, end_pfn - start_pfn);
304 ret = init_currently_empty_zone(z1, start_pfn, 304 if (ret)
305 end_pfn - start_pfn, MEMMAP_HOTPLUG); 305 return ret;
306 if (ret)
307 return ret;
308 }
309 306
310 pgdat_resize_lock(z1->zone_pgdat, &flags); 307 pgdat_resize_lock(z1->zone_pgdat, &flags);
311 308
@@ -345,12 +342,9 @@ static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2,
345 unsigned long flags; 342 unsigned long flags;
346 unsigned long z2_end_pfn; 343 unsigned long z2_end_pfn;
347 344
348 if (!z2->wait_table) { 345 ret = ensure_zone_is_initialized(z2, start_pfn, end_pfn - start_pfn);
349 ret = init_currently_empty_zone(z2, start_pfn, 346 if (ret)
350 end_pfn - start_pfn, MEMMAP_HOTPLUG); 347 return ret;
351 if (ret)
352 return ret;
353 }
354 348
355 pgdat_resize_lock(z1->zone_pgdat, &flags); 349 pgdat_resize_lock(z1->zone_pgdat, &flags);
356 350
@@ -403,16 +397,13 @@ static int __meminit __add_zone(struct zone *zone, unsigned long phys_start_pfn)
403 int nid = pgdat->node_id; 397 int nid = pgdat->node_id;
404 int zone_type; 398 int zone_type;
405 unsigned long flags; 399 unsigned long flags;
400 int ret;
406 401
407 zone_type = zone - pgdat->node_zones; 402 zone_type = zone - pgdat->node_zones;
408 if (!zone->wait_table) { 403 ret = ensure_zone_is_initialized(zone, phys_start_pfn, nr_pages);
409 int ret; 404 if (ret)
405 return ret;
410 406
411 ret = init_currently_empty_zone(zone, phys_start_pfn,
412 nr_pages, MEMMAP_HOTPLUG);
413 if (ret)
414 return ret;
415 }
416 pgdat_resize_lock(zone->zone_pgdat, &flags); 407 pgdat_resize_lock(zone->zone_pgdat, &flags);
417 grow_zone_span(zone, phys_start_pfn, phys_start_pfn + nr_pages); 408 grow_zone_span(zone, phys_start_pfn, phys_start_pfn + nr_pages);
418 grow_pgdat_span(zone->zone_pgdat, phys_start_pfn, 409 grow_pgdat_span(zone->zone_pgdat, phys_start_pfn,