migrate.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 *, bool);
  11. extern int migrate_pages(struct list_head *l, new_page_t x,
  12. unsigned long private, bool offlining,
  13. bool sync);
  14. extern int migrate_huge_pages(struct list_head *l, new_page_t x,
  15. unsigned long private, bool offlining,
  16. bool sync);
  17. extern int fail_migrate_page(struct address_space *,
  18. struct page *, struct page *);
  19. extern int migrate_prep(void);
  20. extern int migrate_prep_local(void);
  21. extern int migrate_vmas(struct mm_struct *mm,
  22. const nodemask_t *from, const nodemask_t *to,
  23. unsigned long flags);
  24. extern void migrate_page_copy(struct page *newpage, struct page *page);
  25. extern int migrate_huge_page_move_mapping(struct address_space *mapping,
  26. struct page *newpage, struct page *page);
  27. #else
  28. #define PAGE_MIGRATION 0
  29. static inline void putback_lru_pages(struct list_head *l) {}
  30. static inline int migrate_pages(struct list_head *l, new_page_t x,
  31. unsigned long private, bool offlining,
  32. bool sync) { return -ENOSYS; }
  33. static inline int migrate_huge_pages(struct list_head *l, new_page_t x,
  34. unsigned long private, bool offlining,
  35. bool sync) { return -ENOSYS; }
  36. static inline int migrate_prep(void) { return -ENOSYS; }
  37. static inline int migrate_prep_local(void) { return -ENOSYS; }
  38. static inline int migrate_vmas(struct mm_struct *mm,
  39. const nodemask_t *from, const nodemask_t *to,
  40. unsigned long flags)
  41. {
  42. return -ENOSYS;
  43. }
  44. static inline void migrate_page_copy(struct page *newpage,
  45. struct page *page) {}
  46. static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
  47. struct page *newpage, struct page *page)
  48. {
  49. return -ENOSYS;
  50. }
  51. /* Possible settings for the migrate_page() method in address_operations */
  52. #define migrate_page NULL
  53. #define fail_migrate_page NULL
  54. #endif /* CONFIG_MIGRATION */
  55. #endif /* _LINUX_MIGRATE_H */