migrate.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _LINUX_MIGRATE_H
  2. #define _LINUX_MIGRATE_H
  3. #include <linux/mm.h>
  4. typedef struct page *new_page_t(struct page *, unsigned long private, int **);
  5. /* Check if a vma is migratable */
  6. static inline int vma_migratable(struct vm_area_struct *vma)
  7. {
  8. if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED))
  9. return 0;
  10. return 1;
  11. }
  12. #ifdef CONFIG_MIGRATION
  13. extern int isolate_lru_page(struct page *p, struct list_head *pagelist);
  14. extern int putback_lru_pages(struct list_head *l);
  15. extern int migrate_page(struct address_space *,
  16. struct page *, struct page *);
  17. extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long);
  18. extern int fail_migrate_page(struct address_space *,
  19. struct page *, struct page *);
  20. extern int migrate_prep(void);
  21. extern int migrate_vmas(struct mm_struct *mm,
  22. const nodemask_t *from, const nodemask_t *to,
  23. unsigned long flags);
  24. #else
  25. static inline int isolate_lru_page(struct page *p, struct list_head *list)
  26. { return -ENOSYS; }
  27. static inline int putback_lru_pages(struct list_head *l) { return 0; }
  28. static inline int migrate_pages(struct list_head *l, new_page_t x,
  29. unsigned long private) { return -ENOSYS; }
  30. static inline int migrate_pages_to(struct list_head *pagelist,
  31. struct vm_area_struct *vma, int dest) { return 0; }
  32. static inline int migrate_prep(void) { return -ENOSYS; }
  33. static inline int migrate_vmas(struct mm_struct *mm,
  34. const nodemask_t *from, const nodemask_t *to,
  35. unsigned long flags)
  36. {
  37. return -ENOSYS;
  38. }
  39. /* Possible settings for the migrate_page() method in address_operations */
  40. #define migrate_page NULL
  41. #define fail_migrate_page NULL
  42. #endif /* CONFIG_MIGRATION */
  43. #endif /* _LINUX_MIGRATE_H */