migrate.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 isolate_lru_page(struct page *p, struct list_head *pagelist);
  8. extern int 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, unsigned long);
  12. extern int fail_migrate_page(struct address_space *,
  13. struct page *, struct page *);
  14. extern int migrate_prep(void);
  15. extern int migrate_vmas(struct mm_struct *mm,
  16. const nodemask_t *from, const nodemask_t *to,
  17. unsigned long flags);
  18. #else
  19. static inline int isolate_lru_page(struct page *p, struct list_head *list)
  20. { return -ENOSYS; }
  21. static inline int putback_lru_pages(struct list_head *l) { return 0; }
  22. static inline int migrate_pages(struct list_head *l, new_page_t x,
  23. unsigned long private) { return -ENOSYS; }
  24. static inline int migrate_pages_to(struct list_head *pagelist,
  25. struct vm_area_struct *vma, int dest) { return 0; }
  26. static inline int migrate_prep(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 */