Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: replace PAGE_MIGRATION with IS_ENABLED(CONFIG_MIGRATION)

Since commit 2a11c8ea20bf ("kconfig: Introduce IS_ENABLED(),
IS_BUILTIN() and IS_MODULE()") there is a generic grep-friendly method
for checking config options in C expressions.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Konstantin Khlebnikov and committed by
Linus Torvalds
ce1744f4 092b50ba

+5 -6
-2
include/linux/migrate.h
··· 8 8 typedef struct page *new_page_t(struct page *, unsigned long private, int **); 9 9 10 10 #ifdef CONFIG_MIGRATION 11 - #define PAGE_MIGRATION 1 12 11 13 12 extern void putback_lru_pages(struct list_head *l); 14 13 extern int migrate_page(struct address_space *, ··· 31 32 extern int migrate_huge_page_move_mapping(struct address_space *mapping, 32 33 struct page *newpage, struct page *page); 33 34 #else 34 - #define PAGE_MIGRATION 0 35 35 36 36 static inline void putback_lru_pages(struct list_head *l) {} 37 37 static inline int migrate_pages(struct list_head *l, new_page_t x,
+1 -1
mm/mprotect.c
··· 60 60 ptent = pte_mkwrite(ptent); 61 61 62 62 ptep_modify_prot_commit(mm, addr, pte, ptent); 63 - } else if (PAGE_MIGRATION && !pte_file(oldpte)) { 63 + } else if (IS_ENABLED(CONFIG_MIGRATION) && !pte_file(oldpte)) { 64 64 swp_entry_t entry = pte_to_swp_entry(oldpte); 65 65 66 66 if (is_write_migration_entry(entry)) {
+4 -3
mm/rmap.c
··· 1282 1282 } 1283 1283 dec_mm_counter(mm, MM_ANONPAGES); 1284 1284 inc_mm_counter(mm, MM_SWAPENTS); 1285 - } else if (PAGE_MIGRATION) { 1285 + } else if (IS_ENABLED(CONFIG_MIGRATION)) { 1286 1286 /* 1287 1287 * Store the pfn of the page in a special migration 1288 1288 * pte. do_swap_page() will wait until the migration ··· 1293 1293 } 1294 1294 set_pte_at(mm, address, pte, swp_entry_to_pte(entry)); 1295 1295 BUG_ON(pte_file(*pte)); 1296 - } else if (PAGE_MIGRATION && (TTU_ACTION(flags) == TTU_MIGRATION)) { 1296 + } else if (IS_ENABLED(CONFIG_MIGRATION) && 1297 + (TTU_ACTION(flags) == TTU_MIGRATION)) { 1297 1298 /* Establish migration entry for a file page */ 1298 1299 swp_entry_t entry; 1299 1300 entry = make_migration_entry(page, pte_write(pteval)); ··· 1500 1499 * locking requirements of exec(), migration skips 1501 1500 * temporary VMAs until after exec() completes. 1502 1501 */ 1503 - if (PAGE_MIGRATION && (flags & TTU_MIGRATION) && 1502 + if (IS_ENABLED(CONFIG_MIGRATION) && (flags & TTU_MIGRATION) && 1504 1503 is_vma_temporary_stack(vma)) 1505 1504 continue; 1506 1505