summaryrefslogtreecommitdiffstats
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
authorYaowei Bai <baiyaowei@cmss.chinamobile.com>2016-01-14 18:19:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 19:00:49 -0500
commitc00eb15a8914b8ba84032a36044a5aaf7f71709d (patch)
treedf9fd900dac20444f5e5b6780dba9b95a1bc7515 /include/linux/mmzone.h
parent06640290bfc6688062387f915c5df094e9872133 (diff)
mm/zonelist: enumerate zonelists array index
Hardcoding index to zonelists array in gfp_zonelist() is not a good idea, let's enumerate it to improve readability. No functional change. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: fix CONFIG_NUMA=n build] [n-horiguchi@ah.jp.nec.com: fix warning in comparing enumerator] Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com> Cc: Michal Hocko <mhocko@kernel.org> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 996384672c73..12c98dfc31b1 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -571,19 +571,17 @@ static inline bool zone_is_empty(struct zone *zone)
571/* Maximum number of zones on a zonelist */ 571/* Maximum number of zones on a zonelist */
572#define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES) 572#define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES)
573 573
574enum {
575 ZONELIST_FALLBACK, /* zonelist with fallback */
574#ifdef CONFIG_NUMA 576#ifdef CONFIG_NUMA
575 577 /*
576/* 578 * The NUMA zonelists are doubled because we need zonelists that
577 * The NUMA zonelists are doubled because we need zonelists that restrict the 579 * restrict the allocations to a single node for __GFP_THISNODE.
578 * allocations to a single node for __GFP_THISNODE. 580 */
579 * 581 ZONELIST_NOFALLBACK, /* zonelist without fallback (__GFP_THISNODE) */
580 * [0] : Zonelist with fallback
581 * [1] : No fallback (__GFP_THISNODE)
582 */
583#define MAX_ZONELISTS 2
584#else
585#define MAX_ZONELISTS 1
586#endif 582#endif
583 MAX_ZONELISTS
584};
587 585
588/* 586/*
589 * This struct contains information about a zone in a zonelist. It is stored 587 * This struct contains information about a zone in a zonelist. It is stored