From: Adrian Bunk <bunk@fs.tum.de>

This breaks compilation with CONFIG_SWAP=n:

The bug is obvious:

Additional, the dummy grab_swap_token and has_swap_token weren't 
correct.

Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/linux/swap.h |   43 +++++++++++++++++++++----------------------
 1 files changed, 21 insertions(+), 22 deletions(-)

diff -puN include/linux/swap.h~token-based-load-control-no-swap-build-fix include/linux/swap.h
--- 25/include/linux/swap.h~token-based-load-control-no-swap-build-fix	Mon Aug  2 16:19:36 2004
+++ 25-akpm/include/linux/swap.h	Mon Aug  2 16:19:36 2004
@@ -204,28 +204,6 @@ extern void free_pages_and_swap_cache(st
 extern struct page * lookup_swap_cache(swp_entry_t);
 extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *vma,
 					   unsigned long addr);
-/* linux/mm/thrash.c */
-#ifdef CONFIG_SWAP
-extern struct mm_struct * swap_token_mm;
-extern void grab_swap_token(void);
-extern void __put_swap_token(struct mm_struct *);
-
-static inline int has_swap_token(struct mm_struct *mm)
-{
-	return (mm == swap_token_mm);
-}
-
-static inline void put_swap_token(struct mm_struct *mm)
-{
-	if (has_swap_token(mm))
-		__put_swap_token(mm);
-}
-#else /* CONFIG_SWAP */
-#define put_swap_token(x) do { } while(0)
-#define grab_swap_token  do { } while(0)
-#define has_swap_token 0
-#endif /* CONFIG_SWAP */
-
 /* linux/mm/swapfile.c */
 extern long total_swap_pages;
 extern unsigned int nr_swapfiles;
@@ -250,6 +228,22 @@ extern spinlock_t swaplock;
 #define swap_device_lock(p)	spin_lock(&p->sdev_lock)
 #define swap_device_unlock(p)	spin_unlock(&p->sdev_lock)
 
+/* linux/mm/thrash.c */
+extern struct mm_struct * swap_token_mm;
+extern void grab_swap_token(void);
+extern void __put_swap_token(struct mm_struct *);
+
+static inline int has_swap_token(struct mm_struct *mm)
+{
+	return (mm == swap_token_mm);
+}
+
+static inline void put_swap_token(struct mm_struct *mm)
+{
+	if (has_swap_token(mm))
+		__put_swap_token(mm);
+}
+
 #else /* CONFIG_SWAP */
 
 #define total_swap_pages			0
@@ -287,6 +281,11 @@ static inline swp_entry_t get_swap_page(
 	return entry;
 }
 
+/* linux/mm/thrash.c */
+#define put_swap_token(x) do { } while(0)
+#define grab_swap_token()  do { } while(0)
+#define has_swap_token(x) 0
+
 #endif /* CONFIG_SWAP */
 #endif /* __KERNEL__*/
 #endif /* _LINUX_SWAP_H */
_