]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - include/linux/mmzone.h
mm: introduce for_each_populated_zone() macro
[mirror_ubuntu-zesty-kernel.git] / include / linux / mmzone.h
index 1aca6cebbb78916aaeb4764b3ec7e7da3276cf91..26ef24076b76a391e94fb395dfc3c820da545155 100644 (file)
@@ -806,6 +806,14 @@ extern struct zone *next_zone(struct zone *zone);
             zone;                                      \
             zone = next_zone(zone))
 
+#define for_each_populated_zone(zone)                  \
+       for (zone = (first_online_pgdat())->node_zones; \
+            zone;                                      \
+            zone = next_zone(zone))                    \
+               if (!populated_zone(zone))              \
+                       ; /* do nothing */              \
+               else
+
 static inline struct zone *zonelist_zone(struct zoneref *zoneref)
 {
        return zoneref->zone;