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