migrate.h 2.0 KB
Newer Older
C
Christoph Lameter 已提交
1 2 3 4
#ifndef _LINUX_MIGRATE_H
#define _LINUX_MIGRATE_H

#include <linux/mm.h>
5
#include <linux/mempolicy.h>
C
Christoph Lameter 已提交
6

7
typedef struct page *new_page_t(struct page *, unsigned long private, int **);
8

9
#ifdef CONFIG_MIGRATION
10 11
#define PAGE_MIGRATION 1

12
extern void putback_lru_pages(struct list_head *l);
13 14
extern int migrate_page(struct address_space *,
			struct page *, struct page *);
15 16
extern int migrate_pages(struct list_head *l, new_page_t x,
			unsigned long private, int offlining);
N
Naoya Horiguchi 已提交
17 18
extern int migrate_huge_pages(struct list_head *l, new_page_t x,
			unsigned long private, int offlining);
19

20 21
extern int fail_migrate_page(struct address_space *,
			struct page *, struct page *);
C
Christoph Lameter 已提交
22 23

extern int migrate_prep(void);
24
extern int migrate_prep_local(void);
25 26 27
extern int migrate_vmas(struct mm_struct *mm,
		const nodemask_t *from, const nodemask_t *to,
		unsigned long flags);
N
Naoya Horiguchi 已提交
28 29 30
extern void migrate_page_copy(struct page *newpage, struct page *page);
extern int migrate_huge_page_move_mapping(struct address_space *mapping,
				  struct page *newpage, struct page *page);
C
Christoph Lameter 已提交
31
#else
32 33
#define PAGE_MIGRATION 0

34
static inline void putback_lru_pages(struct list_head *l) {}
35
static inline int migrate_pages(struct list_head *l, new_page_t x,
36
		unsigned long private, int offlining) { return -ENOSYS; }
N
Naoya Horiguchi 已提交
37 38
static inline int migrate_huge_pages(struct list_head *l, new_page_t x,
		unsigned long private, int offlining) { return -ENOSYS; }
39

C
Christoph Lameter 已提交
40
static inline int migrate_prep(void) { return -ENOSYS; }
41
static inline int migrate_prep_local(void) { return -ENOSYS; }
C
Christoph Lameter 已提交
42

43 44 45 46 47 48 49
static inline int migrate_vmas(struct mm_struct *mm,
		const nodemask_t *from, const nodemask_t *to,
		unsigned long flags)
{
	return -ENOSYS;
}

N
Naoya Horiguchi 已提交
50 51 52
static inline void migrate_page_copy(struct page *newpage,
				     struct page *page) {}

53
static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
N
Naoya Horiguchi 已提交
54 55 56 57 58
				  struct page *newpage, struct page *page)
{
	return -ENOSYS;
}

C
Christoph Lameter 已提交
59 60 61 62 63 64
/* Possible settings for the migrate_page() method in address_operations */
#define migrate_page NULL
#define fail_migrate_page NULL

#endif /* CONFIG_MIGRATION */
#endif /* _LINUX_MIGRATE_H */