diff options
Diffstat (limited to 'include/linux/swap.h')
| -rw-r--r-- | include/linux/swap.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index 2fee51a11b73..eba53e71d2cc 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -19,6 +19,7 @@ struct bio; | |||
| 19 | #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ | 19 | #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ |
| 20 | #define SWAP_FLAG_PRIO_MASK 0x7fff | 20 | #define SWAP_FLAG_PRIO_MASK 0x7fff |
| 21 | #define SWAP_FLAG_PRIO_SHIFT 0 | 21 | #define SWAP_FLAG_PRIO_SHIFT 0 |
| 22 | #define SWAP_FLAG_DISCARD 0x10000 /* discard swap cluster after use */ | ||
| 22 | 23 | ||
| 23 | static inline int current_is_kswapd(void) | 24 | static inline int current_is_kswapd(void) |
| 24 | { | 25 | { |
| @@ -142,7 +143,7 @@ struct swap_extent { | |||
| 142 | enum { | 143 | enum { |
| 143 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ | 144 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ |
| 144 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ | 145 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ |
| 145 | SWP_DISCARDABLE = (1 << 2), /* blkdev supports discard */ | 146 | SWP_DISCARDABLE = (1 << 2), /* swapon+blkdev support discard */ |
| 146 | SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ | 147 | SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ |
| 147 | SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ | 148 | SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ |
| 148 | SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ | 149 | SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ |
| @@ -270,8 +271,18 @@ extern void scan_mapping_unevictable_pages(struct address_space *); | |||
| 270 | extern unsigned long scan_unevictable_pages; | 271 | extern unsigned long scan_unevictable_pages; |
| 271 | extern int scan_unevictable_handler(struct ctl_table *, int, | 272 | extern int scan_unevictable_handler(struct ctl_table *, int, |
| 272 | void __user *, size_t *, loff_t *); | 273 | void __user *, size_t *, loff_t *); |
| 274 | #ifdef CONFIG_NUMA | ||
| 273 | extern int scan_unevictable_register_node(struct node *node); | 275 | extern int scan_unevictable_register_node(struct node *node); |
| 274 | extern void scan_unevictable_unregister_node(struct node *node); | 276 | extern void scan_unevictable_unregister_node(struct node *node); |
| 277 | #else | ||
| 278 | static inline int scan_unevictable_register_node(struct node *node) | ||
| 279 | { | ||
| 280 | return 0; | ||
| 281 | } | ||
| 282 | static inline void scan_unevictable_unregister_node(struct node *node) | ||
| 283 | { | ||
| 284 | } | ||
| 285 | #endif | ||
| 275 | 286 | ||
| 276 | extern int kswapd_run(int nid); | 287 | extern int kswapd_run(int nid); |
| 277 | extern void kswapd_stop(int nid); | 288 | extern void kswapd_stop(int nid); |
| @@ -315,6 +326,7 @@ extern long nr_swap_pages; | |||
| 315 | extern long total_swap_pages; | 326 | extern long total_swap_pages; |
| 316 | extern void si_swapinfo(struct sysinfo *); | 327 | extern void si_swapinfo(struct sysinfo *); |
| 317 | extern swp_entry_t get_swap_page(void); | 328 | extern swp_entry_t get_swap_page(void); |
| 329 | extern swp_entry_t get_swap_page_of_type(int); | ||
| 318 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 330 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
| 319 | extern int add_swap_count_continuation(swp_entry_t, gfp_t); | 331 | extern int add_swap_count_continuation(swp_entry_t, gfp_t); |
| 320 | extern void swap_shmem_alloc(swp_entry_t); | 332 | extern void swap_shmem_alloc(swp_entry_t); |
| @@ -331,13 +343,6 @@ extern int reuse_swap_page(struct page *); | |||
| 331 | extern int try_to_free_swap(struct page *); | 343 | extern int try_to_free_swap(struct page *); |
| 332 | struct backing_dev_info; | 344 | struct backing_dev_info; |
| 333 | 345 | ||
| 334 | #ifdef CONFIG_HIBERNATION | ||
| 335 | void hibernation_freeze_swap(void); | ||
| 336 | void hibernation_thaw_swap(void); | ||
| 337 | swp_entry_t get_swap_for_hibernation(int type); | ||
| 338 | void swap_free_for_hibernation(swp_entry_t val); | ||
| 339 | #endif | ||
| 340 | |||
| 341 | /* linux/mm/thrash.c */ | 346 | /* linux/mm/thrash.c */ |
| 342 | extern struct mm_struct *swap_token_mm; | 347 | extern struct mm_struct *swap_token_mm; |
| 343 | extern void grab_swap_token(struct mm_struct *); | 348 | extern void grab_swap_token(struct mm_struct *); |
