migrate.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #ifdef CONFIG_MIGRATION
  6. extern int isolate_lru_page(struct page *p, struct list_head *pagelist);
  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 isolate_lru_page(struct page *p, struct list_head *list)
  19. { return -ENOSYS; }
  20. static inline int putback_lru_pages(struct list_head *l) { return 0; }
  21. static inline int migrate_pages(struct list_head *l, new_page_t x,
  22. unsigned long private) { return -ENOSYS; }
  23. static inline int migrate_pages_to(struct list_head *pagelist,
  24. struct vm_area_struct *vma, int dest) { return 0; }
  25. static inline int migrate_prep(void) { return -ENOSYS; }
  26. static inline int migrate_vmas(struct mm_struct *mm,
  27. const nodemask_t *from, const nodemask_t *to,
  28. unsigned long flags)
  29. {
  30. return -ENOSYS;
  31. }
  32. /* Possible settings for the migrate_page() method in address_operations */
  33. #define migrate_page NULL
  34. #define fail_migrate_page NULL
  35. #endif /* CONFIG_MIGRATION */
  36. #endif /* _LINUX_MIGRATE_H */