1 #ifndef _LINUX_MIGRATE_H
2 #define _LINUX_MIGRATE_H
5 #include <linux/mempolicy.h>
7 typedef struct page *new_page_t(struct page *, unsigned long private, int **);
10 * MIGRATE_ASYNC means never block
11 * MIGRATE_SYNC_LIGHT in the current implementation means to allow blocking
12 * on most operations but not ->writepage as the potential stall time
14 * MIGRATE_SYNC will block when migrating pages
22 #ifdef CONFIG_MIGRATION
23 #define PAGE_MIGRATION 1
25 extern void putback_lru_pages(struct list_head *l);
26 extern int migrate_page(struct address_space *,
27 struct page *, struct page *, enum migrate_mode);
28 extern int migrate_pages(struct list_head *l, new_page_t x,
29 unsigned long private, bool offlining,
30 enum migrate_mode mode);
31 extern int migrate_huge_pages(struct list_head *l, new_page_t x,
32 unsigned long private, bool offlining,
33 enum migrate_mode mode);
35 extern int fail_migrate_page(struct address_space *,
36 struct page *, struct page *);
38 extern int migrate_prep(void);
39 extern int migrate_prep_local(void);
40 extern int migrate_vmas(struct mm_struct *mm,
41 const nodemask_t *from, const nodemask_t *to,
43 extern void migrate_page_copy(struct page *newpage, struct page *page);
44 extern int migrate_huge_page_move_mapping(struct address_space *mapping,
45 struct page *newpage, struct page *page);
46 extern int migrate_page_move_mapping(struct address_space *mapping,
47 struct page *newpage, struct page *page,
48 struct buffer_head *head, enum migrate_mode mode);
50 #define PAGE_MIGRATION 0
52 static inline void putback_lru_pages(struct list_head *l) {}
53 static inline int migrate_pages(struct list_head *l, new_page_t x,
54 unsigned long private, bool offlining,
55 enum migrate_mode mode) { return -ENOSYS; }
56 static inline int migrate_huge_pages(struct list_head *l, new_page_t x,
57 unsigned long private, bool offlining,
58 enum migrate_mode mode) { return -ENOSYS; }
60 static inline int migrate_prep(void) { return -ENOSYS; }
61 static inline int migrate_prep_local(void) { return -ENOSYS; }
63 static inline int migrate_vmas(struct mm_struct *mm,
64 const nodemask_t *from, const nodemask_t *to,
70 static inline void migrate_page_copy(struct page *newpage,
73 static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
74 struct page *newpage, struct page *page)
79 /* Possible settings for the migrate_page() method in address_operations */
80 #define migrate_page NULL
81 #define fail_migrate_page NULL
83 #endif /* CONFIG_MIGRATION */
84 #endif /* _LINUX_MIGRATE_H */