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, 32 insertions, 2 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 20c975642cab..4a99e4a7fbf3 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -167,15 +167,38 @@ extern void FASTCALL(lru_cache_add_active(struct page *));
167extern void FASTCALL(activate_page(struct page *)); 167extern void FASTCALL(activate_page(struct page *));
168extern void FASTCALL(mark_page_accessed(struct page *)); 168extern void FASTCALL(mark_page_accessed(struct page *));
169extern void lru_add_drain(void); 169extern void lru_add_drain(void);
170extern int lru_add_drain_all(void);
170extern int rotate_reclaimable_page(struct page *page); 171extern int rotate_reclaimable_page(struct page *page);
171extern void swap_setup(void); 172extern void swap_setup(void);
172 173
173/* linux/mm/vmscan.c */ 174/* linux/mm/vmscan.c */
174extern int try_to_free_pages(struct zone **, gfp_t); 175extern int try_to_free_pages(struct zone **, gfp_t);
175extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
176extern int shrink_all_memory(int); 176extern int shrink_all_memory(int);
177extern int vm_swappiness; 177extern int vm_swappiness;
178 178
179#ifdef CONFIG_NUMA
180extern int zone_reclaim_mode;
181extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
182#else
183#define zone_reclaim_mode 0
184static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order)
185{
186 return 0;
187}
188#endif
189
190#ifdef CONFIG_MIGRATION
191extern int isolate_lru_page(struct page *p);
192extern int putback_lru_pages(struct list_head *l);
193extern int migrate_pages(struct list_head *l, struct list_head *t,
194 struct list_head *moved, struct list_head *failed);
195#else
196static inline int isolate_lru_page(struct page *p) { return -ENOSYS; }
197static inline int putback_lru_pages(struct list_head *l) { return 0; }
198static inline int migrate_pages(struct list_head *l, struct list_head *t,
199 struct list_head *moved, struct list_head *failed) { return -ENOSYS; }
200#endif
201
179#ifdef CONFIG_MMU 202#ifdef CONFIG_MMU
180/* linux/mm/shmem.c */ 203/* linux/mm/shmem.c */
181extern int shmem_unuse(swp_entry_t entry, struct page *page); 204extern int shmem_unuse(swp_entry_t entry, struct page *page);
@@ -193,7 +216,7 @@ extern int rw_swap_page_sync(int, swp_entry_t, struct page *);
193extern struct address_space swapper_space; 216extern struct address_space swapper_space;
194#define total_swapcache_pages swapper_space.nrpages 217#define total_swapcache_pages swapper_space.nrpages
195extern void show_swap_cache_info(void); 218extern void show_swap_cache_info(void);
196extern int add_to_swap(struct page *); 219extern int add_to_swap(struct page *, gfp_t);
197extern void __delete_from_swap_cache(struct page *); 220extern void __delete_from_swap_cache(struct page *);
198extern void delete_from_swap_cache(struct page *); 221extern void delete_from_swap_cache(struct page *);
199extern int move_to_swap_cache(struct page *, swp_entry_t); 222extern int move_to_swap_cache(struct page *, swp_entry_t);
@@ -210,6 +233,7 @@ extern unsigned int nr_swapfiles;
210extern struct swap_info_struct swap_info[]; 233extern struct swap_info_struct swap_info[];
211extern void si_swapinfo(struct sysinfo *); 234extern void si_swapinfo(struct sysinfo *);
212extern swp_entry_t get_swap_page(void); 235extern swp_entry_t get_swap_page(void);
236extern swp_entry_t get_swap_page_of_type(int type);
213extern int swap_duplicate(swp_entry_t); 237extern int swap_duplicate(swp_entry_t);
214extern int valid_swaphandles(swp_entry_t, unsigned long *); 238extern int valid_swaphandles(swp_entry_t, unsigned long *);
215extern void swap_free(swp_entry_t); 239extern void swap_free(swp_entry_t);
@@ -239,6 +263,11 @@ static inline void put_swap_token(struct mm_struct *mm)
239 __put_swap_token(mm); 263 __put_swap_token(mm);
240} 264}
241 265
266static inline void disable_swap_token(void)
267{
268 put_swap_token(swap_token_mm);
269}
270
242#else /* CONFIG_SWAP */ 271#else /* CONFIG_SWAP */
243 272
244#define total_swap_pages 0 273#define total_swap_pages 0
@@ -283,6 +312,7 @@ static inline swp_entry_t get_swap_page(void)
283#define put_swap_token(x) do { } while(0) 312#define put_swap_token(x) do { } while(0)
284#define grab_swap_token() do { } while(0) 313#define grab_swap_token() do { } while(0)
285#define has_swap_token(x) 0 314#define has_swap_token(x) 0
315#define disable_swap_token() do { } while(0)
286 316
287#endif /* CONFIG_SWAP */ 317#endif /* CONFIG_SWAP */
288#endif /* __KERNEL__*/ 318#endif /* __KERNEL__*/