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