diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-03-22 03:09:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:54:06 -0500 |
commit | b20a35035f983f4ac7e29c4a68f30e43510007e0 (patch) | |
tree | fdf090ddddbcc275349f62f71adc98649e2c683b /fs/buffer.c | |
parent | 442295c94bf650221af3ef20fc68fa3e93876818 (diff) |
[PATCH] page migration reorg
Centralize the page migration functions in anticipation of additional
tinkering. Creates a new file mm/migrate.c
1. Extract buffer_migrate_page() from fs/buffer.c
2. Extract central migration code from vmscan.c
3. Extract some components from mempolicy.c
4. Export pageout() and remove_from_swap() from vmscan.c
5. Make it possible to configure NUMA systems without page migration
and non-NUMA systems with page migration.
I had to so some #ifdeffing in mempolicy.c that may need a cleanup.
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 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index a9b399402007..1d3683d496f8 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -3051,68 +3051,6 @@ asmlinkage long sys_bdflush(int func, long data) | |||
3051 | } | 3051 | } |
3052 | 3052 | ||
3053 | /* | 3053 | /* |
3054 | * Migration function for pages with buffers. This function can only be used | ||
3055 | * if the underlying filesystem guarantees that no other references to "page" | ||
3056 | * exist. | ||
3057 | */ | ||
3058 | #ifdef CONFIG_MIGRATION | ||
3059 | int buffer_migrate_page(struct page *newpage, struct page *page) | ||
3060 | { | ||
3061 | struct address_space *mapping = page->mapping; | ||
3062 | struct buffer_head *bh, *head; | ||
3063 | int rc; | ||
3064 | |||
3065 | if (!mapping) | ||
3066 | return -EAGAIN; | ||
3067 | |||
3068 | if (!page_has_buffers(page)) | ||
3069 | return migrate_page(newpage, page); | ||
3070 | |||
3071 | head = page_buffers(page); | ||
3072 | |||
3073 | rc = migrate_page_remove_references(newpage, page, 3); | ||
3074 | if (rc) | ||
3075 | return rc; | ||
3076 | |||
3077 | bh = head; | ||
3078 | do { | ||
3079 | get_bh(bh); | ||
3080 | lock_buffer(bh); | ||
3081 | bh = bh->b_this_page; | ||
3082 | |||
3083 | } while (bh != head); | ||
3084 | |||
3085 | ClearPagePrivate(page); | ||
3086 | set_page_private(newpage, page_private(page)); | ||
3087 | set_page_private(page, 0); | ||
3088 | put_page(page); | ||
3089 | get_page(newpage); | ||
3090 | |||
3091 | bh = head; | ||
3092 | do { | ||
3093 | set_bh_page(bh, newpage, bh_offset(bh)); | ||
3094 | bh = bh->b_this_page; | ||
3095 | |||
3096 | } while (bh != head); | ||
3097 | |||
3098 | SetPagePrivate(newpage); | ||
3099 | |||
3100 | migrate_page_copy(newpage, page); | ||
3101 | |||
3102 | bh = head; | ||
3103 | do { | ||
3104 | unlock_buffer(bh); | ||
3105 | put_bh(bh); | ||
3106 | bh = bh->b_this_page; | ||
3107 | |||
3108 | } while (bh != head); | ||
3109 | |||
3110 | return 0; | ||
3111 | } | ||
3112 | EXPORT_SYMBOL(buffer_migrate_page); | ||
3113 | #endif | ||
3114 | |||
3115 | /* | ||
3116 | * Buffer-head allocation | 3054 | * Buffer-head allocation |
3117 | */ | 3055 | */ |
3118 | static kmem_cache_t *bh_cachep; | 3056 | static kmem_cache_t *bh_cachep; |