diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-02-01 06:05:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-01 11:53:17 -0500 |
commit | e965f9630c651fa4249039fd4b80c9392d07a856 (patch) | |
tree | 1353dd536d0ee549c30e462086624c21788ee9d2 /include | |
parent | 7e2ab150d1b3b286a4c864c60a549b2601777b63 (diff) |
[PATCH] Direct Migration V9: Avoid writeback / page_migrate() method
Migrate a page with buffers without requiring writeback
This introduces a new address space operation migratepage() that may be used
by a filesystem to implement its own version of page migration.
A version is provided that migrates buffers attached to pages. Some
filesystems (ext2, ext3, xfs) are modified to utilize this feature.
The swapper address space operation are modified so that a regular
migrate_page() will occur for anonymous pages without writeback (migrate_pages
forces every anonymous page to have a swap entry).
Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 8 | ||||
-rw-r--r-- | include/linux/swap.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 84bb449b9b01..e059da947007 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -363,6 +363,8 @@ struct address_space_operations { | |||
363 | loff_t offset, unsigned long nr_segs); | 363 | loff_t offset, unsigned long nr_segs); |
364 | struct page* (*get_xip_page)(struct address_space *, sector_t, | 364 | struct page* (*get_xip_page)(struct address_space *, sector_t, |
365 | int); | 365 | int); |
366 | /* migrate the contents of a page to the specified target */ | ||
367 | int (*migratepage) (struct page *, struct page *); | ||
366 | }; | 368 | }; |
367 | 369 | ||
368 | struct backing_dev_info; | 370 | struct backing_dev_info; |
@@ -1719,6 +1721,12 @@ extern void simple_release_fs(struct vfsmount **mount, int *count); | |||
1719 | 1721 | ||
1720 | extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); | 1722 | extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); |
1721 | 1723 | ||
1724 | #ifdef CONFIG_MIGRATION | ||
1725 | extern int buffer_migrate_page(struct page *, struct page *); | ||
1726 | #else | ||
1727 | #define buffer_migrate_page NULL | ||
1728 | #endif | ||
1729 | |||
1722 | extern int inode_change_ok(struct inode *, struct iattr *); | 1730 | extern int inode_change_ok(struct inode *, struct iattr *); |
1723 | extern int __must_check inode_setattr(struct inode *, struct iattr *); | 1731 | extern int __must_check inode_setattr(struct inode *, struct iattr *); |
1724 | 1732 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index 229b6d04b4b6..f3e17d5963c3 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -193,13 +193,18 @@ extern int isolate_lru_page(struct page *p); | |||
193 | extern int putback_lru_pages(struct list_head *l); | 193 | extern int putback_lru_pages(struct list_head *l); |
194 | extern int migrate_page(struct page *, struct page *); | 194 | extern int migrate_page(struct page *, struct page *); |
195 | extern void migrate_page_copy(struct page *, struct page *); | 195 | extern void migrate_page_copy(struct page *, struct page *); |
196 | extern int migrate_page_remove_references(struct page *, struct page *, int); | ||
196 | extern int migrate_pages(struct list_head *l, struct list_head *t, | 197 | extern int migrate_pages(struct list_head *l, struct list_head *t, |
197 | struct list_head *moved, struct list_head *failed); | 198 | struct list_head *moved, struct list_head *failed); |
199 | extern int fail_migrate_page(struct page *, struct page *); | ||
198 | #else | 200 | #else |
199 | static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } | 201 | static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } |
200 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | 202 | static inline int putback_lru_pages(struct list_head *l) { return 0; } |
201 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | 203 | static inline int migrate_pages(struct list_head *l, struct list_head *t, |
202 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | 204 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } |
205 | /* Possible settings for the migrate_page() method in address_operations */ | ||
206 | #define migrate_page NULL | ||
207 | #define fail_migrate_page NULL | ||
203 | #endif | 208 | #endif |
204 | 209 | ||
205 | #ifdef CONFIG_MMU | 210 | #ifdef CONFIG_MMU |