migrate.h 1.3 KB

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