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,
}
#ifndef __ARCH_HAS_4LEVEL_HACK
#if (PTRS_PER_PUD > 1)
/*
* Allocate page upper directory.
*
......@@ -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)
{
if (PTRS_PER_PUD > 1) {
pud_t *new;
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
goto out;
}
pgd_populate(mm, pgd, new);
out:
out:
return pud_offset(pgd, address);
}
return NULL;
}
#endif
#if (PTRS_PER_PMD > 1)
/*
* Allocate page middle directory.
*
......@@ -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)
{
if (PTRS_PER_PMD > 1) {
pmd_t *new;
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
goto out;
}
pud_populate(mm, pud, new);
out:
out:
return pmd_offset(pud, address);
}
return NULL;
}
#endif
#else
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