aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Yanfei <zhangyanfei@cn.fujitsu.com>2013-07-08 19:00:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 13:33:22 -0400
commitbc732f1d55cf41627ee4c64078812b2fa592b394 (patch)
treef4d2f8e9326e47db3d9e02e6399c433d8d411f0f
parent0cf31ec10e92253e2908cd830145a71043740d77 (diff)
mm/page_alloc.c: remove zone_type argument of build_zonelists_node
The callers of build_zonelists_node always pass MAX_NR_ZONES -1 as the zone_type argument, so we can directly use the value in build_zonelists_node and remove zone_type argument. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/page_alloc.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7d5e40fe0c29..27f9d4beac98 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3153,12 +3153,10 @@ static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref)
3153 * Add all populated zones of a node to the zonelist. 3153 * Add all populated zones of a node to the zonelist.
3154 */ 3154 */
3155static int build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist, 3155static int build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist,
3156 int nr_zones, enum zone_type zone_type) 3156 int nr_zones)
3157{ 3157{
3158 struct zone *zone; 3158 struct zone *zone;
3159 3159 enum zone_type zone_type = MAX_NR_ZONES;
3160 BUG_ON(zone_type >= MAX_NR_ZONES);
3161 zone_type++;
3162 3160
3163 do { 3161 do {
3164 zone_type--; 3162 zone_type--;
@@ -3168,8 +3166,8 @@ static int build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist,
3168 &zonelist->_zonerefs[nr_zones++]); 3166 &zonelist->_zonerefs[nr_zones++]);
3169 check_highest_zone(zone_type); 3167 check_highest_zone(zone_type);
3170 } 3168 }
3171
3172 } while (zone_type); 3169 } while (zone_type);
3170
3173 return nr_zones; 3171 return nr_zones;
3174} 3172}
3175 3173
@@ -3363,8 +3361,7 @@ static void build_zonelists_in_node_order(pg_data_t *pgdat, int node)
3363 zonelist = &pgdat->node_zonelists[0]; 3361 zonelist = &pgdat->node_zonelists[0];
3364 for (j = 0; zonelist->_zonerefs[j].zone != NULL; j++) 3362 for (j = 0; zonelist->_zonerefs[j].zone != NULL; j++)
3365 ; 3363 ;
3366 j = build_zonelists_node(NODE_DATA(node), zonelist, j, 3364 j = build_zonelists_node(NODE_DATA(node), zonelist, j);
3367 MAX_NR_ZONES - 1);
3368 zonelist->_zonerefs[j].zone = NULL; 3365 zonelist->_zonerefs[j].zone = NULL;
3369 zonelist->_zonerefs[j].zone_idx = 0; 3366 zonelist->_zonerefs[j].zone_idx = 0;
3370} 3367}
@@ -3378,7 +3375,7 @@ static void build_thisnode_zonelists(pg_data_t *pgdat)
3378 struct zonelist *zonelist; 3375 struct zonelist *zonelist;
3379 3376
3380 zonelist = &pgdat->node_zonelists[1]; 3377 zonelist = &pgdat->node_zonelists[1];
3381 j = build_zonelists_node(pgdat, zonelist, 0, MAX_NR_ZONES - 1); 3378 j = build_zonelists_node(pgdat, zonelist, 0);
3382 zonelist->_zonerefs[j].zone = NULL; 3379 zonelist->_zonerefs[j].zone = NULL;
3383 zonelist->_zonerefs[j].zone_idx = 0; 3380 zonelist->_zonerefs[j].zone_idx = 0;
3384} 3381}
@@ -3586,7 +3583,7 @@ static void build_zonelists(pg_data_t *pgdat)
3586 local_node = pgdat->node_id; 3583 local_node = pgdat->node_id;
3587 3584
3588 zonelist = &pgdat->node_zonelists[0]; 3585 zonelist = &pgdat->node_zonelists[0];
3589 j = build_zonelists_node(pgdat, zonelist, 0, MAX_NR_ZONES - 1); 3586 j = build_zonelists_node(pgdat, zonelist, 0);
3590 3587
3591 /* 3588 /*
3592 * Now we build the zonelist so that it contains the zones 3589 * Now we build the zonelist so that it contains the zones
@@ -3599,14 +3596,12 @@ static void build_zonelists(pg_data_t *pgdat)
3599 for (node = local_node + 1; node < MAX_NUMNODES; node++) { 3596 for (node = local_node + 1; node < MAX_NUMNODES; node++) {
3600 if (!node_online(node)) 3597 if (!node_online(node))
3601 continue; 3598 continue;
3602 j = build_zonelists_node(NODE_DATA(node), zonelist, j, 3599 j = build_zonelists_node(NODE_DATA(node), zonelist, j);
3603 MAX_NR_ZONES - 1);
3604 } 3600 }
3605 for (node = 0; node < local_node; node++) { 3601 for (node = 0; node < local_node; node++) {
3606 if (!node_online(node)) 3602 if (!node_online(node))
3607 continue; 3603 continue;
3608 j = build_zonelists_node(NODE_DATA(node), zonelist, j, 3604 j = build_zonelists_node(NODE_DATA(node), zonelist, j);
3609 MAX_NR_ZONES - 1);
3610 } 3605 }
3611 3606
3612 zonelist->_zonerefs[j].zone = NULL; 3607 zonelist->_zonerefs[j].zone = NULL;