[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>
This commit is contained in:
Con Kolivas
2006-01-06 00:11:15 -08:00
committed by Linus Torvalds
parent 80bfed904c
commit f3fe65122d
3 changed files with 13 additions and 8 deletions

View File

@@ -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);