include/linux/migrate.h: remove migrate_page #define
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 9 Oct 2014 22:27:59 +0000 (15:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Oct 2014 02:25:56 +0000 (22:25 -0400)
This is designed to avoid a few ifdefs in .c files but it's obnoxious
because it can cause unsuspecting "migrate_page" symbols to get turned into
"NULL".

Just nuke it and use the ifdefs.

Cc: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Cc: Rafael Aquini <aquini@redhat.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/migrate.h
mm/shmem.c
mm/swap_state.c

index a2901c41466433072aa68ee269ae54ab4adc0f2d..b66fd10f4b93ad26ecad2c1b983ec2f695a14f88 100644 (file)
@@ -82,9 +82,6 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
        return -ENOSYS;
 }
 
-/* Possible settings for the migrate_page() method in address_operations */
-#define migrate_page NULL
-
 #endif /* CONFIG_MIGRATION */
 
 #ifdef CONFIG_NUMA_BALANCING
index 469f90d56051984c674f395042029ea737608d5b..4fad61bb41e522053a6c7fd9cea2a04d650361b4 100644 (file)
@@ -3077,7 +3077,9 @@ static const struct address_space_operations shmem_aops = {
        .write_begin    = shmem_write_begin,
        .write_end      = shmem_write_end,
 #endif
+#ifdef CONFIG_MIGRATION
        .migratepage    = migrate_page,
+#endif
        .error_remove_page = generic_error_remove_page,
 };
 
index 3e0ec83d000cdf3f7a65e620dc6696f039dc8d98..ef1f39139b71cb568666989fc98817bd52629b78 100644 (file)
@@ -28,7 +28,9 @@
 static const struct address_space_operations swap_aops = {
        .writepage      = swap_writepage,
        .set_page_dirty = swap_set_page_dirty,
+#ifdef CONFIG_MIGRATION
        .migratepage    = migrate_page,
+#endif
 };
 
 static struct backing_dev_info swap_backing_dev_info = {