summaryrefslogtreecommitdiff
path: root/arch/arm/lib/uaccess_with_memcpy.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2014-04-07 23:49:35 (GMT)
committerScott Wood <scottwood@freescale.com>2014-04-07 23:49:35 (GMT)
commit62b8c978ee6b8d135d9e7953221de58000dba986 (patch)
tree683b04b2e627f6710c22c151b23c8cc9a165315e /arch/arm/lib/uaccess_with_memcpy.c
parent78fd82238d0e5716578c326404184a27ba67fd6e (diff)
downloadlinux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'arch/arm/lib/uaccess_with_memcpy.c')
-rw-r--r--arch/arm/lib/uaccess_with_memcpy.c41
1 files changed, 3 insertions, 38 deletions
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c
index 3e58d71..025f742 100644
--- a/arch/arm/lib/uaccess_with_memcpy.c
+++ b/arch/arm/lib/uaccess_with_memcpy.c
@@ -18,7 +18,6 @@
#include <linux/hardirq.h> /* for in_atomic() */
#include <linux/gfp.h>
#include <linux/highmem.h>
-#include <linux/hugetlb.h>
#include <asm/current.h>
#include <asm/page.h>
@@ -41,35 +40,7 @@ pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
return 0;
pmd = pmd_offset(pud, addr);
- if (unlikely(pmd_none(*pmd)))
- return 0;
-
- /*
- * A pmd can be bad if it refers to a HugeTLB or THP page.
- *
- * Both THP and HugeTLB pages have the same pmd layout
- * and should not be manipulated by the pte functions.
- *
- * Lock the page table for the destination and check
- * to see that it's still huge and whether or not we will
- * need to fault on write, or if we have a splitting THP.
- */
- if (unlikely(pmd_thp_or_huge(*pmd))) {
- ptl = &current->mm->page_table_lock;
- spin_lock(ptl);
- if (unlikely(!pmd_thp_or_huge(*pmd)
- || pmd_hugewillfault(*pmd)
- || pmd_trans_splitting(*pmd))) {
- spin_unlock(ptl);
- return 0;
- }
-
- *ptep = NULL;
- *ptlp = ptl;
- return 1;
- }
-
- if (unlikely(pmd_bad(*pmd)))
+ if (unlikely(pmd_none(*pmd) || pmd_bad(*pmd)))
return 0;
pte = pte_offset_map_lock(current->mm, pmd, addr, &ptl);
@@ -123,10 +94,7 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
from += tocopy;
n -= tocopy;
- if (pte)
- pte_unmap_unlock(pte, ptl);
- else
- spin_unlock(ptl);
+ pte_unmap_unlock(pte, ptl);
}
if (!atomic)
up_read(&current->mm->mmap_sem);
@@ -179,10 +147,7 @@ __clear_user_memset(void __user *addr, unsigned long n)
addr += tocopy;
n -= tocopy;
- if (pte)
- pte_unmap_unlock(pte, ptl);
- else
- spin_unlock(ptl);
+ pte_unmap_unlock(pte, ptl);
}
up_read(&current->mm->mmap_sem);