[PATCH] mm: uml kill unused
authorHugh Dickins <hugh@veritas.com>
Sun, 30 Oct 2005 01:16:39 +0000 (18:16 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 30 Oct 2005 04:40:42 +0000 (21:40 -0700)
In worrying over the various pte operations in different architectures, I came
across some unused functions in UML: remove mprotect_kernel_vm,
protect_vm_page and addr_pte.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/include/tlb.h
arch/um/kernel/tt/tlb.c

index 45d7da6c3b2c5a3eb25715e280e2274e32dcf155..8efc1e0f1b841ac9a8d1e2aaec2f00c40e637548 100644 (file)
@@ -34,7 +34,6 @@ struct host_vm_op {
        } u;
 };
 
-extern void mprotect_kernel_vm(int w);
 extern void force_flush_all(void);
 extern void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
                              unsigned long end_addr, int force,
index f1d85dbb45b9827d50f325d0d9560d4f3d4a09db..ae6217c86135aca52eff19d919e294a4dd5b86b6 100644 (file)
@@ -74,42 +74,6 @@ void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end)
                 atomic_inc(&vmchange_seq);
 }
 
-static void protect_vm_page(unsigned long addr, int w, int must_succeed)
-{
-       int err;
-
-       err = protect_memory(addr, PAGE_SIZE, 1, w, 1, must_succeed);
-       if(err == 0) return;
-       else if((err == -EFAULT) || (err == -ENOMEM)){
-               flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
-               protect_vm_page(addr, w, 1);
-       }
-       else panic("protect_vm_page : protect failed, errno = %d\n", err);
-}
-
-void mprotect_kernel_vm(int w)
-{
-       struct mm_struct *mm;
-       pgd_t *pgd;
-       pud_t *pud;
-       pmd_t *pmd;
-       pte_t *pte;
-       unsigned long addr;
-       
-       mm = &init_mm;
-       for(addr = start_vm; addr < end_vm;){
-               pgd = pgd_offset(mm, addr);
-               pud = pud_offset(pgd, addr);
-               pmd = pmd_offset(pud, addr);
-               if(pmd_present(*pmd)){
-                       pte = pte_offset_kernel(pmd, addr);
-                       if(pte_present(*pte)) protect_vm_page(addr, w, 0);
-                       addr += PAGE_SIZE;
-               }
-               else addr += PMD_SIZE;
-       }
-}
-
 void flush_tlb_kernel_vm_tt(void)
 {
         flush_tlb_kernel_range(start_vm, end_vm);