Skip to content

Commit

Permalink
MIPS: Hugetlbfs: Handle huge pages correctly in pmd_bad()
Browse files Browse the repository at this point in the history
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Oct 16, 2012
1 parent 359187d commit 344afa6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion arch/mips/include/asm/pgtable-64.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef _ASM_PGTABLE_64_H
#define _ASM_PGTABLE_64_H

#include <linux/compiler.h>
#include <linux/linkage.h>

#include <asm/addrspace.h>
Expand Down Expand Up @@ -172,7 +173,19 @@ static inline int pmd_none(pmd_t pmd)
return pmd_val(pmd) == (unsigned long) invalid_pte_table;
}

#define pmd_bad(pmd) (pmd_val(pmd) & ~PAGE_MASK)
static inline int pmd_bad(pmd_t pmd)
{
#ifdef CONFIG_HUGETLB_PAGE
/* pmd_huge(pmd) but inline */
if (unlikely(pmd_val(pmd) & _PAGE_HUGE))
return 0;
#endif

if (unlikely(pmd_val(pmd) & ~PAGE_MASK))
return 1;

return 0;
}

static inline int pmd_present(pmd_t pmd)
{
Expand Down

0 comments on commit 344afa6

Please sign in to comment.