diff options
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r-- | include/linux/swap.h | 34 |
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 *)); | |||
167 | extern void FASTCALL(activate_page(struct page *)); | 167 | extern void FASTCALL(activate_page(struct page *)); |
168 | extern void FASTCALL(mark_page_accessed(struct page *)); | 168 | extern void FASTCALL(mark_page_accessed(struct page *)); |
169 | extern void lru_add_drain(void); | 169 | extern void lru_add_drain(void); |
170 | extern int lru_add_drain_all(void); | ||
170 | extern int rotate_reclaimable_page(struct page *page); | 171 | extern int rotate_reclaimable_page(struct page *page); |
171 | extern void swap_setup(void); | 172 | extern void swap_setup(void); |
172 | 173 | ||
173 | /* linux/mm/vmscan.c */ | 174 | /* linux/mm/vmscan.c */ |
174 | extern int try_to_free_pages(struct zone **, gfp_t); | 175 | extern int try_to_free_pages(struct zone **, gfp_t); |
175 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); | ||
176 | extern int shrink_all_memory(int); | 176 | extern int shrink_all_memory(int); |
177 | extern int vm_swappiness; | 177 | extern int vm_swappiness; |
178 | 178 | ||
179 | #ifdef CONFIG_NUMA | ||
180 | extern int zone_reclaim_mode; | ||
181 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); | ||
182 | #else | ||
183 | #define zone_reclaim_mode 0 | ||
184 | static 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 | ||
191 | extern int isolate_lru_page(struct page *p); | ||
192 | extern int putback_lru_pages(struct list_head *l); | ||
193 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
194 | struct list_head *moved, struct list_head *failed); | ||
195 | #else | ||
196 | static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } | ||
197 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | ||
198 | static 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 */ |
181 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 204 | extern 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 *); | |||
193 | extern struct address_space swapper_space; | 216 | extern struct address_space swapper_space; |
194 | #define total_swapcache_pages swapper_space.nrpages | 217 | #define total_swapcache_pages swapper_space.nrpages |
195 | extern void show_swap_cache_info(void); | 218 | extern void show_swap_cache_info(void); |
196 | extern int add_to_swap(struct page *); | 219 | extern int add_to_swap(struct page *, gfp_t); |
197 | extern void __delete_from_swap_cache(struct page *); | 220 | extern void __delete_from_swap_cache(struct page *); |
198 | extern void delete_from_swap_cache(struct page *); | 221 | extern void delete_from_swap_cache(struct page *); |
199 | extern int move_to_swap_cache(struct page *, swp_entry_t); | 222 | extern int move_to_swap_cache(struct page *, swp_entry_t); |
@@ -210,6 +233,7 @@ extern unsigned int nr_swapfiles; | |||
210 | extern struct swap_info_struct swap_info[]; | 233 | extern struct swap_info_struct swap_info[]; |
211 | extern void si_swapinfo(struct sysinfo *); | 234 | extern void si_swapinfo(struct sysinfo *); |
212 | extern swp_entry_t get_swap_page(void); | 235 | extern swp_entry_t get_swap_page(void); |
236 | extern swp_entry_t get_swap_page_of_type(int type); | ||
213 | extern int swap_duplicate(swp_entry_t); | 237 | extern int swap_duplicate(swp_entry_t); |
214 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 238 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
215 | extern void swap_free(swp_entry_t); | 239 | extern 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 | ||
266 | static 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__*/ |