mm: fix build warnings in <linux/compaction.h>

Randy reported below build error.

> In file included from ../include/linux/balloon_compaction.h:48:0,
>                  from ../mm/balloon_compaction.c:11:
> ../include/linux/compaction.h:237:51: warning: 'struct node' declared inside parameter list [enabled by default]
>  static inline int compaction_register_node(struct node *node)
> ../include/linux/compaction.h:237:51: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
> ../include/linux/compaction.h:242:54: warning: 'struct node' declared inside parameter list [enabled by default]
>  static inline void compaction_unregister_node(struct node *node)
>

It was caused by non-lru page migration which needs compaction.h but
compaction.h doesn't include any header to be standalone.

I think proper header for non-lru page migration is migrate.h rather
than compaction.h because migrate.h has already headers needed to work
non-lru page migration indirectly like isolate_mode_t, migrate_mode
MIGRATEPAGE_SUCCESS.

[[email protected]: revert mm-balloon-use-general-non-lru-movable-page-feature-fix.patch temp fix]
Link: http://lkml.kernel.org/r/20160610003304.GE29779@bbox
Signed-off-by: Minchan Kim <[email protected]>
Reported-by: Randy Dunlap <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Gioh Kim <[email protected]>
Cc: Rafael Aquini <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Minchan Kim 2016-07-26 15:26:50 -07:00 • committed by Linus Torvalds
commit dd4123f324
6 changed files with 25 additions and 26 deletions

View file

@ -50,7 +50,7 @@
#include <linux/zsmalloc.h>
#include <linux/zpool.h>
#include <linux/mount.h>
#include <linux/compaction.h>
#include <linux/migrate.h>
#include <linux/pagemap.h>
#define ZSPAGE_MAGIC 0x58
@ -2107,7 +2107,7 @@ int zs_page_migrate(struct address_space *mapping, struct page *newpage,
put_page(page);
page = newpage;
ret = 0;
ret = MIGRATEPAGE_SUCCESS;
unpin_objects:
for (addr = s_addr + offset; addr < s_addr + pos;
addr += class->size) {