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.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index c84ec68eaec9..388e70601413 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -151,6 +151,7 @@ enum {
151 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ 151 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */
152 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ 152 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */
153 SWP_BLKDEV = (1 << 6), /* its a block device */ 153 SWP_BLKDEV = (1 << 6), /* its a block device */
154 SWP_FILE = (1 << 7), /* set after swap_activate success */
154 /* add others here before... */ 155 /* add others here before... */
155 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ 156 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */
156}; 157};
@@ -301,7 +302,7 @@ static inline void scan_unevictable_unregister_node(struct node *node)
301 302
302extern int kswapd_run(int nid); 303extern int kswapd_run(int nid);
303extern void kswapd_stop(int nid); 304extern void kswapd_stop(int nid);
304#ifdef CONFIG_CGROUP_MEM_RES_CTLR 305#ifdef CONFIG_MEMCG
305extern int mem_cgroup_swappiness(struct mem_cgroup *mem); 306extern int mem_cgroup_swappiness(struct mem_cgroup *mem);
306#else 307#else
307static inline int mem_cgroup_swappiness(struct mem_cgroup *mem) 308static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
@@ -309,7 +310,7 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
309 return vm_swappiness; 310 return vm_swappiness;
310} 311}
311#endif 312#endif
312#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 313#ifdef CONFIG_MEMCG_SWAP
313extern void mem_cgroup_uncharge_swap(swp_entry_t ent); 314extern void mem_cgroup_uncharge_swap(swp_entry_t ent);
314#else 315#else
315static inline void mem_cgroup_uncharge_swap(swp_entry_t ent) 316static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)
@@ -320,8 +321,14 @@ static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)
320/* linux/mm/page_io.c */ 321/* linux/mm/page_io.c */
321extern int swap_readpage(struct page *); 322extern int swap_readpage(struct page *);
322extern int swap_writepage(struct page *page, struct writeback_control *wbc); 323extern int swap_writepage(struct page *page, struct writeback_control *wbc);
324extern int swap_set_page_dirty(struct page *page);
323extern void end_swap_bio_read(struct bio *bio, int err); 325extern void end_swap_bio_read(struct bio *bio, int err);
324 326
327int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
328 unsigned long nr_pages, sector_t start_block);
329int generic_swapfile_activate(struct swap_info_struct *, struct file *,
330 sector_t *);
331
325/* linux/mm/swap_state.c */ 332/* linux/mm/swap_state.c */
326extern struct address_space swapper_space; 333extern struct address_space swapper_space;
327#define total_swapcache_pages swapper_space.nrpages 334#define total_swapcache_pages swapper_space.nrpages
@@ -356,11 +363,12 @@ extern unsigned int count_swap_pages(int, int);
356extern sector_t map_swap_page(struct page *, struct block_device **); 363extern sector_t map_swap_page(struct page *, struct block_device **);
357extern sector_t swapdev_block(int, pgoff_t); 364extern sector_t swapdev_block(int, pgoff_t);
358extern int page_swapcount(struct page *); 365extern int page_swapcount(struct page *);
366extern struct swap_info_struct *page_swap_info(struct page *);
359extern int reuse_swap_page(struct page *); 367extern int reuse_swap_page(struct page *);
360extern int try_to_free_swap(struct page *); 368extern int try_to_free_swap(struct page *);
361struct backing_dev_info; 369struct backing_dev_info;
362 370
363#ifdef CONFIG_CGROUP_MEM_RES_CTLR 371#ifdef CONFIG_MEMCG
364extern void 372extern void
365mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); 373mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout);
366#else 374#else