Skip to content

Commit

Permalink
include/linux/migrate.h: remove migrate_page #define
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Rafael Aquini <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Mel Gorman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and torvalds committed Oct 10, 2014
1 parent dd6eecb commit 1c93923
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions include/linux/migrate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
2 changes: 2 additions & 0 deletions mm/swap_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 1c93923

Please sign in to comment.