aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCody P Schafer <cody@linux.vnet.ibm.com>2013-02-22 19:35:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 20:50:20 -0500
commit2a6e3ebee2edcade56f836390a5f0c7b76ff5f9e (patch)
tree53005ce7c42e9fad98d9a0dec7a0035f5bb5143c
parent108bcc96ef7047c02cad4d229f04da38186a3f3f (diff)
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 <cody@linux.vnet.ibm.com> Cc: David Hansen <dave@linux.vnet.ibm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/mmzone.h10
1 files changed, 10 insertions, 0 deletions
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)
537 return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone); 537 return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone);
538} 538}
539 539
540static inline bool zone_is_initialized(struct zone *zone)
541{
542 return !!zone->wait_table;
543}
544
545static inline bool zone_is_empty(struct zone *zone)
546{
547 return zone->spanned_pages == 0;
548}
549
540/* 550/*
541 * The "priority" of VM scanning is how much of the queues we will scan in one 551 * The "priority" of VM scanning is how much of the queues we will scan in one
542 * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the 552 * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the