From: Cody P Schafer Date: Thu, 7 Feb 2013 01:27:05 +0000 (+1100) Subject: mm: add zone_is_empty() and zone_is_initialized() X-Git-Tag: next-20130218~1^2~333 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=634d0b2d3681520b3b685d6663e9b14804798661;p=karo-tx-linux.git mm: add zone_is_empty() and zone_is_initialized() Factoring out these 2 checks makes it more clear what we are actually checking for. Signed-off-by: Cody P Schafer Cc: David Hansen Cc: Catalin Marinas Cc: Johannes Weiner Cc: Mel Gorman Signed-off-by: Andrew Morton --- diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 34343f51e211..cf8925962b68 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -537,6 +537,16 @@ static inline bool zone_spans_pfn(const struct zone *zone, unsigned long pfn) return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone); } +static inline bool zone_is_initialized(struct zone *zone) +{ + return !!zone->wait_table; +} + +static inline bool zone_is_empty(struct zone *zone) +{ + return zone->spanned_pages == 0; +} + /* * The "priority" of VM scanning is how much of the queues we will scan in one * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the