diff options
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r-- | include/linux/swap.h | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index 2c3ce4c69b25..353153ea0bd5 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #include <linux/mmzone.h> | 6 | #include <linux/mmzone.h> |
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | #include <linux/pagemap.h> | ||
10 | 9 | ||
11 | #include <asm/atomic.h> | 10 | #include <asm/atomic.h> |
12 | #include <asm/page.h> | 11 | #include <asm/page.h> |
@@ -159,9 +158,6 @@ struct swap_list_t { | |||
159 | /* Swap 50% full? Release swapcache more aggressively.. */ | 158 | /* Swap 50% full? Release swapcache more aggressively.. */ |
160 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) | 159 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) |
161 | 160 | ||
162 | /* linux/mm/memory.c */ | ||
163 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); | ||
164 | |||
165 | /* linux/mm/page_alloc.c */ | 161 | /* linux/mm/page_alloc.c */ |
166 | extern unsigned long totalram_pages; | 162 | extern unsigned long totalram_pages; |
167 | extern unsigned long totalreserve_pages; | 163 | extern unsigned long totalreserve_pages; |
@@ -224,16 +220,17 @@ extern struct address_space swapper_space; | |||
224 | #define total_swapcache_pages swapper_space.nrpages | 220 | #define total_swapcache_pages swapper_space.nrpages |
225 | extern void show_swap_cache_info(void); | 221 | extern void show_swap_cache_info(void); |
226 | extern int add_to_swap(struct page *, gfp_t); | 222 | extern int add_to_swap(struct page *, gfp_t); |
223 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); | ||
227 | extern void __delete_from_swap_cache(struct page *); | 224 | extern void __delete_from_swap_cache(struct page *); |
228 | extern void delete_from_swap_cache(struct page *); | 225 | extern void delete_from_swap_cache(struct page *); |
229 | extern int move_to_swap_cache(struct page *, swp_entry_t); | ||
230 | extern int move_from_swap_cache(struct page *, unsigned long, | ||
231 | struct address_space *); | ||
232 | extern void free_page_and_swap_cache(struct page *); | 226 | extern void free_page_and_swap_cache(struct page *); |
233 | extern void free_pages_and_swap_cache(struct page **, int); | 227 | extern void free_pages_and_swap_cache(struct page **, int); |
234 | extern struct page * lookup_swap_cache(swp_entry_t); | 228 | extern struct page *lookup_swap_cache(swp_entry_t); |
235 | extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *vma, | 229 | extern struct page *read_swap_cache_async(swp_entry_t, gfp_t, |
236 | unsigned long addr); | 230 | struct vm_area_struct *vma, unsigned long addr); |
231 | extern struct page *swapin_readahead(swp_entry_t, gfp_t, | ||
232 | struct vm_area_struct *vma, unsigned long addr); | ||
233 | |||
237 | /* linux/mm/swapfile.c */ | 234 | /* linux/mm/swapfile.c */ |
238 | extern long total_swap_pages; | 235 | extern long total_swap_pages; |
239 | extern unsigned int nr_swapfiles; | 236 | extern unsigned int nr_swapfiles; |
@@ -307,7 +304,7 @@ static inline void swap_free(swp_entry_t swp) | |||
307 | { | 304 | { |
308 | } | 305 | } |
309 | 306 | ||
310 | static inline struct page *read_swap_cache_async(swp_entry_t swp, | 307 | static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, |
311 | struct vm_area_struct *vma, unsigned long addr) | 308 | struct vm_area_struct *vma, unsigned long addr) |
312 | { | 309 | { |
313 | return NULL; | 310 | return NULL; |
@@ -318,22 +315,12 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp) | |||
318 | return NULL; | 315 | return NULL; |
319 | } | 316 | } |
320 | 317 | ||
321 | static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset) | ||
322 | { | ||
323 | return 0; | ||
324 | } | ||
325 | |||
326 | #define can_share_swap_page(p) (page_mapcount(p) == 1) | 318 | #define can_share_swap_page(p) (page_mapcount(p) == 1) |
327 | 319 | ||
328 | static inline int move_to_swap_cache(struct page *page, swp_entry_t entry) | 320 | static inline int add_to_swap_cache(struct page *page, swp_entry_t entry, |
329 | { | 321 | gfp_t gfp_mask) |
330 | return 1; | ||
331 | } | ||
332 | |||
333 | static inline int move_from_swap_cache(struct page *page, unsigned long index, | ||
334 | struct address_space *mapping) | ||
335 | { | 322 | { |
336 | return 1; | 323 | return -1; |
337 | } | 324 | } |
338 | 325 | ||
339 | static inline void __delete_from_swap_cache(struct page *page) | 326 | static inline void __delete_from_swap_cache(struct page *page) |