swap_cgroup.h 876 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __LINUX_SWAP_CGROUP_H
  2. #define __LINUX_SWAP_CGROUP_H
  3. #include <linux/swap.h>
  4. #ifdef CONFIG_MEMCG_SWAP
  5. extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
  6. unsigned short old, unsigned short new);
  7. extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id);
  8. extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent);
  9. extern int swap_cgroup_swapon(int type, unsigned long max_pages);
  10. extern void swap_cgroup_swapoff(int type);
  11. #else
  12. static inline
  13. unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id)
  14. {
  15. return 0;
  16. }
  17. static inline
  18. unsigned short lookup_swap_cgroup_id(swp_entry_t ent)
  19. {
  20. return 0;
  21. }
  22. static inline int
  23. swap_cgroup_swapon(int type, unsigned long max_pages)
  24. {
  25. return 0;
  26. }
  27. static inline void swap_cgroup_swapoff(int type)
  28. {
  29. return;
  30. }
  31. #endif /* CONFIG_MEMCG_SWAP */
  32. #endif /* __LINUX_SWAP_CGROUP_H */