From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx102.postini.com [74.125.245.102]) by kanga.kvack.org (Postfix) with SMTP id 3738F6B0009 for ; Thu, 17 Jan 2013 17:54:13 -0500 (EST) Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 Jan 2013 17:54:11 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 876626E8055 for ; Thu, 17 Jan 2013 17:54:08 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0HMs9JS324712 for ; Thu, 17 Jan 2013 17:54:09 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0HMs9Sr011492 for ; Thu, 17 Jan 2013 17:54:09 -0500 From: Cody P Schafer Subject: [PATCH 3/9] mm: add zone_is_empty() and zone_is_initialized() Date: Thu, 17 Jan 2013 14:52:55 -0800 Message-Id: <1358463181-17956-4-git-send-email-cody@linux.vnet.ibm.com> In-Reply-To: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> References: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Linux MM , David Hansen Cc: LKML , Andrew Morton , Catalin Marinas , Cody P Schafer Factoring out these 2 checks makes it more clear what we are actually checking for. Signed-off-by: Cody P Schafer --- include/linux/mmzone.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d91d964..696cb7c 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -553,6 +553,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 -- 1.8.0.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org