migrate.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef _LINUX_MIGRATE_H
  2. #define _LINUX_MIGRATE_H
  3. #include <linux/mm.h>
  4. #include <linux/mempolicy.h>
  5. #include <linux/migrate_mode.h>
  6. typedef struct page *new_page_t(struct page *, unsigned long private, int **);
  7. #ifdef CONFIG_MIGRATION
  8. extern void putback_lru_pages(struct list_head *l);
  9. extern int migrate_page(struct address_space *,
  10. struct page *, struct page *, enum migrate_mode);
  11. extern int migrate_pages(struct list_head *l, new_page_t x,
  12. unsigned long private, bool offlining,
  13. enum migrate_mode mode);
  14. extern int migrate_huge_pages(struct list_head *l, new_page_t x,
  15. unsigned long private, bool offlining,
  16. enum migrate_mode mode);
  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. static inline void putback_lru_pages(struct list_head *l) {}
  29. static inline int migrate_pages(struct list_head *l, new_page_t x,
  30. unsigned long private, bool offlining,
  31. enum migrate_mode mode) { return -ENOSYS; }
  32. static inline int migrate_huge_pages(struct list_head *l, new_page_t x,
  33. unsigned long private, bool offlining,
  34. enum migrate_mode mode) { return -ENOSYS; }
  35. static inline int migrate_prep(void) { return -ENOSYS; }
  36. static inline int migrate_prep_local(void) { return -ENOSYS; }
  37. static inline int migrate_vmas(struct mm_struct *mm,
  38. const nodemask_t *from, const nodemask_t *to,
  39. unsigned long flags)
  40. {
  41. return -ENOSYS;
  42. }
  43. static inline void migrate_page_copy(struct page *newpage,
  44. struct page *page) {}
  45. static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
  46. struct page *newpage, struct page *page)
  47. {
  48. return -ENOSYS;
  49. }
  50. /* Possible settings for the migrate_page() method in address_operations */
  51. #define migrate_page NULL
  52. #define fail_migrate_page NULL
  53. #endif /* CONFIG_MIGRATION */
  54. #endif /* _LINUX_MIGRATE_H */