diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2008-07-24 00:28:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:24 -0400 |
commit | 4a5675820436e4ad738dd442c1cc8a165101509b (patch) | |
tree | 95781177e1a055e74c9a163137030537134ef4d8 /arch/um | |
parent | 4c182ae7810f3fe444e666f3f78c209a7c116fdf (diff) |
arch/um/kernel/mem.c: remove arch_validate()
- Remove arch_validate(), because no one uses it.
- Remove useless macro HAVE_ARCH_VALIDATE.
- Make the variable 'empty_bad_page' static.
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: WANG Cong <wangcong@zeuux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/kernel/ksyms.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/mem.c | 33 |
2 files changed, 1 insertions, 33 deletions
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c index ccc02a616c22..836fc9b94707 100644 --- a/arch/um/kernel/ksyms.c +++ b/arch/um/kernel/ksyms.c | |||
@@ -18,7 +18,6 @@ EXPORT_SYMBOL(get_signals); | |||
18 | EXPORT_SYMBOL(kernel_thread); | 18 | EXPORT_SYMBOL(kernel_thread); |
19 | EXPORT_SYMBOL(sys_waitpid); | 19 | EXPORT_SYMBOL(sys_waitpid); |
20 | EXPORT_SYMBOL(flush_tlb_range); | 20 | EXPORT_SYMBOL(flush_tlb_range); |
21 | EXPORT_SYMBOL(arch_validate); | ||
22 | 21 | ||
23 | EXPORT_SYMBOL(high_physmem); | 22 | EXPORT_SYMBOL(high_physmem); |
24 | EXPORT_SYMBOL(empty_zero_page); | 23 | EXPORT_SYMBOL(empty_zero_page); |
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index b0ee64622ff7..e2274ef3155d 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /* allocated in paging_init, zeroed in mem_init, and unchanged thereafter */ | 21 | /* allocated in paging_init, zeroed in mem_init, and unchanged thereafter */ |
22 | unsigned long *empty_zero_page = NULL; | 22 | unsigned long *empty_zero_page = NULL; |
23 | /* allocated in paging_init and unchanged thereafter */ | 23 | /* allocated in paging_init and unchanged thereafter */ |
24 | unsigned long *empty_bad_page = NULL; | 24 | static unsigned long *empty_bad_page = NULL; |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * Initialized during boot, and readonly for initializing page tables | 27 | * Initialized during boot, and readonly for initializing page tables |
@@ -240,37 +240,6 @@ void __init paging_init(void) | |||
240 | #endif | 240 | #endif |
241 | } | 241 | } |
242 | 242 | ||
243 | struct page *arch_validate(struct page *page, gfp_t mask, int order) | ||
244 | { | ||
245 | unsigned long addr, zero = 0; | ||
246 | int i; | ||
247 | |||
248 | again: | ||
249 | if (page == NULL) | ||
250 | return page; | ||
251 | if (PageHighMem(page)) | ||
252 | return page; | ||
253 | |||
254 | addr = (unsigned long) page_address(page); | ||
255 | for (i = 0; i < (1 << order); i++) { | ||
256 | current->thread.fault_addr = (void *) addr; | ||
257 | if (__do_copy_to_user((void __user *) addr, &zero, | ||
258 | sizeof(zero), | ||
259 | ¤t->thread.fault_addr, | ||
260 | ¤t->thread.fault_catcher)) { | ||
261 | if (!(mask & __GFP_WAIT)) | ||
262 | return NULL; | ||
263 | else break; | ||
264 | } | ||
265 | addr += PAGE_SIZE; | ||
266 | } | ||
267 | |||
268 | if (i == (1 << order)) | ||
269 | return page; | ||
270 | page = alloc_pages(mask, order); | ||
271 | goto again; | ||
272 | } | ||
273 | |||
274 | /* | 243 | /* |
275 | * This can't do anything because nothing in the kernel image can be freed | 244 | * This can't do anything because nothing in the kernel image can be freed |
276 | * since it's not in kernel physical memory. | 245 | * since it's not in kernel physical memory. |