Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1#ifndef _LINUX_MIGRATE_H
2#define _LINUX_MIGRATE_H
3
4#include <linux/mm.h>
5#include <linux/mempolicy.h>
6#include <linux/migrate_mode.h>
7
8typedef struct page *new_page_t(struct page *, unsigned long private, int **);
9
10#ifdef CONFIG_MIGRATION
11#define PAGE_MIGRATION 1
12
13extern void putback_lru_pages(struct list_head *l);
14extern int migrate_page(struct address_space *,
15 struct page *, struct page *, enum migrate_mode);
16extern int migrate_pages(struct list_head *l, new_page_t x,
17 unsigned long private, bool offlining,
18 enum migrate_mode mode);
19extern int migrate_huge_pages(struct list_head *l, new_page_t x,
20 unsigned long private, bool offlining,
21 enum migrate_mode mode);
22
23extern int fail_migrate_page(struct address_space *,
24 struct page *, struct page *);
25
26extern int migrate_prep(void);
27extern int migrate_prep_local(void);
28extern int migrate_vmas(struct mm_struct *mm,
29 const nodemask_t *from, const nodemask_t *to,
30 unsigned long flags);
31extern void migrate_page_copy(struct page *newpage, struct page *page);
32extern int migrate_huge_page_move_mapping(struct address_space *mapping,
33 struct page *newpage, struct page *page);
34#else
35#define PAGE_MIGRATION 0
36
37static inline void putback_lru_pages(struct list_head *l) {}
38static inline int migrate_pages(struct list_head *l, new_page_t x,
39 unsigned long private, bool offlining,
40 enum migrate_mode mode) { return -ENOSYS; }
41static inline int migrate_huge_pages(struct list_head *l, new_page_t x,
42 unsigned long private, bool offlining,
43 enum migrate_mode mode) { return -ENOSYS; }
44
45static inline int migrate_prep(void) { return -ENOSYS; }
46static inline int migrate_prep_local(void) { return -ENOSYS; }
47
48static inline int migrate_vmas(struct mm_struct *mm,
49 const nodemask_t *from, const nodemask_t *to,
50 unsigned long flags)
51{
52 return -ENOSYS;
53}
54
55static inline void migrate_page_copy(struct page *newpage,
56 struct page *page) {}
57
58static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
59 struct page *newpage, struct page *page)
60{
61 return -ENOSYS;
62}
63
64/* Possible settings for the migrate_page() method in address_operations */
65#define migrate_page NULL
66#define fail_migrate_page NULL
67
68#endif /* CONFIG_MIGRATION */
69#endif /* _LINUX_MIGRATE_H */