xref: /openbsd/sys/dev/pci/drm/include/linux/swap.h (revision 53e1df33)
1 /* Public domain. */
2 
3 #ifndef _LINUX_SWAP_H
4 #define _LINUX_SWAP_H
5 
6 /*
7  * normally clock.h would be indirectly included via
8  *
9  * linux/memcontrol.h
10  * linux/writeback.h
11  * linux/blk-cgroup.h
12  * linux/blkdev.h
13  * linux/sched/clock.h
14  */
15 #include <linux/sched/clock.h>
16 
17 /*
18  * normally module.h would be indirectly included via
19  *
20  * linux/memcontrol.h
21  * linux/cgroup.h
22  * linux/cgroup-defs.h
23  * linux/bpf-cgroup.h
24  * linux/bpf.h
25  * linux/module.h
26  */
27 #include <linux/module.h>
28 
29 #include <uvm/uvm_extern.h>
30 
31 static inline long
get_nr_swap_pages(void)32 get_nr_swap_pages(void)
33 {
34 	return uvmexp.swpages - uvmexp.swpginuse;
35 }
36 
37 /*
38  * XXX For now, we don't want the shrinker to be too aggressive, so
39  * pretend we're not called from the pagedaemon even if we are.
40  */
41 static inline int
current_is_kswapd(void)42 current_is_kswapd(void)
43 {
44 	return 0;
45 }
46 
47 #endif
48