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.h42
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
239extern int page_evictable(struct page *page, struct vm_area_struct *vma); 239extern int page_evictable(struct page *page, struct vm_area_struct *vma);
240extern void scan_mapping_unevictable_pages(struct address_space *); 240extern 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 *);
245extern int scan_unevictable_register_node(struct node *node); 245extern int scan_unevictable_register_node(struct node *node);
246extern void scan_unevictable_unregister_node(struct node *node); 246extern void scan_unevictable_unregister_node(struct node *node);
247#else
248static inline int page_evictable(struct page *page,
249 struct vm_area_struct *vma)
250{
251 return 1;
252}
253
254static inline void scan_mapping_unevictable_pages(struct address_space *mapping)
255{
256}
257
258static inline int scan_unevictable_register_node(struct node *node)
259{
260 return 0;
261}
262
263static inline void scan_unevictable_unregister_node(struct node *node) { }
264#endif
265 247
266extern int kswapd_run(int nid); 248extern 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 */
277extern int swap_readpage(struct file *, struct page *); 259extern int swap_readpage(struct page *);
278extern int swap_writepage(struct page *page, struct writeback_control *wbc); 260extern int swap_writepage(struct page *page, struct writeback_control *wbc);
279extern void end_swap_bio_read(struct bio *bio, int err); 261extern void end_swap_bio_read(struct bio *bio, int err);
280 262
@@ -300,9 +282,11 @@ extern long total_swap_pages;
300extern void si_swapinfo(struct sysinfo *); 282extern void si_swapinfo(struct sysinfo *);
301extern swp_entry_t get_swap_page(void); 283extern swp_entry_t get_swap_page(void);
302extern swp_entry_t get_swap_page_of_type(int); 284extern swp_entry_t get_swap_page_of_type(int);
303extern int swap_duplicate(swp_entry_t); 285extern void swap_duplicate(swp_entry_t);
286extern int swapcache_prepare(swp_entry_t);
304extern int valid_swaphandles(swp_entry_t, unsigned long *); 287extern int valid_swaphandles(swp_entry_t, unsigned long *);
305extern void swap_free(swp_entry_t); 288extern void swap_free(swp_entry_t);
289extern void swapcache_free(swp_entry_t, struct page *page);
306extern int free_swap_and_cache(swp_entry_t); 290extern int free_swap_and_cache(swp_entry_t);
307extern int swap_type_of(dev_t, sector_t, struct block_device **); 291extern int swap_type_of(dev_t, sector_t, struct block_device **);
308extern unsigned int count_swap_pages(int, int); 292extern 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
359static inline void swap_duplicate(swp_entry_t swp)
360{
361}
374 362
375static inline void swap_free(swp_entry_t swp) 363static inline void swap_free(swp_entry_t swp)
376{ 364{
377} 365}
378 366
367static inline void swapcache_free(swp_entry_t swp, struct page *page)
368{
369}
370
379static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, 371static 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{