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 void 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,
  12. unsigned long private, int offlining);
  13. extern int fail_migrate_page(struct address_space *,
  14. struct page *, struct page *);
  15. extern int migrate_prep(void);
  16. extern int migrate_prep_local(void);
  17. extern int migrate_vmas(struct mm_struct *mm,
  18. const nodemask_t *from, const nodemask_t *to,
  19. unsigned long flags);
  20. #else
  21. #define PAGE_MIGRATION 0
  22. static inline void putback_lru_pages(struct list_head *l) {}
  23. static inline int migrate_pages(struct list_head *l, new_page_t x,
  24. unsigned long private, int offlining) { return -ENOSYS; }
  25. static inline int migrate_prep(void) { return -ENOSYS; }
  26. static inline int migrate_prep_local(void) { return -ENOSYS; }
  27. static inline int migrate_vmas(struct mm_struct *mm,
  28. const nodemask_t *from, const nodemask_t *to,
  29. unsigned long flags)
  30. {
  31. return -ENOSYS;
  32. }
  33. /* Possible settings for the migrate_page() method in address_operations */
  34. #define migrate_page NULL
  35. #define fail_migrate_page NULL
  36. #endif /* CONFIG_MIGRATION */
  37. #endif /* _LINUX_MIGRATE_H */