summaryrefslogtreecommitdiffstats
path: root/include/linux/swap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index d4fcf03b8..66ba5d623 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -1,6 +1,8 @@
#ifndef _LINUX_SWAP_H
#define _LINUX_SWAP_H
+#include <asm/page.h>
+
#define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */
#define SWAP_FLAG_PRIO_MASK 0x7fff
#define SWAP_FLAG_PRIO_SHIFT 0
@@ -26,6 +28,13 @@ union swap_header {
#ifdef __KERNEL__
+/*
+ * Max bad pages in the new format..
+ */
+#define __swapoffset(x) ((unsigned long)&((union swap_header *)0)->x)
+#define MAX_SWAP_BADPAGES \
+ ((__swapoffset(magic.magic) - __swapoffset(info.badpages)) / sizeof(int))
+
#undef DEBUG_SWAP
#include <asm/atomic.h>
@@ -69,12 +78,16 @@ struct sysinfo;
/* linux/ipc/shm.c */
extern int shm_swap (int, int);
+/* linux/mm/swap.c */
+extern void swap_setup (void);
+
/* linux/mm/vmscan.c */
-extern int try_to_free_pages(unsigned int gfp_mask, int count);
+extern int try_to_free_pages(unsigned int gfp_mask);
/* linux/mm/page_io.c */
extern void rw_swap_page(int, unsigned long, char *, int);
extern void rw_swap_page_nocache(int, unsigned long, char *);
+extern void rw_swap_page_nolock(int, unsigned long, char *, int);
extern void swap_after_unlock_page (unsigned long entry);
/* linux/mm/page_alloc.c */
@@ -87,6 +100,7 @@ extern void show_swap_cache_info(void);
extern int add_to_swap_cache(struct page *, unsigned long);
extern int swap_duplicate(unsigned long);
extern int swap_check_entry(unsigned long);
+struct page * lookup_swap_cache(unsigned long);
extern struct page * read_swap_cache_async(unsigned long, int);
#define read_swap_cache(entry) read_swap_cache_async(entry, 1);
extern int FASTCALL(swap_count(unsigned long));
@@ -125,9 +139,7 @@ asmlinkage int sys_swapon(const char *, int);
#ifdef SWAP_CACHE_INFO
extern unsigned long swap_cache_add_total;
-extern unsigned long swap_cache_add_success;
extern unsigned long swap_cache_del_total;
-extern unsigned long swap_cache_del_success;
extern unsigned long swap_cache_find_total;
extern unsigned long swap_cache_find_success;
#endif
@@ -152,12 +164,7 @@ static inline int is_page_shared(struct page *page)
return 1;
count = atomic_read(&page->count);
if (PageSwapCache(page))
- {
- /* PARANOID */
- if (page->inode != &swapper_inode)
- panic("swap cache page has wrong inode\n");
count += swap_count(page->offset) - 2;
- }
if (PageFreeAfter(page))
count--;
return count > 1;