linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: is_dma_zone
@ 2005-11-17 13:59 Con Kolivas
  2005-11-17 14:15 ` Dave Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Con Kolivas @ 2005-11-17 13:59 UTC (permalink / raw)
  To: linux-mm; +Cc: linux kernel mailing list, Andrew Morton

Add a simple is_dma helper function to remain consistent with respect to
avoiding the use of ZONE_* outside the headers.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

 include/linux/mmzone.h |    5 +++++
 mm/swap_prefetch.c     |    2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

---

Index: linux-2.6.14-mm2/include/linux/mmzone.h
===================================================================
--- linux-2.6.14-mm2.orig/include/linux/mmzone.h
+++ linux-2.6.14-mm2/include/linux/mmzone.h
@@ -425,6 +425,11 @@ static inline int is_normal(struct zone 
 	return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL;
 }
 
+static inline int is_dma(struct zone *zone)
+{
+	return zone == zone->zone_pgdat->node_zones + ZONE_DMA;
+}
+
 /* These two functions are used to setup the per zone pages min values */
 struct ctl_table;
 struct file;
Index: linux-2.6.14-mm2/mm/swap_prefetch.c
===================================================================
--- linux-2.6.14-mm2.orig/mm/swap_prefetch.c
+++ linux-2.6.14-mm2/mm/swap_prefetch.c
@@ -180,7 +180,7 @@ static struct page *prefetch_get_page(vo
 			continue;
 
 		/* We don't prefetch into DMA */
-		if (zone_idx(z) == ZONE_DMA)
+		if (is_dma(z))
 			continue;
 
 		free = z->free_pages;

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-17 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-17 13:59 [PATCH] mm: is_dma_zone Con Kolivas
2005-11-17 14:15 ` Dave Hansen
2005-11-17 14:19   ` Con Kolivas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox