]> err.no Git - linux-2.6/blobdiff - mm/mmap.c
[PATCH] unpaged: unifdefed PageCompound
[linux-2.6] / mm / mmap.c
index fa35323a3c5b94a9e5290b93fd43f1717b3cb173..11ca5927d5ff72575e2c34025a5f6e810d2ef7b4 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -155,10 +155,6 @@ int __vm_enough_memory(long pages, int cap_sys_admin)
        return -ENOMEM;
 }
 
-EXPORT_SYMBOL(sysctl_overcommit_memory);
-EXPORT_SYMBOL(sysctl_overcommit_ratio);
-EXPORT_SYMBOL(sysctl_max_map_count);
-EXPORT_SYMBOL(vm_committed_space);
 EXPORT_SYMBOL(__vm_enough_memory);
 
 /*
@@ -1080,17 +1076,6 @@ munmap_back:
                error = file->f_op->mmap(file, vma);
                if (error)
                        goto unmap_and_free_vma;
-               if ((vma->vm_flags & (VM_SHARED | VM_WRITE | VM_RESERVED))
-                                               == (VM_WRITE | VM_RESERVED)) {
-                       printk(KERN_WARNING "program %s is using MAP_PRIVATE, "
-                               "PROT_WRITE mmap of VM_RESERVED memory, which "
-                               "is deprecated. Please report this to "
-                               "linux-kernel@vger.kernel.org\n",current->comm);
-                       if (vma->vm_ops && vma->vm_ops->close)
-                               vma->vm_ops->close(vma);
-                       error = -EACCES;
-                       goto unmap_and_free_vma;
-               }
        } else if (vm_flags & VM_SHARED) {
                error = shmem_zero_setup(vma);
                if (error)
@@ -1505,7 +1490,7 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
  * PA-RISC uses this for its stack; IA64 for its Register Backing Store.
  * vma is the last one with address > vma->vm_end.  Have to extend vma.
  */
-#ifdef CONFIG_STACK_GROWSUP
+#ifndef CONFIG_IA64
 static inline
 #endif
 int expand_upwards(struct vm_area_struct *vma, unsigned long address)
@@ -1673,9 +1658,7 @@ static void unmap_region(struct mm_struct *mm,
        lru_add_drain();
        tlb = tlb_gather_mmu(mm, 0);
        update_hiwater_rss(mm);
-       spin_lock(&mm->page_table_lock);
-       unmap_vmas(&tlb, mm, vma, start, end, &nr_accounted, NULL);
-       spin_unlock(&mm->page_table_lock);
+       unmap_vmas(&tlb, vma, start, end, &nr_accounted, NULL);
        vm_unacct_memory(nr_accounted);
        free_pgtables(&tlb, vma, prev? prev->vm_end: FIRST_USER_ADDRESS,
                                 next? next->vm_start: 0);
@@ -1842,7 +1825,7 @@ asmlinkage long sys_munmap(unsigned long addr, size_t len)
 
 static inline void verify_mm_writelocked(struct mm_struct *mm)
 {
-#ifdef CONFIG_DEBUG_KERNEL
+#ifdef CONFIG_DEBUG_VM
        if (unlikely(down_read_trylock(&mm->mmap_sem))) {
                WARN_ON(1);
                up_read(&mm->mmap_sem);
@@ -1958,9 +1941,7 @@ void exit_mmap(struct mm_struct *mm)
        tlb = tlb_gather_mmu(mm, 1);
        /* Don't update_hiwater_rss(mm) here, do_exit already did */
        /* Use -1 here to ensure all VMAs in the mm are unmapped */
-       spin_lock(&mm->page_table_lock);
-       end = unmap_vmas(&tlb, mm, vma, 0, -1, &nr_accounted, NULL);
-       spin_unlock(&mm->page_table_lock);
+       end = unmap_vmas(&tlb, vma, 0, -1, &nr_accounted, NULL);
        vm_unacct_memory(nr_accounted);
        free_pgtables(&tlb, vma, FIRST_USER_ADDRESS, 0);
        tlb_finish_mmu(tlb, 0, end);