summaryrefslogtreecommitdiffstats
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
authorCon Kolivas2006-01-06 09:11:15 +0100
committerLinus Torvalds2006-01-06 17:33:28 +0100
commitf3fe65122da05e1cd4c9140340d96ea2f95d0c49 (patch)
tree65f2bcdb0a9665123b5083d3aea7dae483593cbc /include/linux/mmzone.h
parent[PATCH] consolidate lru_add_drain() and lru_drain_cache() (diff)
downloadkernel-qcow2-linux-f3fe65122da05e1cd4c9140340d96ea2f95d0c49.tar.gz
kernel-qcow2-linux-f3fe65122da05e1cd4c9140340d96ea2f95d0c49.tar.xz
kernel-qcow2-linux-f3fe65122da05e1cd4c9140340d96ea2f95d0c49.zip
[PATCH] mm: add populated_zone() helper
There are numerous places we check whether a zone is populated or not. Provide a helper function to check for populated zones and convert all checks for zone->present_pages. Signed-off-by: Con Kolivas <kernel@kolivas.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 8d6caa414c4c..c34f4a2c62f8 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -388,6 +388,11 @@ static inline struct zone *next_zone(struct zone *zone)
#define for_each_zone(zone) \
for (zone = pgdat_list->node_zones; zone; zone = next_zone(zone))
+static inline int populated_zone(struct zone *zone)
+{
+ return (!!zone->present_pages);
+}
+
static inline int is_highmem_idx(int idx)
{
return (idx == ZONE_HIGHMEM);