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

mm: fix warnings regarding enum migrate_mode

sparc64 allmodconfig:

In file included from include/linux/compat.h:15,
from /usr/src/25/arch/sparc/include/asm/siginfo.h:19,
from include/linux/signal.h:5,
from include/linux/sched.h:73,
from arch/sparc/kernel/asm-offsets.c:13:
include/linux/fs.h:618: warning: parameter has incomplete type

It seems that my sparc64 compiler (gcc-3.4.5) doesn't like the forward
declaration of enums.

Fix this by moving the "enum migrate_mode" definition into its own header
file.

Acked-by: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Andy Isaacson <adi@hexapodia.org>
Cc: Nai Xia <nai.xia@gmail.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrew Morton and committed by
Linus Torvalds
6536e312 dcd6c922

+18 -14
+1 -1
include/linux/fs.h
··· 10 10 #include <linux/ioctl.h> 11 11 #include <linux/blk_types.h> 12 12 #include <linux/types.h> 13 + #include <linux/migrate_mode.h> 13 14 14 15 /* 15 16 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change ··· 527 526 struct page; 528 527 struct address_space; 529 528 struct writeback_control; 530 - enum migrate_mode; 531 529 532 530 struct iov_iter { 533 531 const struct iovec *iov;
+1 -13
include/linux/migrate.h
··· 3 3 4 4 #include <linux/mm.h> 5 5 #include <linux/mempolicy.h> 6 + #include <linux/migrate_mode.h> 6 7 7 8 typedef struct page *new_page_t(struct page *, unsigned long private, int **); 8 - 9 - /* 10 - * MIGRATE_ASYNC means never block 11 - * MIGRATE_SYNC_LIGHT in the current implementation means to allow blocking 12 - * on most operations but not ->writepage as the potential stall time 13 - * is too significant 14 - * MIGRATE_SYNC will block when migrating pages 15 - */ 16 - enum migrate_mode { 17 - MIGRATE_ASYNC, 18 - MIGRATE_SYNC_LIGHT, 19 - MIGRATE_SYNC, 20 - }; 21 9 22 10 #ifdef CONFIG_MIGRATION 23 11 #define PAGE_MIGRATION 1
+16
include/linux/migrate_mode.h
··· 1 + #ifndef MIGRATE_MODE_H_INCLUDED 2 + #define MIGRATE_MODE_H_INCLUDED 3 + /* 4 + * MIGRATE_ASYNC means never block 5 + * MIGRATE_SYNC_LIGHT in the current implementation means to allow blocking 6 + * on most operations but not ->writepage as the potential stall time 7 + * is too significant 8 + * MIGRATE_SYNC will block when migrating pages 9 + */ 10 + enum migrate_mode { 11 + MIGRATE_ASYNC, 12 + MIGRATE_SYNC_LIGHT, 13 + MIGRATE_SYNC, 14 + }; 15 + 16 + #endif /* MIGRATE_MODE_H_INCLUDED */