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>
This commit is contained in:

committad av
Linus Torvalds

förälder
4c182ae781
incheckning
4a56758204
@@ -21,7 +21,7 @@
|
||||
/* allocated in paging_init, zeroed in mem_init, and unchanged thereafter */
|
||||
unsigned long *empty_zero_page = NULL;
|
||||
/* allocated in paging_init and unchanged thereafter */
|
||||
unsigned long *empty_bad_page = NULL;
|
||||
static unsigned long *empty_bad_page = NULL;
|
||||
|
||||
/*
|
||||
* Initialized during boot, and readonly for initializing page tables
|
||||
@@ -240,37 +240,6 @@ void __init paging_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
struct page *arch_validate(struct page *page, gfp_t mask, int order)
|
||||
{
|
||||
unsigned long addr, zero = 0;
|
||||
int i;
|
||||
|
||||
again:
|
||||
if (page == NULL)
|
||||
return page;
|
||||
if (PageHighMem(page))
|
||||
return page;
|
||||
|
||||
addr = (unsigned long) page_address(page);
|
||||
for (i = 0; i < (1 << order); i++) {
|
||||
current->thread.fault_addr = (void *) addr;
|
||||
if (__do_copy_to_user((void __user *) addr, &zero,
|
||||
sizeof(zero),
|
||||
¤t->thread.fault_addr,
|
||||
¤t->thread.fault_catcher)) {
|
||||
if (!(mask & __GFP_WAIT))
|
||||
return NULL;
|
||||
else break;
|
||||
}
|
||||
addr += PAGE_SIZE;
|
||||
}
|
||||
|
||||
if (i == (1 << order))
|
||||
return page;
|
||||
page = alloc_pages(mask, order);
|
||||
goto again;
|
||||
}
|
||||
|
||||
/*
|
||||
* This can't do anything because nothing in the kernel image can be freed
|
||||
* since it's not in kernel physical memory.
|
||||
|
Referens i nytt ärende
Block a user