From: Andrew Morton On sparc32: In file included from include/linux/mm.h:38, from include/linux/swap.h:10, from include/linux/suspend.h:7, from init/do_mounts.c:6: include/asm/pgtable.h:348: warning: parameter names (without types) in function declaration include/asm/pgtable.h:349: warning: parameter names (without types) in function declaration include/asm/pgtable.h:350: error: parse error before "___f___swp_entry" include/asm/pgtable.h:350: warning: type defaults to `int' in declaration of `___f___swp_entry' include/asm/pgtable.h:350: warning: data definition has no type or storage class Because swp_entry_t isn't defined yet. Including mm.h from swap.h was a baaaad idea. Create a new swap-prefetch.h, use that. Cc: Con Kolivas Signed-off-by: Andrew Morton --- include/linux/swap-prefetch.h | 55 ++++++++++++++++++++++++++++++++ include/linux/swap.h | 53 ------------------------------ kernel/sysctl.c | 1 mm/swap.c | 1 mm/swap_prefetch.c | 2 + mm/swap_state.c | 1 mm/vmscan.c | 1 7 files changed, 61 insertions(+), 53 deletions(-) diff -puN include/linux/swap.h~mm-implement-swap-prefetching-fix include/linux/swap.h --- 25-sparc/include/linux/swap.h~mm-implement-swap-prefetching-fix 2006-02-28 03:00:21.000000000 -0800 +++ 25-sparc-akpm/include/linux/swap.h 2006-02-28 03:00:21.000000000 -0800 @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -216,58 +215,6 @@ extern int shmem_unuse(swp_entry_t entry extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); -#ifdef CONFIG_SWAP_PREFETCH -/* mm/swap_prefetch.c */ -extern int swap_prefetch; -struct swapped_entry { - swp_entry_t swp_entry; /* The actual swap entry */ - struct list_head swapped_list; /* Linked list of entries */ -#if MAX_NUMNODES > 1 - int node; /* Node id */ -#endif -} __attribute__((packed)); - -static inline void store_swap_entry_node(struct swapped_entry *entry, - struct page *page) -{ -#if MAX_NUMNODES > 1 - entry->node = page_to_nid(page); -#endif -} - -static inline int get_swap_entry_node(struct swapped_entry *entry) -{ -#if MAX_NUMNODES > 1 - return entry->node; -#else - return 0; -#endif -} - -extern void add_to_swapped_list(struct page *page); -extern void remove_from_swapped_list(const unsigned long index); -extern void delay_swap_prefetch(void); -extern void prepare_swap_prefetch(void); - -#else /* CONFIG_SWAP_PREFETCH */ -static inline void add_to_swapped_list(struct page *__unused) -{ -} - -static inline void prepare_swap_prefetch(void) -{ -} - -static inline void remove_from_swapped_list(const unsigned long __unused) -{ -} - -static inline void delay_swap_prefetch(void) -{ -} - -#endif /* CONFIG_SWAP_PREFETCH */ - #ifdef CONFIG_SWAP /* linux/mm/page_io.c */ extern int swap_readpage(struct file *, struct page *); diff -puN /dev/null include/linux/swap-prefetch.h --- /dev/null 2003-09-15 06:40:47.000000000 -0700 +++ 25-sparc-akpm/include/linux/swap-prefetch.h 2006-02-28 03:00:21.000000000 -0800 @@ -0,0 +1,55 @@ +#ifndef SWAP_PREFETCH_H_INCLUDED +#define SWAP_PREFETCH_H_INCLUDED + +#ifdef CONFIG_SWAP_PREFETCH +/* mm/swap_prefetch.c */ +extern int swap_prefetch; +struct swapped_entry { + swp_entry_t swp_entry; /* The actual swap entry */ + struct list_head swapped_list; /* Linked list of entries */ +#if MAX_NUMNODES > 1 + int node; /* Node id */ +#endif +} __attribute__((packed)); + +static inline void store_swap_entry_node(struct swapped_entry *entry, + struct page *page) +{ +#if MAX_NUMNODES > 1 + entry->node = page_to_nid(page); +#endif +} + +static inline int get_swap_entry_node(struct swapped_entry *entry) +{ +#if MAX_NUMNODES > 1 + return entry->node; +#else + return 0; +#endif +} + +extern void add_to_swapped_list(struct page *page); +extern void remove_from_swapped_list(const unsigned long index); +extern void delay_swap_prefetch(void); +extern void prepare_swap_prefetch(void); + +#else /* CONFIG_SWAP_PREFETCH */ +static inline void add_to_swapped_list(struct page *__unused) +{ +} + +static inline void prepare_swap_prefetch(void) +{ +} + +static inline void remove_from_swapped_list(const unsigned long __unused) +{ +} + +static inline void delay_swap_prefetch(void) +{ +} +#endif /* CONFIG_SWAP_PREFETCH */ + +#endif /* SWAP_PREFETCH_H_INCLUDED */ diff -puN mm/swap.c~mm-implement-swap-prefetching-fix mm/swap.c --- 25-sparc/mm/swap.c~mm-implement-swap-prefetching-fix 2006-02-28 03:00:21.000000000 -0800 +++ 25-sparc-akpm/mm/swap.c 2006-02-28 03:00:21.000000000 -0800 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff -puN mm/swap_prefetch.c~mm-implement-swap-prefetching-fix mm/swap_prefetch.c --- 25-sparc/mm/swap_prefetch.c~mm-implement-swap-prefetching-fix 2006-02-28 03:00:21.000000000 -0800 +++ 25-sparc-akpm/mm/swap_prefetch.c 2006-02-28 03:00:21.000000000 -0800 @@ -11,7 +11,9 @@ */ #include +#include #include +#include #include #include #include diff -puN mm/swap_state.c~mm-implement-swap-prefetching-fix mm/swap_state.c --- 25-sparc/mm/swap_state.c~mm-implement-swap-prefetching-fix 2006-02-28 03:00:21.000000000 -0800 +++ 25-sparc-akpm/mm/swap_state.c 2006-02-28 03:00:21.000000000 -0800 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff -puN mm/vmscan.c~mm-implement-swap-prefetching-fix mm/vmscan.c --- 25-sparc/mm/vmscan.c~mm-implement-swap-prefetching-fix 2006-02-28 03:00:21.000000000 -0800 +++ 25-sparc-akpm/mm/vmscan.c 2006-02-28 03:00:21.000000000 -0800 @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff -puN kernel/sysctl.c~mm-implement-swap-prefetching-fix kernel/sysctl.c --- 25-sparc/kernel/sysctl.c~mm-implement-swap-prefetching-fix 2006-02-28 03:04:47.000000000 -0800 +++ 25-sparc-akpm/kernel/sysctl.c 2006-02-28 03:05:08.000000000 -0800 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include _