blob: 5b95d6568dc4ad83f5103d20462c632bc4d9b77f [file] [log] [blame]
Christoph Lameterb20a3502006-03-22 00:09:12 -08001#ifndef _LINUX_MIGRATE_H
2#define _LINUX_MIGRATE_H
3
Christoph Lameterb20a3502006-03-22 00:09:12 -08004#include <linux/mm.h>
5
Christoph Lameter95a402c2006-06-23 02:03:53 -07006typedef struct page *new_page_t(struct page *, unsigned long private);
7
Christoph Lameterb20a3502006-03-22 00:09:12 -08008#ifdef CONFIG_MIGRATION
9extern int isolate_lru_page(struct page *p, struct list_head *pagelist);
10extern int putback_lru_pages(struct list_head *l);
Christoph Lameter2d1db3b2006-06-23 02:03:33 -070011extern int migrate_page(struct address_space *,
12 struct page *, struct page *);
Christoph Lameter95a402c2006-06-23 02:03:53 -070013extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long);
14
Christoph Lameter2d1db3b2006-06-23 02:03:33 -070015extern int fail_migrate_page(struct address_space *,
16 struct page *, struct page *);
Christoph Lameterb20a3502006-03-22 00:09:12 -080017
18extern int migrate_prep(void);
19
20#else
21
22static inline int isolate_lru_page(struct page *p, struct list_head *list)
23 { return -ENOSYS; }
24static inline int putback_lru_pages(struct list_head *l) { return 0; }
Christoph Lameter95a402c2006-06-23 02:03:53 -070025static inline int migrate_pages(struct list_head *l, new_page_t x,
26 unsigned long private) { return -ENOSYS; }
Christoph Lameterb20a3502006-03-22 00:09:12 -080027
Christoph Lameter9bf9e892006-03-31 02:29:56 -080028static inline int migrate_pages_to(struct list_head *pagelist,
29 struct vm_area_struct *vma, int dest) { return 0; }
30
Christoph Lameterb20a3502006-03-22 00:09:12 -080031static inline int migrate_prep(void) { return -ENOSYS; }
32
33/* Possible settings for the migrate_page() method in address_operations */
34#define migrate_page NULL
35#define fail_migrate_page NULL
36
37#endif /* CONFIG_MIGRATION */
38#endif /* _LINUX_MIGRATE_H */