Commit b339158a authored by David S. Miller's avatar David S. Miller

[MM]: PTRS_PER_{PUD,PMD} are not necessarily compile time constants.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2e5cbd2d
...@@ -2089,7 +2089,6 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma, ...@@ -2089,7 +2089,6 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
} }
#ifndef __ARCH_HAS_4LEVEL_HACK #ifndef __ARCH_HAS_4LEVEL_HACK
#if (PTRS_PER_PUD > 1)
/* /*
* Allocate page upper directory. * Allocate page upper directory.
* *
...@@ -2101,6 +2100,7 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma, ...@@ -2101,6 +2100,7 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
*/ */
pud_t fastcall *__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) pud_t fastcall *__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
{ {
if (PTRS_PER_PUD > 1) {
pud_t *new; pud_t *new;
spin_unlock(&mm->page_table_lock); spin_unlock(&mm->page_table_lock);
...@@ -2118,12 +2118,12 @@ pud_t fastcall *__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long addr ...@@ -2118,12 +2118,12 @@ pud_t fastcall *__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long addr
goto out; goto out;
} }
pgd_populate(mm, pgd, new); pgd_populate(mm, pgd, new);
out: out:
return pud_offset(pgd, address); return pud_offset(pgd, address);
}
return NULL;
} }
#endif
#if (PTRS_PER_PMD > 1)
/* /*
* Allocate page middle directory. * Allocate page middle directory.
* *
...@@ -2135,6 +2135,7 @@ pud_t fastcall *__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long addr ...@@ -2135,6 +2135,7 @@ pud_t fastcall *__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long addr
*/ */
pmd_t fastcall *__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) pmd_t fastcall *__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
{ {
if (PTRS_PER_PMD > 1) {
pmd_t *new; pmd_t *new;
spin_unlock(&mm->page_table_lock); spin_unlock(&mm->page_table_lock);
...@@ -2152,10 +2153,11 @@ pmd_t fastcall *__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long addr ...@@ -2152,10 +2153,11 @@ pmd_t fastcall *__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long addr
goto out; goto out;
} }
pud_populate(mm, pud, new); pud_populate(mm, pud, new);
out: out:
return pmd_offset(pud, address); return pmd_offset(pud, address);
}
return NULL;
} }
#endif
#else #else
pmd_t fastcall *__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) pmd_t fastcall *__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment