From 9fa56006b41e3e7c68e93c8bf359d62d26572303 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Tue, 27 Nov 2012 10:17:24 -0800 Subject: [PATCH] mm: Add is_cma_pageblock definition Bring back the is_cma_pageblock definition for determining if a page is CMA or not. Change-Id: I39fd546e22e240b752244832c79514f109c8e84b Signed-off-by: Laura Abbott Signed-off-by: Mitchel Humpherys --- include/linux/mmzone.h | 2 ++ mm/page_alloc.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 09db7fce668..988df80e921 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -62,9 +62,11 @@ enum { }; #ifdef CONFIG_CMA +bool is_cma_pageblock(struct page *page); # define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) # define cma_wmark_pages(zone) zone->min_cma_pages #else +# define is_cma_pageblock(page) false # define is_migrate_cma(migratetype) false # define cma_wmark_pages(zone) 0 #endif diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 92dd0602a5d..aece028a8e6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -758,6 +758,11 @@ void __meminit __free_pages_bootmem(struct page *page, unsigned int order) } #ifdef CONFIG_CMA +bool is_cma_pageblock(struct page *page) +{ + return get_pageblock_migratetype(page) == MIGRATE_CMA; +} + /* Free whole pageblock and set it's migration type to MIGRATE_CMA. */ void __init init_cma_reserved_pageblock(struct page *page) {