aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaura Abbott <labbott@redhat.com>2016-07-19 18:00:04 -0400
committerKees Cook <keescook@chromium.org>2016-07-26 17:41:46 -0400
commit7c15d9bb8231f998ae7dc0b72415f5215459f7fb (patch)
tree1e94e7b8dfd0ff09928860d83af6b3492a158472
parent523d939ef98fd712632d93a5a2b588e477a7565e (diff)
mm: Add is_migrate_cma_page
Code such as hardened user copy[1] needs a way to tell if a page is CMA or not. Add is_migrate_cma_page in a similar way to is_migrate_isolate_page. [1]http://article.gmane.org/gmane.linux.kernel.mm/155238 Signed-off-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r--include/linux/mmzone.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 02069c23486d..c8478b29f070 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -68,8 +68,10 @@ extern char * const migratetype_names[MIGRATE_TYPES];
68 68
69#ifdef CONFIG_CMA 69#ifdef CONFIG_CMA
70# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) 70# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA)
71# define is_migrate_cma_page(_page) (get_pageblock_migratetype(_page) == MIGRATE_CMA)
71#else 72#else
72# define is_migrate_cma(migratetype) false 73# define is_migrate_cma(migratetype) false
74# define is_migrate_cma_page(_page) false
73#endif 75#endif
74 76
75#define for_each_migratetype_order(order, type) \ 77#define for_each_migratetype_order(order, type) \