migrate.h 1.3 KB

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