diff options
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r-- | include/linux/swap.h | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index d476aad3ff57..0cedf31af0b0 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -129,9 +129,10 @@ enum { | |||
129 | 129 | ||
130 | #define SWAP_CLUSTER_MAX 32 | 130 | #define SWAP_CLUSTER_MAX 32 |
131 | 131 | ||
132 | #define SWAP_MAP_MAX 0x7fff | 132 | #define SWAP_MAP_MAX 0x7ffe |
133 | #define SWAP_MAP_BAD 0x8000 | 133 | #define SWAP_MAP_BAD 0x7fff |
134 | 134 | #define SWAP_HAS_CACHE 0x8000 /* There is a swap cache of entry. */ | |
135 | #define SWAP_COUNT_MASK (~SWAP_HAS_CACHE) | ||
135 | /* | 136 | /* |
136 | * The in-memory structure used to track swap areas. | 137 | * The in-memory structure used to track swap areas. |
137 | */ | 138 | */ |
@@ -235,7 +236,6 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
235 | } | 236 | } |
236 | #endif | 237 | #endif |
237 | 238 | ||
238 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
239 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); | 239 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); |
240 | extern void scan_mapping_unevictable_pages(struct address_space *); | 240 | extern void scan_mapping_unevictable_pages(struct address_space *); |
241 | 241 | ||
@@ -244,24 +244,6 @@ extern int scan_unevictable_handler(struct ctl_table *, int, struct file *, | |||
244 | void __user *, size_t *, loff_t *); | 244 | void __user *, size_t *, loff_t *); |
245 | extern int scan_unevictable_register_node(struct node *node); | 245 | extern int scan_unevictable_register_node(struct node *node); |
246 | extern void scan_unevictable_unregister_node(struct node *node); | 246 | extern void scan_unevictable_unregister_node(struct node *node); |
247 | #else | ||
248 | static inline int page_evictable(struct page *page, | ||
249 | struct vm_area_struct *vma) | ||
250 | { | ||
251 | return 1; | ||
252 | } | ||
253 | |||
254 | static inline void scan_mapping_unevictable_pages(struct address_space *mapping) | ||
255 | { | ||
256 | } | ||
257 | |||
258 | static inline int scan_unevictable_register_node(struct node *node) | ||
259 | { | ||
260 | return 0; | ||
261 | } | ||
262 | |||
263 | static inline void scan_unevictable_unregister_node(struct node *node) { } | ||
264 | #endif | ||
265 | 247 | ||
266 | extern int kswapd_run(int nid); | 248 | extern int kswapd_run(int nid); |
267 | 249 | ||
@@ -274,7 +256,7 @@ extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); | |||
274 | 256 | ||
275 | #ifdef CONFIG_SWAP | 257 | #ifdef CONFIG_SWAP |
276 | /* linux/mm/page_io.c */ | 258 | /* linux/mm/page_io.c */ |
277 | extern int swap_readpage(struct file *, struct page *); | 259 | extern int swap_readpage(struct page *); |
278 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); | 260 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); |
279 | extern void end_swap_bio_read(struct bio *bio, int err); | 261 | extern void end_swap_bio_read(struct bio *bio, int err); |
280 | 262 | ||
@@ -300,9 +282,11 @@ extern long total_swap_pages; | |||
300 | extern void si_swapinfo(struct sysinfo *); | 282 | extern void si_swapinfo(struct sysinfo *); |
301 | extern swp_entry_t get_swap_page(void); | 283 | extern swp_entry_t get_swap_page(void); |
302 | extern swp_entry_t get_swap_page_of_type(int); | 284 | extern swp_entry_t get_swap_page_of_type(int); |
303 | extern int swap_duplicate(swp_entry_t); | 285 | extern void swap_duplicate(swp_entry_t); |
286 | extern int swapcache_prepare(swp_entry_t); | ||
304 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 287 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
305 | extern void swap_free(swp_entry_t); | 288 | extern void swap_free(swp_entry_t); |
289 | extern void swapcache_free(swp_entry_t, struct page *page); | ||
306 | extern int free_swap_and_cache(swp_entry_t); | 290 | extern int free_swap_and_cache(swp_entry_t); |
307 | extern int swap_type_of(dev_t, sector_t, struct block_device **); | 291 | extern int swap_type_of(dev_t, sector_t, struct block_device **); |
308 | extern unsigned int count_swap_pages(int, int); | 292 | extern unsigned int count_swap_pages(int, int); |
@@ -370,12 +354,20 @@ static inline void show_swap_cache_info(void) | |||
370 | } | 354 | } |
371 | 355 | ||
372 | #define free_swap_and_cache(swp) is_migration_entry(swp) | 356 | #define free_swap_and_cache(swp) is_migration_entry(swp) |
373 | #define swap_duplicate(swp) is_migration_entry(swp) | 357 | #define swapcache_prepare(swp) is_migration_entry(swp) |
358 | |||
359 | static inline void swap_duplicate(swp_entry_t swp) | ||
360 | { | ||
361 | } | ||
374 | 362 | ||
375 | static inline void swap_free(swp_entry_t swp) | 363 | static inline void swap_free(swp_entry_t swp) |
376 | { | 364 | { |
377 | } | 365 | } |
378 | 366 | ||
367 | static inline void swapcache_free(swp_entry_t swp, struct page *page) | ||
368 | { | ||
369 | } | ||
370 | |||
379 | static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, | 371 | static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, |
380 | struct vm_area_struct *vma, unsigned long addr) | 372 | struct vm_area_struct *vma, unsigned long addr) |
381 | { | 373 | { |