Skip to content

Commit 7c15d9b

Browse files
labbottkees
authored andcommitted
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 <[email protected]> Signed-off-by: Kees Cook <[email protected]>
1 parent 523d939 commit 7c15d9b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/linux/mmzone.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ extern char * const migratetype_names[MIGRATE_TYPES];
6868

6969
#ifdef CONFIG_CMA
7070
# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA)
71+
# define is_migrate_cma_page(_page) (get_pageblock_migratetype(_page) == MIGRATE_CMA)
7172
#else
7273
# define is_migrate_cma(migratetype) false
74+
# define is_migrate_cma_page(_page) false
7375
#endif
7476

7577
#define for_each_migratetype_order(order, type) \

0 commit comments

Comments
 (0)