migrate.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _LINUX_MIGRATE_H
  2. #define _LINUX_MIGRATE_H
  3. #include <linux/mm.h>
  4. #include <linux/mempolicy.h>
  5. typedef struct page *new_page_t(struct page *, unsigned long private, int **);
  6. #ifdef CONFIG_MIGRATION
  7. #define PAGE_MIGRATION 1
  8. extern int putback_lru_pages(struct list_head *l);
  9. extern int migrate_page(struct address_space *,
  10. struct page *, struct page *);
  11. extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long);
  12. extern int fail_migrate_page(struct address_space *,
  13. struct page *, struct page *);
  14. extern int migrate_prep(void);
  15. extern int migrate_vmas(struct mm_struct *mm,
  16. const nodemask_t *from, const nodemask_t *to,
  17. unsigned long flags);
  18. #else
  19. #define PAGE_MIGRATION 0
  20. static inline int putback_lru_pages(struct list_head *l) { return 0; }
  21. static inline int migrate_pages(struct list_head *l, new_page_t x,
  22. unsigned long private) { return -ENOSYS; }
  23. static inline int migrate_pages_to(struct list_head *pagelist,
  24. struct vm_area_struct *vma, int dest) { return 0; }
  25. static inline int migrate_prep(void) { return -ENOSYS; }
  26. static inline int migrate_vmas(struct mm_struct *mm,
  27. const nodemask_t *from, const nodemask_t *to,
  28. unsigned long flags)
  29. {
  30. return -ENOSYS;
  31. }
  32. /* Possible settings for the migrate_page() method in address_operations */
  33. #define migrate_page NULL
  34. #define fail_migrate_page NULL
  35. #endif /* CONFIG_MIGRATION */
  36. #endif /* _LINUX_MIGRATE_H */