Revert "Merge remote branch 'common/android-2.6.32' into develop"
author黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 08:26:01 +0000 (16:26 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 08:26:01 +0000 (16:26 +0800)
This reverts commit 5091b83839ca4ba4f6cb70eb461b35ffb15b8fb3, reversing
changes made to 0fd331518d0898229e9e6747c636c3978028e7f0.

mm/ashmem.c

index 7b75f41a2d40de72186274a7f383f7b00fb6fbc7..04e886e2c9092dd5c15afb1c81b22889106e0cea 100644 (file)
@@ -236,14 +236,6 @@ out:
        return ret;
 }
 
-static inline unsigned long
-calc_vm_may_flags(unsigned long prot)
-{
-       return _calc_vm_trans(prot, PROT_READ,  VM_MAYREAD ) |
-              _calc_vm_trans(prot, PROT_WRITE, VM_MAYWRITE) |
-              _calc_vm_trans(prot, PROT_EXEC,  VM_MAYEXEC);
-}
-
 static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
 {
        struct ashmem_area *asma = file->private_data;
@@ -258,12 +250,10 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
        }
 
        /* requested protection bits must match our allowed protection mask */
-       if (unlikely((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask)) &
-                                               calc_vm_prot_bits(PROT_MASK))) {
+       if (unlikely((vma->vm_flags & ~asma->prot_mask) & PROT_MASK)) {
                ret = -EPERM;
                goto out;
        }
-       vma->vm_flags &= ~calc_vm_may_flags(~asma->prot_mask);
 
        if (!asma->file) {
                char *name = ASHMEM_NAME_DEF;